@iobroker/repochecker 5.19.1 → 5.19.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/lib/M3000_Testing.js +489 -77
- package/lib/M5600__I18n.js +5 -2
- package/lib/postprocessing.js +4 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,6 +25,11 @@ Example:
|
|
|
25
25
|
Placeholder for the next version (at the beginning of the line):
|
|
26
26
|
### **WORK IN PROGRESS**
|
|
27
27
|
-->
|
|
28
|
+
### 5.19.2 (2026-06-28)
|
|
29
|
+
|
|
30
|
+
- (mcm1957) suggest to always use i18n flag at jsonCOnfig.json
|
|
31
|
+
- (mcm1957) check of test-and.release workflow logs has been added
|
|
32
|
+
|
|
28
33
|
### 5.19.1 (2026-06-28)
|
|
29
34
|
|
|
30
35
|
- (mcm1957) checking of untranslated i18n keys has been adapted
|
package/lib/M3000_Testing.js
CHANGED
|
@@ -17,6 +17,97 @@ const config = require('./config.js');
|
|
|
17
17
|
const WORKFLOW_FILE = '/.github/workflows/test-and-release.yml';
|
|
18
18
|
const WORKFLOW_FILE_SHORT = 'test-and-release.yml';
|
|
19
19
|
|
|
20
|
+
// Reference output lines for npm run test:package (check-and-lint job).
|
|
21
|
+
// Each non-empty line must appear (as a substring) in the normalized job log.
|
|
22
|
+
// Update this list when the @iobroker/testing package changes its test output.
|
|
23
|
+
const EXPECTED_TEST_PACKAGE_LINES = [
|
|
24
|
+
'Validate the package files',
|
|
25
|
+
'Ensure they are readable',
|
|
26
|
+
'package.json',
|
|
27
|
+
'✔ exists',
|
|
28
|
+
'✔ contains valid JSON',
|
|
29
|
+
'✔ is an object',
|
|
30
|
+
'io-package.json',
|
|
31
|
+
'Check contents of package.json',
|
|
32
|
+
'✔ The property "name" exists',
|
|
33
|
+
'✔ The property "version" exists',
|
|
34
|
+
'✔ The property "description" exists',
|
|
35
|
+
'✔ The property "author" exists',
|
|
36
|
+
'✔ The property "license" exists',
|
|
37
|
+
'✔ The property "repository" exists',
|
|
38
|
+
'✔ The property "repository.type" exists',
|
|
39
|
+
'✔ The package name is correct',
|
|
40
|
+
'✔ property main is defined for non onlyWWW adapters',
|
|
41
|
+
'✔ The repository type is "git"',
|
|
42
|
+
'✔ npm is not listed as a dependency',
|
|
43
|
+
'✔ iobroker.js-controller is not listed as a dependency',
|
|
44
|
+
'Check contents of io-package.json',
|
|
45
|
+
'✔ The property "common.name" exists',
|
|
46
|
+
'✔ The property "common.titleLang" exists',
|
|
47
|
+
'✔ The property "common.version" exists',
|
|
48
|
+
'✔ The property "common.news" exists',
|
|
49
|
+
'✔ The property "common.desc" exists',
|
|
50
|
+
'✔ The property "common.icon" exists',
|
|
51
|
+
'✔ The property "common.extIcon" exists',
|
|
52
|
+
'✔ The property "common.type" exists',
|
|
53
|
+
'✔ The property "common.authors" exists',
|
|
54
|
+
'✔ The property "native" exists',
|
|
55
|
+
'✔ The title does not contain "adapter" or "iobroker"',
|
|
56
|
+
'✔ titleLang is an object to support multiple languages',
|
|
57
|
+
'✔ titleLang does not contain "adapter" or "iobroker"',
|
|
58
|
+
'✔ The description is an object to support multiple languages',
|
|
59
|
+
'✔ common.authors is an array that is not empty',
|
|
60
|
+
'✔ common.news is an object that contains maximum 20 entries',
|
|
61
|
+
'✔ if common.licenseInformation exists, it is an object with required properties',
|
|
62
|
+
'✔ common.license should not exist together with common.licenseInformation',
|
|
63
|
+
'✔ common.tier must be 1, 2 or 3',
|
|
64
|
+
'✔ The adapter uses a supported admin UI',
|
|
65
|
+
'Compare contents of package.json and io-package.json',
|
|
66
|
+
'✔ The name matches',
|
|
67
|
+
'✔ The version matches',
|
|
68
|
+
'✔ The license matches',
|
|
69
|
+
'Validate JSON files',
|
|
70
|
+
'Base directory JSON files',
|
|
71
|
+
'✔ package.json contains valid JSON',
|
|
72
|
+
'✔ io-package.json contains valid JSON',
|
|
73
|
+
'Check additional files',
|
|
74
|
+
'✔ README.md exists',
|
|
75
|
+
'✔ LICENSE exists or is present in the README.md',
|
|
76
|
+
'passing',
|
|
77
|
+
];
|
|
78
|
+
|
|
79
|
+
// Reference output lines for npm run test:integration (adapter-tests jobs).
|
|
80
|
+
// Each non-empty line must appear (as a substring) in the normalized job log.
|
|
81
|
+
// Timestamps are stripped; whitespace is normalised before comparison.
|
|
82
|
+
// Update this list when the @iobroker/testing package changes its test output.
|
|
83
|
+
const EXPECTED_TEST_INTEGRATION_LINES = [
|
|
84
|
+
'testing:integration:AdapterSetup => done!',
|
|
85
|
+
'testing:integration:DBConnection starting DB instances...',
|
|
86
|
+
'testing:integration:DBConnection creating objects DB',
|
|
87
|
+
'testing:integration:DBConnection => objects DB type: jsonl',
|
|
88
|
+
'testing:integration:DBConnection => done!',
|
|
89
|
+
'testing:integration:DBConnection creating states DB',
|
|
90
|
+
'testing:integration:DBConnection => states DB type: jsonl',
|
|
91
|
+
'testing:integration:DBConnection DB instances started',
|
|
92
|
+
'testing:integration:ControllerSetup Moving databases to different ports...',
|
|
93
|
+
'testing:integration:ControllerSetup => done!',
|
|
94
|
+
'testing:integration:ControllerSetup Disabling admin instances...',
|
|
95
|
+
'testing:integration:AdapterSetup Removing old adapter instances...',
|
|
96
|
+
'testing:integration:AdapterSetup Adding adapter instance...',
|
|
97
|
+
'testing:integration:DBConnection Stopping DB instances...',
|
|
98
|
+
'testing:integration:DBConnection DB instances stopped',
|
|
99
|
+
'testing:integration:DBConnection Creating DB backup...',
|
|
100
|
+
'testing:integration:DBConnection No DB instance is running, nothing to stop...',
|
|
101
|
+
'Adapter startup',
|
|
102
|
+
'✔ The adapter starts',
|
|
103
|
+
'testing:integration:TestHarness Stopping adapter instance...',
|
|
104
|
+
'testing:integration:TestHarness => giving it 5000ms to terminate',
|
|
105
|
+
'testing:integration:TestHarness Adapter terminated',
|
|
106
|
+
'testing:integration:DBConnection Stopping DB instances...',
|
|
107
|
+
'testing:integration:DBConnection DB instances stopped',
|
|
108
|
+
'passing',
|
|
109
|
+
];
|
|
110
|
+
|
|
20
111
|
function normalizeVersion(version) {
|
|
21
112
|
return typeof version === 'string' ? version.trim().replace(/^v/, '') : '';
|
|
22
113
|
}
|
|
@@ -69,7 +160,7 @@ function findTagTriggeredRun(workflowRuns, version, taggedVersion) {
|
|
|
69
160
|
);
|
|
70
161
|
}
|
|
71
162
|
|
|
72
|
-
function checkTagTriggeredRun(context, workflowRuns, version, taggedVersion, codeBase, sourceLabel) {
|
|
163
|
+
async function checkTagTriggeredRun(context, workflowRuns, version, taggedVersion, codeBase, sourceLabel) {
|
|
73
164
|
const tagRun = findTagTriggeredRun(workflowRuns, version, taggedVersion);
|
|
74
165
|
if (!tagRun) {
|
|
75
166
|
context.warnings.push(
|
|
@@ -81,19 +172,103 @@ function checkTagTriggeredRun(context, workflowRuns, version, taggedVersion, cod
|
|
|
81
172
|
|
|
82
173
|
if (tagRun.conclusion === 'cancelled') {
|
|
83
174
|
context.warnings.push(
|
|
84
|
-
`[W${codeBase}]
|
|
175
|
+
`[W${codeBase}] "${WORKFLOW_FILE_SHORT}" run triggered by tag "${taggedVersion}" for ${sourceLabel} was cancelled ${formatRunLink(tagRun)}.`,
|
|
85
176
|
);
|
|
86
177
|
} else if (tagRun.conclusion === 'failure') {
|
|
87
178
|
context.errors.push(
|
|
88
|
-
`[W${codeBase}]
|
|
179
|
+
`[W${codeBase}] "${WORKFLOW_FILE_SHORT}" run triggered by tag "${taggedVersion}" for ${sourceLabel} failed ${formatRunLink(tagRun)}.`,
|
|
89
180
|
);
|
|
90
181
|
} else {
|
|
91
182
|
context.checks.push(
|
|
92
|
-
`
|
|
183
|
+
`"${WORKFLOW_FILE_SHORT}" run triggered by tag "${taggedVersion}" for ${sourceLabel} finished with conclusion "${tagRun.conclusion}" ${formatRunLink(tagRun)}.`,
|
|
93
184
|
);
|
|
94
185
|
common.info(
|
|
95
|
-
`
|
|
186
|
+
`"${WORKFLOW_FILE_SHORT}" run triggered by tag "${taggedVersion}" for ${sourceLabel} finished with conclusion "${tagRun.conclusion}" ${formatRunLink(tagRun)}.`,
|
|
96
187
|
);
|
|
188
|
+
|
|
189
|
+
// Check log content for check-and-lint and adapter-tests jobs
|
|
190
|
+
try {
|
|
191
|
+
const runJobs = await fetchRunJobs(context, tagRun.id);
|
|
192
|
+
|
|
193
|
+
// W3050 / S3051: check-and-lint job log
|
|
194
|
+
const checkAndLintJob = runJobs.find(job => job.name === 'check-and-lint');
|
|
195
|
+
if (!checkAndLintJob) {
|
|
196
|
+
context.warnings.push(
|
|
197
|
+
`[W3050] "${WORKFLOW_FILE_SHORT}": no "check-and-lint" job found in ${formatRunLink(tagRun)}. ` +
|
|
198
|
+
`Cannot verify "npm run test:package" output.`,
|
|
199
|
+
);
|
|
200
|
+
} else {
|
|
201
|
+
const checkAndLintLog = await fetchJobLog(context, checkAndLintJob.id);
|
|
202
|
+
if (!checkAndLintLog) {
|
|
203
|
+
context.warnings.push(
|
|
204
|
+
`[W3050] "${WORKFLOW_FILE_SHORT}": could not retrieve log for "check-and-lint" job in ${formatRunLink(tagRun)}.`,
|
|
205
|
+
);
|
|
206
|
+
} else {
|
|
207
|
+
const missingCheckLines = findMissingExpectedLines(EXPECTED_TEST_PACKAGE_LINES, checkAndLintLog);
|
|
208
|
+
if (missingCheckLines.length > 0) {
|
|
209
|
+
context.warnings.push(
|
|
210
|
+
`[S3051] "${WORKFLOW_FILE_SHORT}": "testing-action-check" in ${formatRunLink(tagRun)} ` +
|
|
211
|
+
`does not log the expected defaults for "npm run test:package". ` +
|
|
212
|
+
`Please check the [log](${checkAndLintJob.html_url})`,
|
|
213
|
+
);
|
|
214
|
+
if (common.isDebug()) {
|
|
215
|
+
common.debug(
|
|
216
|
+
`[S3051] Missing lines in check-and-lint log (${missingCheckLines.length}):\n${missingCheckLines.map(l => ` - ${l}`).join('\n')}`,
|
|
217
|
+
);
|
|
218
|
+
}
|
|
219
|
+
} else {
|
|
220
|
+
context.checks.push(
|
|
221
|
+
`Job "check-and-lint" log contains expected "npm run test:package" output in ${formatRunLink(tagRun)}.`,
|
|
222
|
+
);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// W3052 / S3053: adapter-tests job logs
|
|
228
|
+
if (!context.cfg.onlyWWW) {
|
|
229
|
+
const adapterTestJobs = runJobs.filter(
|
|
230
|
+
job => job.name === 'adapter-tests' || job.name.startsWith('adapter-tests ('),
|
|
231
|
+
);
|
|
232
|
+
if (adapterTestJobs.length === 0) {
|
|
233
|
+
context.warnings.push(
|
|
234
|
+
`[W3052] "${WORKFLOW_FILE_SHORT}": no "adapter-tests" job found in ${formatRunLink(tagRun)}. ` +
|
|
235
|
+
`Cannot verify "npm run test:integration" output.`,
|
|
236
|
+
);
|
|
237
|
+
} else {
|
|
238
|
+
for (const adapterJob of adapterTestJobs) {
|
|
239
|
+
const adapterLog = await fetchJobLog(context, adapterJob.id);
|
|
240
|
+
if (!adapterLog) {
|
|
241
|
+
context.warnings.push(
|
|
242
|
+
`[W3052] "${WORKFLOW_FILE_SHORT}": could not retrieve log for job "${adapterJob.name}" in ${formatRunLink(tagRun)}.`,
|
|
243
|
+
);
|
|
244
|
+
} else {
|
|
245
|
+
const missingAdapterLines = findMissingExpectedLines(
|
|
246
|
+
EXPECTED_TEST_INTEGRATION_LINES,
|
|
247
|
+
adapterLog,
|
|
248
|
+
);
|
|
249
|
+
if (missingAdapterLines.length > 0) {
|
|
250
|
+
context.warnings.push(
|
|
251
|
+
`[S3053] "${WORKFLOW_FILE_SHORT}": "testing-action-adapter" job "${adapterJob.name}" in ${formatRunLink(tagRun)} ` +
|
|
252
|
+
`does not log the expected defaults for "npm run test:integration". ` +
|
|
253
|
+
`Please check the [log](${adapterJob.html_url}).`,
|
|
254
|
+
);
|
|
255
|
+
if (common.isDebug()) {
|
|
256
|
+
common.debug(
|
|
257
|
+
`[S3053] Missing lines in adapter-tests job "${adapterJob.name}" log (${missingAdapterLines.length}):\n${missingAdapterLines.map(l => ` - ${l}`).join('\n')}`,
|
|
258
|
+
);
|
|
259
|
+
}
|
|
260
|
+
} else {
|
|
261
|
+
context.checks.push(
|
|
262
|
+
`Job "${adapterJob.name}" log contains expected "npm run test:integration" output in ${formatRunLink(tagRun)}.`,
|
|
263
|
+
);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
} catch (e) {
|
|
270
|
+
common.debug(`Could not check job logs for run ${tagRun.id}: ${e.message}`);
|
|
271
|
+
}
|
|
97
272
|
}
|
|
98
273
|
}
|
|
99
274
|
|
|
@@ -462,6 +637,117 @@ function getAllowedRequiredOsSystems(osClause, requiredSystems, packageOsAliasMa
|
|
|
462
637
|
return allowed;
|
|
463
638
|
}
|
|
464
639
|
|
|
640
|
+
/**
|
|
641
|
+
* Normalises a single line from a GitHub Actions job log:
|
|
642
|
+
* - strips the leading ISO timestamp (e.g. "2024-01-01T00:00:00.0000000Z ")
|
|
643
|
+
* - strips ANSI escape codes
|
|
644
|
+
* - trims and collapses internal whitespace to a single space
|
|
645
|
+
*
|
|
646
|
+
* @param {string} line - raw log line
|
|
647
|
+
* @returns {string} normalised line
|
|
648
|
+
*/
|
|
649
|
+
function normalizeLogLine(line) {
|
|
650
|
+
return line
|
|
651
|
+
.replace(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d+Z\s/, '')
|
|
652
|
+
.replace(/\x1b\[[0-9;]*[a-zA-Z]/g, '') // eslint-disable-line no-control-regex
|
|
653
|
+
.trim()
|
|
654
|
+
.replace(/\s+/g, ' ');
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
/**
|
|
658
|
+
* Splits a raw job log text into normalised, non-empty lines, filtering out
|
|
659
|
+
* GitHub Actions control sequences (lines starting with "##[").
|
|
660
|
+
*
|
|
661
|
+
* @param {string} logText - raw log text
|
|
662
|
+
* @returns {string[]} normalised lines
|
|
663
|
+
*/
|
|
664
|
+
function extractNormalizedLogLines(logText) {
|
|
665
|
+
if (!logText || typeof logText !== 'string') {
|
|
666
|
+
return [];
|
|
667
|
+
}
|
|
668
|
+
return logText
|
|
669
|
+
.split('\n')
|
|
670
|
+
.map(normalizeLogLine)
|
|
671
|
+
.filter(line => line.length > 0 && !line.startsWith('##['));
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
/**
|
|
675
|
+
* Returns the subset of expectedLines that cannot be found in logText.
|
|
676
|
+
* Duplicate expected lines are checked only once.
|
|
677
|
+
* Comparison uses substring matching after whitespace normalisation.
|
|
678
|
+
*
|
|
679
|
+
* @param {string[]} expectedLines - reference lines to look for
|
|
680
|
+
* @param {string} logText - raw job log text
|
|
681
|
+
* @returns {string[]} missing lines (normalised)
|
|
682
|
+
*/
|
|
683
|
+
function findMissingExpectedLines(expectedLines, logText) {
|
|
684
|
+
const normalizedLog = extractNormalizedLogLines(logText);
|
|
685
|
+
const missing = [];
|
|
686
|
+
const checked = new Set();
|
|
687
|
+
|
|
688
|
+
for (const expected of expectedLines) {
|
|
689
|
+
const normalizedExpected = expected.trim().replace(/\s+/g, ' ');
|
|
690
|
+
if (!normalizedExpected || checked.has(normalizedExpected)) {
|
|
691
|
+
continue;
|
|
692
|
+
}
|
|
693
|
+
checked.add(normalizedExpected);
|
|
694
|
+
|
|
695
|
+
const found = normalizedLog.some(logLine => logLine.includes(normalizedExpected));
|
|
696
|
+
if (!found) {
|
|
697
|
+
missing.push(normalizedExpected);
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
return missing;
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
/**
|
|
704
|
+
* Fetches the list of jobs for a workflow run (handles pagination).
|
|
705
|
+
*
|
|
706
|
+
* @param {object} context - checker context
|
|
707
|
+
* @param {number} runId - workflow run ID
|
|
708
|
+
* @returns {Promise<object[]>} array of job objects
|
|
709
|
+
*/
|
|
710
|
+
async function fetchRunJobs(context, runId) {
|
|
711
|
+
const jobs = [];
|
|
712
|
+
let page = 1;
|
|
713
|
+
try {
|
|
714
|
+
while (true) {
|
|
715
|
+
const url = `${context.githubUrlApi}/actions/runs/${runId}/jobs?per_page=100&page=${page}`;
|
|
716
|
+
common.debug(`Retrieving jobs for run ${runId} (page ${page})`);
|
|
717
|
+
const response = await axios.get(url);
|
|
718
|
+
const jobsPage = response.data?.jobs ?? [];
|
|
719
|
+
jobs.push(...jobsPage);
|
|
720
|
+
if (jobsPage.length < 100) {
|
|
721
|
+
break;
|
|
722
|
+
}
|
|
723
|
+
page++;
|
|
724
|
+
}
|
|
725
|
+
} catch (e) {
|
|
726
|
+
common.debug(`Could not fetch jobs for run ${runId}: ${e.message}`);
|
|
727
|
+
}
|
|
728
|
+
return jobs;
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
/**
|
|
732
|
+
* Downloads the plain-text log for a single GitHub Actions job.
|
|
733
|
+
* The API redirects to a download URL; axios follows the redirect automatically.
|
|
734
|
+
*
|
|
735
|
+
* @param {object} context - checker context
|
|
736
|
+
* @param {number} jobId - job ID
|
|
737
|
+
* @returns {Promise<string|null>} log text or null on failure
|
|
738
|
+
*/
|
|
739
|
+
async function fetchJobLog(context, jobId) {
|
|
740
|
+
const url = `${context.githubUrlApi}/actions/jobs/${jobId}/logs`;
|
|
741
|
+
try {
|
|
742
|
+
common.debug(`Fetching log for job ${jobId}`);
|
|
743
|
+
const response = await axios.get(url, { maxRedirects: 10, responseType: 'text' });
|
|
744
|
+
return typeof response.data === 'string' ? response.data : null;
|
|
745
|
+
} catch (e) {
|
|
746
|
+
common.debug(`Could not fetch log for job ${jobId}: ${e.message}`);
|
|
747
|
+
return null;
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
|
|
465
751
|
async function checkTests(context) {
|
|
466
752
|
console.log('\n[E3000 - E3999] checking tests');
|
|
467
753
|
|
|
@@ -543,7 +829,7 @@ async function checkTests(context) {
|
|
|
543
829
|
// --- W3005: check for pull_request in 'on' ---
|
|
544
830
|
if (!onAttr || !Object.prototype.hasOwnProperty.call(onAttr, 'pull_request')) {
|
|
545
831
|
context.warnings.push(
|
|
546
|
-
`[W3005]
|
|
832
|
+
`[W3005] "${WORKFLOW_FILE_SHORT}" should have "pull_request: {}" in the "on" trigger configuration.`,
|
|
547
833
|
);
|
|
548
834
|
} else {
|
|
549
835
|
context.checks.push('Workflow trigger includes "pull_request".');
|
|
@@ -552,7 +838,7 @@ async function checkTests(context) {
|
|
|
552
838
|
// --- E3006 / E3007 / E3008: check for push in 'on' ---
|
|
553
839
|
if (!onAttr || !Object.prototype.hasOwnProperty.call(onAttr, 'push')) {
|
|
554
840
|
context.errors.push(
|
|
555
|
-
`[E3006]
|
|
841
|
+
`[E3006] "${WORKFLOW_FILE_SHORT}" is missing the "push" trigger in the "on" configuration.`,
|
|
556
842
|
);
|
|
557
843
|
} else {
|
|
558
844
|
context.checks.push('Workflow trigger includes "push".');
|
|
@@ -563,7 +849,7 @@ async function checkTests(context) {
|
|
|
563
849
|
const branches = pushConfig.branches;
|
|
564
850
|
if (!branches || !Array.isArray(branches) || branches.length === 0) {
|
|
565
851
|
context.errors.push(
|
|
566
|
-
`[E3007]
|
|
852
|
+
`[E3007] "${WORKFLOW_FILE_SHORT}": "push" trigger is missing "branches" configuration. ` +
|
|
567
853
|
`Must include "*" or the default branch ("${context.branch}").`,
|
|
568
854
|
);
|
|
569
855
|
} else {
|
|
@@ -572,7 +858,7 @@ async function checkTests(context) {
|
|
|
572
858
|
const hasDefaultBranch = branches.includes(defaultBranch);
|
|
573
859
|
if (!hasWildcard && !hasDefaultBranch) {
|
|
574
860
|
context.errors.push(
|
|
575
|
-
`[E3037]
|
|
861
|
+
`[E3037] "${WORKFLOW_FILE_SHORT}": "push" trigger "branches" must include "*" or the default branch "${defaultBranch}". ` +
|
|
576
862
|
`Found: ${JSON.stringify(branches)}`,
|
|
577
863
|
);
|
|
578
864
|
} else {
|
|
@@ -585,7 +871,7 @@ async function checkTests(context) {
|
|
|
585
871
|
const requiredTagPatterns = ['v[0-9]+.[0-9]+.[0-9]+', 'v[0-9]+.[0-9]+.[0-9]+-**'];
|
|
586
872
|
if (!tags || !Array.isArray(tags)) {
|
|
587
873
|
context.errors.push(
|
|
588
|
-
`[E3008]
|
|
874
|
+
`[E3008] "${WORKFLOW_FILE_SHORT}": "push" trigger is missing "tags" configuration. ` +
|
|
589
875
|
`Required tag patterns: ${requiredTagPatterns.join(', ')}`,
|
|
590
876
|
);
|
|
591
877
|
} else {
|
|
@@ -593,7 +879,7 @@ async function checkTests(context) {
|
|
|
593
879
|
const missingPatterns = requiredTagPatterns.filter(pat => !cleanedTags.includes(pat));
|
|
594
880
|
if (missingPatterns.length > 0) {
|
|
595
881
|
context.errors.push(
|
|
596
|
-
`[E3040]
|
|
882
|
+
`[E3040] "${WORKFLOW_FILE_SHORT}": "push" trigger "tags" is missing required pattern(s): ${missingPatterns.join(', ')}`,
|
|
597
883
|
);
|
|
598
884
|
} else {
|
|
599
885
|
context.checks.push('Workflow "push" trigger tags are correctly configured.');
|
|
@@ -605,7 +891,7 @@ async function checkTests(context) {
|
|
|
605
891
|
const concurrency = workflow.concurrency;
|
|
606
892
|
if (!concurrency || concurrency.group !== '${{ github.ref }}' || concurrency['cancel-in-progress'] !== true) {
|
|
607
893
|
context.warnings.push(
|
|
608
|
-
`[W3009]
|
|
894
|
+
`[W3009] "${WORKFLOW_FILE_SHORT}" is missing recommended concurrency configuration. See ` +
|
|
609
895
|
`"https://github.com/ioBroker/ioBroker.example/blob/e7db900495bb3c2b89dc35d863dda4ccf33f5def/JavaScript/.github/workflows/test-and-release.yml#L17" for details.`,
|
|
610
896
|
);
|
|
611
897
|
} else {
|
|
@@ -670,6 +956,93 @@ async function checkTests(context) {
|
|
|
670
956
|
`Latest workflow run of "${WORKFLOW_FILE_SHORT}" on branch "${defaultBranch}" finished with conclusion "${lastRun.conclusion}" ${formatRunLink(lastRun)}.`,
|
|
671
957
|
);
|
|
672
958
|
}
|
|
959
|
+
|
|
960
|
+
// Check log content for check-and-lint and adapter-tests jobs
|
|
961
|
+
try {
|
|
962
|
+
const runJobs = await fetchRunJobs(context, lastRun.id);
|
|
963
|
+
|
|
964
|
+
// W3050 / S3051: check-and-lint job log
|
|
965
|
+
const checkAndLintJob = runJobs.find(job => job.name === 'check-and-lint');
|
|
966
|
+
if (!checkAndLintJob) {
|
|
967
|
+
context.warnings.push(
|
|
968
|
+
`[W3050] "${WORKFLOW_FILE_SHORT}": no "check-and-lint" job found in ${formatRunLink(lastRun)}. ` +
|
|
969
|
+
`Cannot verify "npm run test:package" output.`,
|
|
970
|
+
);
|
|
971
|
+
} else {
|
|
972
|
+
const checkAndLintLog = await fetchJobLog(context, checkAndLintJob.id);
|
|
973
|
+
if (!checkAndLintLog) {
|
|
974
|
+
context.warnings.push(
|
|
975
|
+
`[W3050] "${WORKFLOW_FILE_SHORT}": could not retrieve log for "check-and-lint" job in ${formatRunLink(lastRun)}.`,
|
|
976
|
+
);
|
|
977
|
+
} else {
|
|
978
|
+
const missingCheckLines = findMissingExpectedLines(
|
|
979
|
+
EXPECTED_TEST_PACKAGE_LINES,
|
|
980
|
+
checkAndLintLog,
|
|
981
|
+
);
|
|
982
|
+
if (missingCheckLines.length > 0) {
|
|
983
|
+
context.warnings.push(
|
|
984
|
+
`[S3051] "${WORKFLOW_FILE_SHORT}": "testing-action-check" in ${formatRunLink(lastRun)} ` +
|
|
985
|
+
`does not log the expected defaults for "npm run test:package". ` +
|
|
986
|
+
`Please check the [log](${checkAndLintJob.html_url}),`,
|
|
987
|
+
);
|
|
988
|
+
if (common.isDebug()) {
|
|
989
|
+
common.debug(
|
|
990
|
+
`[S3051] Missing lines in check-and-lint log (${missingCheckLines.length}):\n${missingCheckLines.map(l => ` - ${l}`).join('\n')}`,
|
|
991
|
+
);
|
|
992
|
+
}
|
|
993
|
+
} else {
|
|
994
|
+
context.checks.push(
|
|
995
|
+
`Job "check-and-lint" log contains expected "npm run test:package" output in ${formatRunLink(lastRun)}.`,
|
|
996
|
+
);
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
// W3052 / S3053: adapter-tests job logs
|
|
1002
|
+
if (!context.cfg.onlyWWW) {
|
|
1003
|
+
const adapterTestJobs = runJobs.filter(
|
|
1004
|
+
job => job.name === 'adapter-tests' || job.name.startsWith('adapter-tests ('),
|
|
1005
|
+
);
|
|
1006
|
+
if (adapterTestJobs.length === 0) {
|
|
1007
|
+
context.warnings.push(
|
|
1008
|
+
`[W3052] "${WORKFLOW_FILE_SHORT}": no "adapter-tests" job found in ${formatRunLink(lastRun)}. ` +
|
|
1009
|
+
`Cannot verify "npm run test:integration" output.`,
|
|
1010
|
+
);
|
|
1011
|
+
} else {
|
|
1012
|
+
for (const adapterJob of adapterTestJobs) {
|
|
1013
|
+
const adapterLog = await fetchJobLog(context, adapterJob.id);
|
|
1014
|
+
if (!adapterLog) {
|
|
1015
|
+
context.warnings.push(
|
|
1016
|
+
`[W3052] "${WORKFLOW_FILE_SHORT}": could not retrieve log for job "${adapterJob.name}" in ${formatRunLink(lastRun)}.`,
|
|
1017
|
+
);
|
|
1018
|
+
} else {
|
|
1019
|
+
const missingAdapterLines = findMissingExpectedLines(
|
|
1020
|
+
EXPECTED_TEST_INTEGRATION_LINES,
|
|
1021
|
+
adapterLog,
|
|
1022
|
+
);
|
|
1023
|
+
if (missingAdapterLines.length > 0) {
|
|
1024
|
+
context.warnings.push(
|
|
1025
|
+
`[S3053] "${WORKFLOW_FILE_SHORT}": "testing-action-adapter" job "${adapterJob.name}" in ${formatRunLink(lastRun)} ` +
|
|
1026
|
+
`does not log the expected defaults for "npm run test:integration". ` +
|
|
1027
|
+
`Please check the [log](${adapterJob.html_url}).`,
|
|
1028
|
+
);
|
|
1029
|
+
if (common.isDebug()) {
|
|
1030
|
+
common.debug(
|
|
1031
|
+
`[S3053] Missing lines in adapter-tests job "${adapterJob.name}" log (${missingAdapterLines.length}):\n${missingAdapterLines.map(l => ` - ${l}`).join('\n')}`,
|
|
1032
|
+
);
|
|
1033
|
+
}
|
|
1034
|
+
} else {
|
|
1035
|
+
context.checks.push(
|
|
1036
|
+
`Job "${adapterJob.name}" log contains expected "npm run test:integration" output in ${formatRunLink(lastRun)}.`,
|
|
1037
|
+
);
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
1041
|
+
}
|
|
1042
|
+
}
|
|
1043
|
+
} catch (e) {
|
|
1044
|
+
common.debug(`Could not check job logs for run ${lastRun.id}: ${e.message}`);
|
|
1045
|
+
}
|
|
673
1046
|
}
|
|
674
1047
|
|
|
675
1048
|
const tagsResponse = await axios(`${context.githubUrlApi}/tags?per_page=100`);
|
|
@@ -687,7 +1060,7 @@ async function checkTests(context) {
|
|
|
687
1060
|
`[W3032] Release ${currentRelease} from io-package.json/package.json has not yet been tagged. Tagging releases is required.`,
|
|
688
1061
|
);
|
|
689
1062
|
} else {
|
|
690
|
-
checkTagTriggeredRun(
|
|
1063
|
+
await checkTagTriggeredRun(
|
|
691
1064
|
context,
|
|
692
1065
|
workflowRuns,
|
|
693
1066
|
currentRelease,
|
|
@@ -717,7 +1090,7 @@ async function checkTests(context) {
|
|
|
717
1090
|
`[E3034] Release ${npmLatestRelease} tagged as "latest" at npm has not yet been tagged at GitHub. Tagging of releases is required.`,
|
|
718
1091
|
);
|
|
719
1092
|
} else {
|
|
720
|
-
checkTagTriggeredRun(
|
|
1093
|
+
await checkTagTriggeredRun(
|
|
721
1094
|
context,
|
|
722
1095
|
workflowRuns,
|
|
723
1096
|
npmLatestRelease,
|
|
@@ -736,7 +1109,7 @@ async function checkTests(context) {
|
|
|
736
1109
|
`[E3036] Newest npm release ${newestNpmRelease} has not yet been tagged at GitHub. Tagging of releases is required.`,
|
|
737
1110
|
);
|
|
738
1111
|
} else {
|
|
739
|
-
checkTagTriggeredRun(
|
|
1112
|
+
await checkTagTriggeredRun(
|
|
740
1113
|
context,
|
|
741
1114
|
workflowRuns,
|
|
742
1115
|
newestNpmRelease,
|
|
@@ -783,7 +1156,7 @@ async function checkTests(context) {
|
|
|
783
1156
|
|
|
784
1157
|
const stepLabel = typeof step?.name === 'string' && step.name.trim() ? step.name.trim() : `#${i + 1}`;
|
|
785
1158
|
const message =
|
|
786
|
-
`
|
|
1159
|
+
`"${WORKFLOW_FILE_SHORT}": job "${jobName}" step "${stepLabel}" uses "continue-on-error: true". ` +
|
|
787
1160
|
'Workflow test-and-release should abort if any error occurs; remove "continue-on-error".';
|
|
788
1161
|
if (protectedActionPrefixes.some(prefix => stepUsesActionPrefix(step, prefix))) {
|
|
789
1162
|
context.errors.push(`[E3047] ${message}`);
|
|
@@ -826,11 +1199,11 @@ async function checkTests(context) {
|
|
|
826
1199
|
common.debug(' job check-and-lint not found');
|
|
827
1200
|
if (!context.cfg.onlyWWW) {
|
|
828
1201
|
context.errors.push(
|
|
829
|
-
`[E3010]
|
|
1202
|
+
`[E3010] "${WORKFLOW_FILE_SHORT}": job "check-and-lint" is missing. Please add it.`,
|
|
830
1203
|
);
|
|
831
1204
|
} else {
|
|
832
1205
|
context.warnings.push(
|
|
833
|
-
`[S3010]
|
|
1206
|
+
`[S3010] "${WORKFLOW_FILE_SHORT}": job "check-and-lint" is missing. Consider adding it.`,
|
|
834
1207
|
);
|
|
835
1208
|
}
|
|
836
1209
|
} else {
|
|
@@ -842,7 +1215,7 @@ async function checkTests(context) {
|
|
|
842
1215
|
const requiredCheckActionVersion = testingCfg['ioBroker/testing-action-check'];
|
|
843
1216
|
if (!jobHasStepWithAction(jobs['check-and-lint'], checkActionPrefix)) {
|
|
844
1217
|
context.warnings.push(
|
|
845
|
-
`[W3013]
|
|
1218
|
+
`[W3013] "${WORKFLOW_FILE_SHORT}": job "check-and-lint" should contain a step using "ioBroker/testing-action-check@${requiredCheckActionVersion}".`,
|
|
846
1219
|
);
|
|
847
1220
|
} else {
|
|
848
1221
|
context.checks.push(
|
|
@@ -856,7 +1229,7 @@ async function checkTests(context) {
|
|
|
856
1229
|
});
|
|
857
1230
|
for (const lowerRef of lowerRefs) {
|
|
858
1231
|
context.warnings.push(
|
|
859
|
-
`[W3028]
|
|
1232
|
+
`[W3028] "${WORKFLOW_FILE_SHORT}": job "check-and-lint" uses "ioBroker/testing-action-check@${lowerRef}" ` +
|
|
860
1233
|
`which is below the required version "${requiredCheckActionVersion}".`,
|
|
861
1234
|
);
|
|
862
1235
|
}
|
|
@@ -865,20 +1238,38 @@ async function checkTests(context) {
|
|
|
865
1238
|
for (const ref of usedRefs.filter(isOverlySpecificVersionRef)) {
|
|
866
1239
|
const majorVersion = `v${parseActionMajorVersion(ref)}`;
|
|
867
1240
|
context.warnings.push(
|
|
868
|
-
`[S3042]
|
|
1241
|
+
`[S3042] "${WORKFLOW_FILE_SHORT}": job "check-and-lint" uses "ioBroker/testing-action-check@${ref}" ` +
|
|
869
1242
|
`with a pinned version. Consider locking only the major version "@${majorVersion}" instead.`,
|
|
870
1243
|
);
|
|
871
1244
|
}
|
|
872
1245
|
|
|
873
1246
|
if (!jobHasStepWithActionInputValue(jobs['check-and-lint'], checkActionPrefix, 'lint', true)) {
|
|
874
1247
|
context.warnings.push(
|
|
875
|
-
`[S3045]
|
|
1248
|
+
`[S3045] "${WORKFLOW_FILE_SHORT}": job "check-and-lint" should enable linting by setting "lint: true" for "ioBroker/testing-action-check@${requiredCheckActionVersion}".`,
|
|
876
1249
|
);
|
|
877
1250
|
} else {
|
|
878
1251
|
context.checks.push(
|
|
879
1252
|
`Job "check-and-lint" enables "lint: true" for "ioBroker/testing-action-check@${requiredCheckActionVersion}".`,
|
|
880
1253
|
);
|
|
881
1254
|
}
|
|
1255
|
+
|
|
1256
|
+
// W3048: check-and-lint should not override default commands in testing-action-check
|
|
1257
|
+
const forbiddenCheckParams = ['type-checking-command', 'lint-command', 'test-command'];
|
|
1258
|
+
for (const param of forbiddenCheckParams) {
|
|
1259
|
+
const stepWithParam = jobs['check-and-lint'].steps.find(
|
|
1260
|
+
step =>
|
|
1261
|
+
typeof step.uses === 'string' &&
|
|
1262
|
+
step.uses.startsWith(checkActionPrefix) &&
|
|
1263
|
+
step.with &&
|
|
1264
|
+
Object.prototype.hasOwnProperty.call(step.with, param),
|
|
1265
|
+
);
|
|
1266
|
+
if (stepWithParam) {
|
|
1267
|
+
context.warnings.push(
|
|
1268
|
+
`[W3048] "${WORKFLOW_FILE_SHORT}": job "check-and-lint" step using "ioBroker/testing-action-check" ` +
|
|
1269
|
+
`specifies "${param}". This command should not be changed; the default value should be used.`,
|
|
1270
|
+
);
|
|
1271
|
+
}
|
|
1272
|
+
}
|
|
882
1273
|
}
|
|
883
1274
|
|
|
884
1275
|
// E3020 / S3021: check node.js version for check-and-lint job
|
|
@@ -886,13 +1277,13 @@ async function checkTests(context) {
|
|
|
886
1277
|
if (checkLintNodeVersion !== null) {
|
|
887
1278
|
if (checkLintNodeVersion < effectiveMinCheckAndLint) {
|
|
888
1279
|
context.errors.push(
|
|
889
|
-
`[E3020]
|
|
1280
|
+
`[E3020] "${WORKFLOW_FILE_SHORT}": job "check-and-lint" uses node.js ${checkLintNodeVersion} ` +
|
|
890
1281
|
`which is below the minimum required version ${effectiveMinCheckAndLint}. ` +
|
|
891
1282
|
`Please update to node.js ${effectiveRecCheckAndLint}.`,
|
|
892
1283
|
);
|
|
893
1284
|
} else if (checkLintNodeVersion < effectiveRecCheckAndLint) {
|
|
894
1285
|
context.warnings.push(
|
|
895
|
-
`[S3021]
|
|
1286
|
+
`[S3021] "${WORKFLOW_FILE_SHORT}": job "check-and-lint" uses node.js ${checkLintNodeVersion}. ` +
|
|
896
1287
|
`Consider updating to the recommended version ${effectiveRecCheckAndLint}.`,
|
|
897
1288
|
);
|
|
898
1289
|
} else {
|
|
@@ -910,7 +1301,7 @@ async function checkTests(context) {
|
|
|
910
1301
|
} else if (!jobs['adapter-tests']) {
|
|
911
1302
|
common.debug(' job adapter-tests not found');
|
|
912
1303
|
context.errors.push(
|
|
913
|
-
`[E3011]
|
|
1304
|
+
`[E3011] "${WORKFLOW_FILE_SHORT}": job "adapter-tests" is missing. Please add it.`,
|
|
914
1305
|
);
|
|
915
1306
|
} else {
|
|
916
1307
|
common.debug(' job adapter-tests found');
|
|
@@ -919,7 +1310,7 @@ async function checkTests(context) {
|
|
|
919
1310
|
// S3014: adapter-tests should need check-and-lint
|
|
920
1311
|
if (!jobNeedsAll(jobs['adapter-tests'], ['check-and-lint'])) {
|
|
921
1312
|
context.warnings.push(
|
|
922
|
-
`[S3014]
|
|
1313
|
+
`[S3014] "${WORKFLOW_FILE_SHORT}": job "adapter-tests" should declare "needs: check-and-lint" to run after linting.`,
|
|
923
1314
|
);
|
|
924
1315
|
} else {
|
|
925
1316
|
context.checks.push('Job "adapter-tests" correctly requires "check-and-lint".');
|
|
@@ -930,7 +1321,7 @@ async function checkTests(context) {
|
|
|
930
1321
|
const requiredAdapterActionVersion = testingCfg['ioBroker/testing-action-adapter'];
|
|
931
1322
|
if (!jobHasStepWithAction(jobs['adapter-tests'], adapterActionPrefix)) {
|
|
932
1323
|
context.warnings.push(
|
|
933
|
-
`[W3015]
|
|
1324
|
+
`[W3015] "${WORKFLOW_FILE_SHORT}": job "adapter-tests" should contain a step using "ioBroker/testing-action-adapter@${requiredAdapterActionVersion}".`,
|
|
934
1325
|
);
|
|
935
1326
|
} else {
|
|
936
1327
|
context.checks.push(
|
|
@@ -944,7 +1335,7 @@ async function checkTests(context) {
|
|
|
944
1335
|
});
|
|
945
1336
|
for (const lowerRef of lowerRefs) {
|
|
946
1337
|
context.warnings.push(
|
|
947
|
-
`[W3029]
|
|
1338
|
+
`[W3029] "${WORKFLOW_FILE_SHORT}": job "adapter-tests" uses "ioBroker/testing-action-adapter@${lowerRef}" ` +
|
|
948
1339
|
`which is below the required version "${requiredAdapterActionVersion}".`,
|
|
949
1340
|
);
|
|
950
1341
|
}
|
|
@@ -953,10 +1344,25 @@ async function checkTests(context) {
|
|
|
953
1344
|
for (const ref of usedRefs.filter(isOverlySpecificVersionRef)) {
|
|
954
1345
|
const majorVersion = `v${parseActionMajorVersion(ref)}`;
|
|
955
1346
|
context.warnings.push(
|
|
956
|
-
`[S3043]
|
|
1347
|
+
`[S3043] "${WORKFLOW_FILE_SHORT}": job "adapter-tests" uses "ioBroker/testing-action-adapter@${ref}" ` +
|
|
957
1348
|
`with a pinned version. Consider locking only the major version "@${majorVersion}" instead.`,
|
|
958
1349
|
);
|
|
959
1350
|
}
|
|
1351
|
+
|
|
1352
|
+
// W3049: adapter-tests should not override integration-test-command in testing-action-adapter
|
|
1353
|
+
const adapterStepWithParam = jobs['adapter-tests'].steps.find(
|
|
1354
|
+
step =>
|
|
1355
|
+
typeof step.uses === 'string' &&
|
|
1356
|
+
step.uses.startsWith(adapterActionPrefix) &&
|
|
1357
|
+
step.with &&
|
|
1358
|
+
Object.prototype.hasOwnProperty.call(step.with, 'integration-test-command'),
|
|
1359
|
+
);
|
|
1360
|
+
if (adapterStepWithParam) {
|
|
1361
|
+
context.warnings.push(
|
|
1362
|
+
`[W3049] "${WORKFLOW_FILE_SHORT}": job "adapter-tests" step using "ioBroker/testing-action-adapter" ` +
|
|
1363
|
+
`specifies "integration-test-command". This command should not be changed; the default value should be used.`,
|
|
1364
|
+
);
|
|
1365
|
+
}
|
|
960
1366
|
}
|
|
961
1367
|
|
|
962
1368
|
// W3024 / E3025 / W3026: check node.js version matrix for adapter-tests
|
|
@@ -977,7 +1383,7 @@ async function checkTests(context) {
|
|
|
977
1383
|
const invalidVersions = matrixNodeVersions.filter(v => !validVersionNums.includes(v));
|
|
978
1384
|
for (const v of invalidVersions) {
|
|
979
1385
|
context.warnings.push(
|
|
980
|
-
`[W3024]
|
|
1386
|
+
`[W3024] "${WORKFLOW_FILE_SHORT}": job "adapter-tests" matrix uses node.js ${v} ` +
|
|
981
1387
|
`which is not in the list of recommended testing versions (${testingCfg.validMatrixNodeVersions.join(', ')}).`,
|
|
982
1388
|
);
|
|
983
1389
|
}
|
|
@@ -986,7 +1392,7 @@ async function checkTests(context) {
|
|
|
986
1392
|
const missingRequired = requiredVersionNums.filter(v => !matrixNodeVersions.includes(v));
|
|
987
1393
|
for (const v of missingRequired) {
|
|
988
1394
|
context.errors.push(
|
|
989
|
-
`[E3025]
|
|
1395
|
+
`[E3025] "${WORKFLOW_FILE_SHORT}": job "adapter-tests" matrix is missing required node.js version ${v}. ` +
|
|
990
1396
|
`Tests with node.js ${v} are required.`,
|
|
991
1397
|
);
|
|
992
1398
|
}
|
|
@@ -997,7 +1403,7 @@ async function checkTests(context) {
|
|
|
997
1403
|
);
|
|
998
1404
|
for (const v of missingRecommended) {
|
|
999
1405
|
context.warnings.push(
|
|
1000
|
-
`[W3026]
|
|
1406
|
+
`[W3026] "${WORKFLOW_FILE_SHORT}": job "adapter-tests" matrix is missing recommended node.js version ${v}. ` +
|
|
1001
1407
|
`Consider adding tests with node.js ${v}.`,
|
|
1002
1408
|
);
|
|
1003
1409
|
}
|
|
@@ -1043,7 +1449,7 @@ async function checkTests(context) {
|
|
|
1043
1449
|
const uncoveredMissingSystems = missingSystems.filter(system => allowedSystems.has(system));
|
|
1044
1450
|
if (uncoveredMissingSystems.length > 0) {
|
|
1045
1451
|
context.warnings.push(
|
|
1046
|
-
`[W3027]
|
|
1452
|
+
`[W3027] "${WORKFLOW_FILE_SHORT}": testing for OS ${uncoveredMissingSystems.join(', ')} is missing in job "adapter-tests". ` +
|
|
1047
1453
|
`Add corresponding tests to "${WORKFLOW_FILE_SHORT}" or adapt package.json "os" accordingly.`,
|
|
1048
1454
|
);
|
|
1049
1455
|
} else {
|
|
@@ -1058,7 +1464,7 @@ async function checkTests(context) {
|
|
|
1058
1464
|
if (!jobs['deploy']) {
|
|
1059
1465
|
common.debug(' job deploy found');
|
|
1060
1466
|
context.warnings.push(
|
|
1061
|
-
`[S3012]
|
|
1467
|
+
`[S3012] "${WORKFLOW_FILE_SHORT}": job "deploy" is not defined. Consider adding it for automated releases.`,
|
|
1062
1468
|
);
|
|
1063
1469
|
} else {
|
|
1064
1470
|
common.debug(' job deploy found');
|
|
@@ -1069,7 +1475,7 @@ async function checkTests(context) {
|
|
|
1069
1475
|
const requiredDependencies = ['check-and-lint', 'adapter-tests'].filter(j => jobs[j]);
|
|
1070
1476
|
if (!requiredDependencies.every(req => jobDependsOn(jobs, 'deploy', req))) {
|
|
1071
1477
|
context.errors.push(
|
|
1072
|
-
`[E3016]
|
|
1478
|
+
`[E3016] "${WORKFLOW_FILE_SHORT}": job "deploy" must declare "needs" for both "check-and-lint" and "adapter-tests".`,
|
|
1073
1479
|
);
|
|
1074
1480
|
} else {
|
|
1075
1481
|
context.checks.push('Job "deploy" correctly requires "check-and-lint" and "adapter-tests".');
|
|
@@ -1080,7 +1486,7 @@ async function checkTests(context) {
|
|
|
1080
1486
|
const requiredDeployActionVersion = testingCfg['ioBroker/testing-action-deploy'];
|
|
1081
1487
|
if (!jobHasStepWithAction(jobs['deploy'], deployActionPrefix)) {
|
|
1082
1488
|
context.warnings.push(
|
|
1083
|
-
`[W3017]
|
|
1489
|
+
`[W3017] "${WORKFLOW_FILE_SHORT}": job "deploy" should contain a step using "ioBroker/testing-action-deploy@${requiredDeployActionVersion}".`,
|
|
1084
1490
|
);
|
|
1085
1491
|
} else {
|
|
1086
1492
|
context.checks.push(
|
|
@@ -1094,7 +1500,7 @@ async function checkTests(context) {
|
|
|
1094
1500
|
});
|
|
1095
1501
|
for (const lowerRef of lowerRefs) {
|
|
1096
1502
|
context.warnings.push(
|
|
1097
|
-
`[W3030]
|
|
1503
|
+
`[W3030] "${WORKFLOW_FILE_SHORT}": job "deploy" uses "ioBroker/testing-action-deploy@${lowerRef}" ` +
|
|
1098
1504
|
`which is below the required version "${requiredDeployActionVersion}".`,
|
|
1099
1505
|
);
|
|
1100
1506
|
}
|
|
@@ -1103,7 +1509,7 @@ async function checkTests(context) {
|
|
|
1103
1509
|
for (const ref of usedRefs.filter(isOverlySpecificVersionRef)) {
|
|
1104
1510
|
const majorVersion = `v${parseActionMajorVersion(ref)}`;
|
|
1105
1511
|
context.warnings.push(
|
|
1106
|
-
`[S3044]
|
|
1512
|
+
`[S3044] "${WORKFLOW_FILE_SHORT}": job "deploy" uses "ioBroker/testing-action-deploy@${ref}" ` +
|
|
1107
1513
|
`with a pinned version. Consider locking only the major version "@${majorVersion}" instead.`,
|
|
1108
1514
|
);
|
|
1109
1515
|
}
|
|
@@ -1114,7 +1520,7 @@ async function checkTests(context) {
|
|
|
1114
1520
|
const hasIdTokenWrite = permissions && permissions['id-token'] === 'write';
|
|
1115
1521
|
if (!hasContentsWrite || !hasIdTokenWrite) {
|
|
1116
1522
|
context.warnings.push(
|
|
1117
|
-
`[S3018]
|
|
1523
|
+
`[S3018] "${WORKFLOW_FILE_SHORT}": job "deploy" is missing required permissions "contents: write" and "id-token: write" at job level. ` +
|
|
1118
1524
|
`Trusted publishing will not work without them.`,
|
|
1119
1525
|
);
|
|
1120
1526
|
} else {
|
|
@@ -1133,7 +1539,7 @@ async function checkTests(context) {
|
|
|
1133
1539
|
Object.prototype.hasOwnProperty.call(deployStep.with, 'npm-token')
|
|
1134
1540
|
) {
|
|
1135
1541
|
context.warnings.push(
|
|
1136
|
-
`[W3019]
|
|
1542
|
+
`[W3019] "${WORKFLOW_FILE_SHORT}": job "deploy" step using "ioBroker/testing-action-deploy@v1" ` +
|
|
1137
1543
|
`has "npm-token" parameter specified. ` +
|
|
1138
1544
|
`Trusted publishing will not work while "npm-token" is set.`,
|
|
1139
1545
|
);
|
|
@@ -1147,13 +1553,13 @@ async function checkTests(context) {
|
|
|
1147
1553
|
if (deployNodeVersion !== null) {
|
|
1148
1554
|
if (deployNodeVersion < effectiveMinDeploy) {
|
|
1149
1555
|
context.errors.push(
|
|
1150
|
-
`[E3022]
|
|
1556
|
+
`[E3022] "${WORKFLOW_FILE_SHORT}": job "deploy" uses node.js ${deployNodeVersion} ` +
|
|
1151
1557
|
`which is below the minimum required version ${effectiveMinDeploy}. ` +
|
|
1152
1558
|
`Please update to node.js ${effectiveRecDeploy}.`,
|
|
1153
1559
|
);
|
|
1154
1560
|
} else if (deployNodeVersion < effectiveRecDeploy) {
|
|
1155
1561
|
context.warnings.push(
|
|
1156
|
-
`[S3023]
|
|
1562
|
+
`[S3023] "${WORKFLOW_FILE_SHORT}": job "deploy" uses node.js ${deployNodeVersion}. ` +
|
|
1157
1563
|
`Consider updating to the recommended version ${effectiveRecDeploy}.`,
|
|
1158
1564
|
);
|
|
1159
1565
|
} else {
|
|
@@ -1178,33 +1584,33 @@ exports.checkTests = checkTests;
|
|
|
1178
1584
|
// [E3002] Workflow file "${WORKFLOW_FILE}" not found. Please create it for standard CI/CD testing.
|
|
1179
1585
|
// [E3003] Workflow file "${WORKFLOW_FILE}" could not be read, is empty, not valid YAML, or does not contain valid workflow content.
|
|
1180
1586
|
// [W3004] Workflow "name" in "${WORKFLOW_FILE_SHORT}" must be "Test and Release".
|
|
1181
|
-
// [W3005]
|
|
1182
|
-
// [E3006]
|
|
1183
|
-
// [E3007]
|
|
1184
|
-
// [E3008]
|
|
1185
|
-
// [W3009]
|
|
1186
|
-
// [S3010]
|
|
1187
|
-
// [E3010]
|
|
1188
|
-
// [E3011]
|
|
1189
|
-
// [S3012]
|
|
1190
|
-
// [W3013]
|
|
1191
|
-
// [S3014]
|
|
1192
|
-
// [W3015]
|
|
1193
|
-
// [E3016]
|
|
1194
|
-
// [W3017]
|
|
1195
|
-
// [S3018]
|
|
1196
|
-
// [W3019]
|
|
1197
|
-
// [E3020]
|
|
1198
|
-
// [S3021]
|
|
1199
|
-
// [E3022]
|
|
1200
|
-
// [S3023]
|
|
1201
|
-
// [W3024]
|
|
1202
|
-
// [E3025]
|
|
1203
|
-
// [W3026]
|
|
1204
|
-
// [W3027]
|
|
1205
|
-
// [W3028]
|
|
1206
|
-
// [W3029]
|
|
1207
|
-
// [W3030]
|
|
1587
|
+
// [W3005] "${WORKFLOW_FILE_SHORT}" should have "pull_request: {}" in the "on" trigger configuration.
|
|
1588
|
+
// [E3006] "${WORKFLOW_FILE_SHORT}" is missing the "push" trigger in the "on" configuration.
|
|
1589
|
+
// [E3007] "${WORKFLOW_FILE_SHORT}": "push" trigger is missing "branches" configuration.
|
|
1590
|
+
// [E3008] "${WORKFLOW_FILE_SHORT}": "push" trigger is missing "tags" configuration.
|
|
1591
|
+
// [W3009] "${WORKFLOW_FILE_SHORT}" is missing recommended concurrency configuration.
|
|
1592
|
+
// [S3010] "${WORKFLOW_FILE_SHORT}": job "check-and-lint" is missing. Consider adding it.
|
|
1593
|
+
// [E3010] "${WORKFLOW_FILE_SHORT}": job "check-and-lint" is missing. Please add it.
|
|
1594
|
+
// [E3011] "${WORKFLOW_FILE_SHORT}": job "adapter-tests" is missing. Please add it.
|
|
1595
|
+
// [S3012] "${WORKFLOW_FILE_SHORT}": job "deploy" is not defined. Consider adding it for automated releases.
|
|
1596
|
+
// [W3013] "${WORKFLOW_FILE_SHORT}": job "check-and-lint" should contain a step using "ioBroker/testing-action-check@${requiredCheckActionVersion}".
|
|
1597
|
+
// [S3014] "${WORKFLOW_FILE_SHORT}": job "adapter-tests" should declare "needs: check-and-lint" to run after linting.
|
|
1598
|
+
// [W3015] "${WORKFLOW_FILE_SHORT}": job "adapter-tests" should contain a step using "ioBroker/testing-action-adapter@${requiredAdapterActionVersion}".
|
|
1599
|
+
// [E3016] "${WORKFLOW_FILE_SHORT}": job "deploy" must declare "needs" for both "check-and-lint" and "adapter-tests".
|
|
1600
|
+
// [W3017] "${WORKFLOW_FILE_SHORT}": job "deploy" should contain a step using "ioBroker/testing-action-deploy@${requiredDeployActionVersion}".
|
|
1601
|
+
// [S3018] "${WORKFLOW_FILE_SHORT}": job "deploy" is missing required permissions "contents: write" and "id-token: write" at job level.
|
|
1602
|
+
// [W3019] "${WORKFLOW_FILE_SHORT}": job "deploy" step using "ioBroker/testing-action-deploy@v1" has "npm-token" parameter specified.
|
|
1603
|
+
// [E3020] "${WORKFLOW_FILE_SHORT}": job "check-and-lint" uses node.js ${checkLintNodeVersion} which is below the minimum required version.
|
|
1604
|
+
// [S3021] "${WORKFLOW_FILE_SHORT}": job "check-and-lint" uses node.js ${checkLintNodeVersion}. Consider updating.
|
|
1605
|
+
// [E3022] "${WORKFLOW_FILE_SHORT}": job "deploy" uses node.js ${deployNodeVersion} which is below the minimum required version.
|
|
1606
|
+
// [S3023] "${WORKFLOW_FILE_SHORT}": job "deploy" uses node.js ${deployNodeVersion}. Consider updating.
|
|
1607
|
+
// [W3024] "${WORKFLOW_FILE_SHORT}": job "adapter-tests" matrix uses node.js ${v} which is below the minimum required version.
|
|
1608
|
+
// [E3025] "${WORKFLOW_FILE_SHORT}": job "adapter-tests" matrix is missing required node.js version ${v}.
|
|
1609
|
+
// [W3026] "${WORKFLOW_FILE_SHORT}": job "adapter-tests" matrix is missing recommended node.js version ${v}.
|
|
1610
|
+
// [W3027] "${WORKFLOW_FILE_SHORT}": testing for OS ${uncoveredMissingSystems} is missing.
|
|
1611
|
+
// [W3028] "${WORKFLOW_FILE_SHORT}": job "check-and-lint" uses "ioBroker/testing-action-check@${lowerRef}" which is below the required version.
|
|
1612
|
+
// [W3029] "${WORKFLOW_FILE_SHORT}": job "adapter-tests" uses "ioBroker/testing-action-adapter@${lowerRef}" which is below the required version.
|
|
1613
|
+
// [W3030] "${WORKFLOW_FILE_SHORT}": job "deploy" uses "ioBroker/testing-action-deploy@${lowerRef}" which is below the required version.
|
|
1208
1614
|
// [W3031] No workflow runs found for "${WORKFLOW_FILE_SHORT}".
|
|
1209
1615
|
// [E3031] Latest workflow run of "${WORKFLOW_FILE_SHORT}" on branch "${defaultBranch}" failed.
|
|
1210
1616
|
// [S3031] package.json "os" excludes required OS systems.
|
|
@@ -1213,14 +1619,20 @@ exports.checkTests = checkTests;
|
|
|
1213
1619
|
// [E3034] Release ${npmLatestRelease} tagged as "latest" at npm has not yet been tagged at GitHub. Tagging of releases is required.
|
|
1214
1620
|
// [W3035] No workflow run for "${WORKFLOW_FILE_SHORT}" triggered by tag "${taggedVersion}" was found for ...
|
|
1215
1621
|
// [E3036] Newest npm release ${newestNpmRelease} has not yet been tagged at GitHub. Tagging of releases is required.
|
|
1216
|
-
// [E3037]
|
|
1622
|
+
// [E3037] "${WORKFLOW_FILE_SHORT}": "push" trigger "branches" must include "*" or the default branch.
|
|
1217
1623
|
// [W3038] Could not retrieve npm release information for testing checks: ${e.message}
|
|
1218
1624
|
// [W3039] Could not retrieve workflow run data for "${WORKFLOW_FILE_SHORT}": ${e.message}
|
|
1219
|
-
// [E3040]
|
|
1625
|
+
// [E3040] "${WORKFLOW_FILE_SHORT}": "push" trigger "tags" is missing required pattern(s).
|
|
1220
1626
|
// [W3041] Latest workflow run of "${WORKFLOW_FILE_SHORT}" on branch "${defaultBranch}" was cancelled.
|
|
1221
|
-
// [S3042]
|
|
1222
|
-
// [S3043]
|
|
1223
|
-
// [S3044]
|
|
1224
|
-
// [S3045]
|
|
1225
|
-
// [W3046]
|
|
1226
|
-
// [E3047]
|
|
1627
|
+
// [S3042] "${WORKFLOW_FILE_SHORT}": job "check-and-lint" uses "ioBroker/testing-action-check@${ref}" with a pinned version. Consider locking only the major version.
|
|
1628
|
+
// [S3043] "${WORKFLOW_FILE_SHORT}": job "adapter-tests" uses "ioBroker/testing-action-adapter@${ref}" with a pinned version. Consider locking only the major version.
|
|
1629
|
+
// [S3044] "${WORKFLOW_FILE_SHORT}": job "deploy" uses "ioBroker/testing-action-deploy@${ref}" with a pinned version. Consider locking only the major version.
|
|
1630
|
+
// [S3045] "${WORKFLOW_FILE_SHORT}": job "check-and-lint" should enable linting by setting "lint: true".
|
|
1631
|
+
// [W3046] "${WORKFLOW_FILE_SHORT}": job "${jobName}" step "${stepLabel}" uses "continue-on-error: true". Workflow test-and-release should abort if any error occurs; remove "continue-on-error".
|
|
1632
|
+
// [E3047] "${WORKFLOW_FILE_SHORT}": job "${jobName}" step "${stepLabel}" uses "continue-on-error: true". Workflow test-and-release should abort if any error occurs; remove "continue-on-error".
|
|
1633
|
+
// [W3048] "${WORKFLOW_FILE_SHORT}": job "check-and-lint" step using "ioBroker/testing-action-check" specifies a command parameter that should not be changed.
|
|
1634
|
+
// [W3049] "${WORKFLOW_FILE_SHORT}": job "adapter-tests" step using "ioBroker/testing-action-adapter" specifies "integration-test-command" that should not be changed.
|
|
1635
|
+
// [W3050] "${WORKFLOW_FILE_SHORT}": no "check-and-lint" job / log found in the latest run. Cannot verify "npm run test:package" output.
|
|
1636
|
+
// [S3051] "${WORKFLOW_FILE_SHORT}": output of "testing-action-check" does not match expected defaults. Please check the log manually.
|
|
1637
|
+
// [W3052] "${WORKFLOW_FILE_SHORT}": no "adapter-tests" job / log found in the latest run. Cannot verify "npm run test:integration" output.
|
|
1638
|
+
// [S3053] "${WORKFLOW_FILE_SHORT}": output of "testing-action-adapter" does not match expected defaults. Please check the log manually.
|
package/lib/M5600__I18n.js
CHANGED
|
@@ -535,9 +535,11 @@ function checkJsonConfigTranslations(context, configFile, jsonConfig, i18nDir, w
|
|
|
535
535
|
}
|
|
536
536
|
}
|
|
537
537
|
|
|
538
|
-
//
|
|
539
|
-
// (skip when i18n is not set to avoid flooding adapters that use words.js or other mechanisms)
|
|
538
|
+
// W5619: i18n attribute missing - flag as it defaults to true which may be surprising
|
|
540
539
|
if (i18nMode === undefined || i18nMode === null) {
|
|
540
|
+
context.warnings.push(
|
|
541
|
+
`[S5619] "${displayConfig}" does not specify the "i18n" attribute. It defaults to true, which may be unintentional. Please explicitly add "i18n": true, "i18n": false, or a custom path.`,
|
|
542
|
+
);
|
|
541
543
|
return;
|
|
542
544
|
}
|
|
543
545
|
|
|
@@ -679,3 +681,4 @@ exports.getI18nFilesToRead = getI18nFilesToRead;
|
|
|
679
681
|
// [W5616] jsonConfig has i18n enabled but a translatable attribute uses an inline i18n object
|
|
680
682
|
// [W5617] jsonConfig has i18n=false but a translatable attribute uses a plain string
|
|
681
683
|
// [E5618] "Custom path specified at i18n attribute (${customPath}) must end with '/i18n'
|
|
684
|
+
// [W5619] jsonConfig does not specify the "i18n" attribute (defaults to true)
|
package/lib/postprocessing.js
CHANGED
|
@@ -66,6 +66,9 @@ const mapSeverity4New = {
|
|
|
66
66
|
S3014: 'E', // [S3014] Workflow "test-and-release.yml": job "adapter-tests" should declare "needs: check-and-lint" to run after linting.
|
|
67
67
|
W3019: 'E', // [W3019] Workflow "test-and-release.yml": job "deploy" step using "ioBroker/testing-action-deploy@v1" has "npm-token" parameter specified. Trusted publishing will not work while "npm-token" is set.
|
|
68
68
|
W3027: 'E', // [W3027] Workflow "test-and-release.yml": job "adapter-tests" OS matrix is missing: windows-latest, macos-latest. Consider adding tests for all of: ubuntu-latest, windows-latest, macos-latest
|
|
69
|
+
W3049: 'E', // [W3049] Workflow "test-and-release.yml": job "adapter-tests" step using "ioBroker/testing-action-adapter" specifies "integration-test-command". This command should not be changed; the default value should be used.
|
|
70
|
+
S3053: 'E', // [S3053] "test-and-release.yml": "testing-action-adapter" job "adapter-tests (22.x, macos-latest)" in [run #333](https://github.com/mosandlt/ioBroker.bosch-smart-home-camera/actions/runs/28146512000) does not log the expected defaults for "npm run test:integration". Please check the [log](https://github.com/mosandlt/ioBroker.bosch-smart-home-camera/actions/runs/28146512000/job/83354759586).
|
|
71
|
+
W3053: 'E', // [S3053] "test-and-release.yml": "testing-action-adapter" job "adapter-tests (22.x, macos-latest)" in [run #333](https://github.com/mosandlt/ioBroker.bosch-smart-home-camera/actions/runs/28146512000) does not log the expected defaults for "npm run test:integration". Please check the [log](https://github.com/mosandlt/ioBroker.bosch-smart-home-camera/actions/runs/28146512000/job/83354759586).
|
|
69
72
|
W5018: 'E', // [W5018] "@alcalzone/release-script" (>=3.0.0) is used, but ".releaseconfig.json" not found. Please create.',
|
|
70
73
|
W5512: 'E', // [W5512] admin/jsonConfig.json schema validation error: ...
|
|
71
74
|
W5612: 'E', // W5612] "admin/jsonConfig.json/items/..." attribute "label" uses key "..." which is not found in the English translation file at "admin/i18n/en".
|
|
@@ -88,6 +91,7 @@ const mapSeverity4New = {
|
|
|
88
91
|
W5604: 'E', // [W5604] i18n "admin/i18n" language "de" is missing 4 key(s) present in English: Abfrageintervall (Sekunden),
|
|
89
92
|
W5606: 'E', // [W5606] i18n "admin/i18n" language "nl" has 169 translation(s) identical to English (i.e. baseConfiguration). This may indicate untranslated content.
|
|
90
93
|
W5611: 'E', // [W5611] "admin/jsonConfig.json/items/tab_region/items/country/options[0]" attribute "label" is missing language "uk" in i18n object.
|
|
94
|
+
S5619: 'E', // [S5619] "${displayConfig}" does not specify the "i18n" attribute. It defaults to true, which may be unintentional. Please explicitly add "i18n": true, "i18n": false, or a custom path.`,
|
|
91
95
|
S6008: 'E', // [S6008] Changelog for version 0.7.0-beta.19 should be added to README.md
|
|
92
96
|
S6020: 'W', // [S6020] Consider adding a CHANGELOG_OLD.md file to store older changelog entries. This is supported by @alcalzone/releasescript.
|
|
93
97
|
S6022: 'E', // [S6022] CHANGELOG_OLD.md exists but no link to it was found in README.md. Consider adding a link to CHANGELOG_OLD.md at the end of the Changelog section. S8901: 'W', // [S8901] Dependabot configuration file ".github/dependabot.yml" not found. Consider adding dependabot to keep dependencies up to date.
|
package/package.json
CHANGED