@iobroker/repochecker 5.23.2 → 5.24.0

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 CHANGED
@@ -56,6 +56,11 @@ GITHUB_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
56
56
  Placeholder for the next version (at the beginning of the line):
57
57
  ### **WORK IN PROGRESS**
58
58
  -->
59
+ ### 5.24.0 (2026-11-09)
60
+ * (@copilot) jsDelivr file downloads retry transient errors and HTML responses received for JSON files. see: #1201
61
+ * (@mcm1957) Wildcard support added for source directory exclusions; all `src-*` entries replaced by a single `src-*` pattern (fixes false positive E9507 for directories like `src-web`). see: #1209
62
+ * (@copilot) Workflow runs still in progress are now awaited (max. 10 minutes) before logs are analyzed; "could not retrieve log" messages mention if the workflow is still in progress. see: #1214
63
+
59
64
  ### 5.23.2 (2026-10-17)
60
65
  * (@mcm1957) src-shared directory added to src list.
61
66
 
@@ -64,6 +69,7 @@ GITHUB_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
64
69
 
65
70
  ### 5.23.0 (2026-10-14)
66
71
 
72
+ * (@mcm1957) Fixed: failed workflow runs now correctly show as [E3032] instead of [W3032] (see [#1196](https://github.com/ioBroker/ioBroker.repochecker/issues/1196)).
67
73
  * (@mcm1957) Special handling of some core adapters added.
68
74
  * (@mcm1957) Fixed: githubToken and axios instance are now isolated per check; concurrent checks no longer share authorization state or redaction context (see [#1193](https://github.com/ioBroker/ioBroker.repochecker/issues/1193)).
69
75
 
@@ -71,9 +77,6 @@ GITHUB_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
71
77
 
72
78
  * (@mcm1957) Fixed false positive [E6025] when README.md contains `#` headings inside fenced code blocks.
73
79
 
74
- ### 5.22.15 (2026-10-12)
75
- * (mcm1957) src-blockly added to source directories excluded from E9507 / E9506 (missing i18n files) check
76
-
77
80
  [Older changelogs can be found there](CHANGELOG_OLD.md)
78
81
 
79
82
  ## License
@@ -186,13 +186,16 @@ async function checkTagTriggeredRun(context, workflowRuns, version, taggedVersio
186
186
  return;
187
187
  }
188
188
 
189
+ const tagRunInProgress = await waitForRunCompletion(context, tagRun);
190
+ const tagInProgressInfo = tagRunInProgress ? ' (workflow is still in progress)' : '';
191
+
189
192
  if (tagRun.conclusion === 'cancelled') {
190
193
  context.warnings.push(
191
194
  `[W${codeBase}] "${WORKFLOW_FILE_SHORT}" run triggered by tag "${taggedVersion}" for ${sourceLabel} was cancelled ${formatRunLink(tagRun)}.`,
192
195
  );
193
196
  } else if (tagRun.conclusion === 'failure') {
194
197
  context.errors.push(
195
- `[W${codeBase}] "${WORKFLOW_FILE_SHORT}" run triggered by tag "${taggedVersion}" for ${sourceLabel} failed ${formatRunLink(tagRun)}.`,
198
+ `[E${codeBase}] "${WORKFLOW_FILE_SHORT}" run triggered by tag "${taggedVersion}" for ${sourceLabel} failed ${formatRunLink(tagRun)}.`,
196
199
  );
197
200
  } else {
198
201
  context.checks.push(
@@ -229,7 +232,7 @@ async function checkTagTriggeredRun(context, workflowRuns, version, taggedVersio
229
232
  const checkAndLintLog = await fetchJobLog(context, checkAndLintJob.id);
230
233
  if (!checkAndLintLog) {
231
234
  context.warnings.push(
232
- `[W3050] "${WORKFLOW_FILE_SHORT}": could not retrieve log for "check-and-lint" job in ${formatRunLink(tagRun)} for ${sourceLabel}.`,
235
+ `[W3050] "${WORKFLOW_FILE_SHORT}": could not retrieve log for "check-and-lint" job in ${formatRunLink(tagRun)} for ${sourceLabel}${tagInProgressInfo}.`,
233
236
  );
234
237
  } else if (checkAndLintLog === 'Error: 410') {
235
238
  if (!oldWorkflowRun) {
@@ -272,7 +275,7 @@ async function checkTagTriggeredRun(context, workflowRuns, version, taggedVersio
272
275
  const adapterLog = await fetchJobLog(context, adapterJob.id);
273
276
  if (!adapterLog) {
274
277
  context.warnings.push(
275
- `[W3052] "${WORKFLOW_FILE_SHORT}": could not retrieve log for job "${adapterJob.name}" in ${formatRunLink(tagRun)} for ${sourceLabel}.`,
278
+ `[W3052] "${WORKFLOW_FILE_SHORT}": could not retrieve log for job "${adapterJob.name}" in ${formatRunLink(tagRun)} for ${sourceLabel}${tagInProgressInfo}.`,
276
279
  );
277
280
  } else if (adapterLog === 'Error: 410') {
278
281
  if (!oldWorkflowRun){
@@ -772,6 +775,42 @@ async function fetchRunJobs(context, runId) {
772
775
  return jobs;
773
776
  }
774
777
 
778
+ const RUN_WAIT_INTERVAL_MS = 10000;
779
+ const RUN_WAIT_MAX_RETRIES = 60;
780
+
781
+ /**
782
+ * Waits while a workflow run is queued or executing; returns immediately if it has reached any final state (max. 60 retries with 10s delay).
783
+ * The passed run object is updated with the latest data retrieved.
784
+ *
785
+ * @param {object} context - checker context
786
+ * @param {object} run - workflow run object
787
+ * @returns {Promise<boolean>} true if the run is still in progress after waiting
788
+ */
789
+ async function waitForRunCompletion(context, run) {
790
+ let retries = 0;
791
+ // A run is final as soon as it is completed or has any conclusion (success, failure, cancelled, ...).
792
+ const isActive = r => r && r.status && r.status !== 'completed' && !r.conclusion;
793
+ while (isActive(run)) {
794
+ if (retries >= RUN_WAIT_MAX_RETRIES) {
795
+ return true;
796
+ }
797
+ retries++;
798
+ common.info(
799
+ `Workflow run ${run.id} is still in progress (status "${run.status}"), waiting 10s (retry ${retries}/${RUN_WAIT_MAX_RETRIES})...`,
800
+ );
801
+ await new Promise(resolve => setTimeout(resolve, RUN_WAIT_INTERVAL_MS));
802
+ try {
803
+ const response = await context.axios.get(`${context.githubUrlApi}/actions/runs/${run.id}`);
804
+ if (response.data && response.data.status) {
805
+ Object.assign(run, response.data);
806
+ }
807
+ } catch (e) {
808
+ common.debug(`Could not refresh workflow run ${run.id}: ${e.message}`);
809
+ }
810
+ }
811
+ return false;
812
+ }
813
+
775
814
  /**
776
815
  * Downloads the plain-text log for a single GitHub Actions job.
777
816
  * The API redirects to a download URL; axios follows the redirect automatically.
@@ -994,6 +1033,8 @@ async function checkTests(context) {
994
1033
  );
995
1034
  } else {
996
1035
  const lastRun = defaultBranchRuns[0];
1036
+ const lastRunInProgress = await waitForRunCompletion(context, lastRun);
1037
+ const lastInProgressInfo = lastRunInProgress ? ' (workflow is still in progress)' : '';
997
1038
  if (lastRun.conclusion === 'cancelled') {
998
1039
  context.warnings.push(
999
1040
  `[W3041] Latest workflow run of "${WORKFLOW_FILE_SHORT}" on branch "${defaultBranch}" was cancelled ${formatRunLink(lastRun)}.`,
@@ -1035,7 +1076,7 @@ async function checkTests(context) {
1035
1076
  const checkAndLintLog = await fetchJobLog(context, checkAndLintJob.id);
1036
1077
  if (!checkAndLintLog) {
1037
1078
  context.warnings.push(
1038
- `[W3050] "${WORKFLOW_FILE_SHORT}": could not retrieve log for "check-and-lint" job in ${formatRunLink(lastRun)} on branch "${defaultBranch}".`,
1079
+ `[W3050] "${WORKFLOW_FILE_SHORT}": could not retrieve log for "check-and-lint" job in ${formatRunLink(lastRun)} on branch "${defaultBranch}"${lastInProgressInfo}.`,
1039
1080
  );
1040
1081
  } else if (checkAndLintLog === 'Error: 410') {
1041
1082
  if (!oldWorkflowRun) {
@@ -1082,7 +1123,7 @@ async function checkTests(context) {
1082
1123
  const adapterLog = await fetchJobLog(context, adapterJob.id);
1083
1124
  if (!adapterLog) {
1084
1125
  context.warnings.push(
1085
- `[W3052] "${WORKFLOW_FILE_SHORT}": could not retrieve log for job "${adapterJob.name}" in ${formatRunLink(lastRun)} on branch "${defaultBranch}".`,
1126
+ `[W3052] "${WORKFLOW_FILE_SHORT}": could not retrieve log for job "${adapterJob.name}" in ${formatRunLink(lastRun)} on branch "${defaultBranch}"${lastInProgressInfo}.`,
1086
1127
  );
1087
1128
  } else if (adapterLog === 'Error: 410') {
1088
1129
  if (!oldWorkflowRun) {
package/lib/M5000_Code.js CHANGED
@@ -11,6 +11,7 @@ const fs = require('node:fs');
11
11
  const path = require('node:path');
12
12
 
13
13
  const compareVersions = require('compare-versions');
14
+ const { minimatch } = require('minimatch');
14
15
  const JSON5 = require('json5');
15
16
  const yaml = require('js-yaml');
16
17
 
@@ -1770,8 +1771,10 @@ async function checkCode(context) {
1770
1771
  '/src-rules',
1771
1772
  '/src-tab',
1772
1773
  '/src-vis',
1774
+ '/src-web',
1773
1775
  '/src-widgets',
1774
1776
  '/src-www',
1777
+ '/web-src',
1775
1778
  '/admin-src',
1776
1779
  '/rules-src',
1777
1780
  '/www',
@@ -1785,12 +1788,19 @@ async function checkCode(context) {
1785
1788
  ]);
1786
1789
  // Rooted entries ('/foo' or '/foo/bar') are matched as path prefixes relative to the repo
1787
1790
  // root, so multi-level paths like '/src/lib/scripts' are honored and not just their first segment.
1791
+ // Rooted glob patterns (e.g. '/src-*') are matched against the first path segment only.
1788
1792
  const excludedSourceRootPaths = new Set();
1793
+ const excludedSourceRootGlobs = []; // rooted wildcard patterns (no leading slash)
1789
1794
  const excludedSourceAnyLevelDirs = new Set();
1790
1795
  for (const excludedSourceDir of excludedSourceDirs) {
1791
1796
  if (excludedSourceDir.startsWith('/')) {
1792
1797
  const rootPath = excludedSourceDir.slice(1);
1793
- if (rootPath) {
1798
+ if (!rootPath) {
1799
+ continue;
1800
+ }
1801
+ if (/[*?{]/.test(rootPath)) {
1802
+ excludedSourceRootGlobs.push(rootPath);
1803
+ } else {
1794
1804
  excludedSourceRootPaths.add(rootPath);
1795
1805
  }
1796
1806
  } else {
@@ -1897,8 +1907,11 @@ async function checkCode(context) {
1897
1907
  const isInExcludedSourceRootDir = [...excludedSourceRootPaths].some(
1898
1908
  rootPath => relFilePath === rootPath || relFilePath.startsWith(`${rootPath}/`),
1899
1909
  );
1910
+ // For wildcard root patterns (e.g. '/src-*'), match against the first path segment only
1911
+ const firstPathSegment = pathParts[0] || '';
1912
+ const isInExcludedSourceRootGlob = excludedSourceRootGlobs.some(glob => minimatch(firstPathSegment, glob));
1900
1913
  const isInExcludedSourceAnyLevelDir = pathParts.some(pathPart => excludedSourceAnyLevelDirs.has(pathPart));
1901
- const isInExcludedSourceDir = isInExcludedSourceRootDir || isInExcludedSourceAnyLevelDir;
1914
+ const isInExcludedSourceDir = isInExcludedSourceRootDir || isInExcludedSourceRootGlob || isInExcludedSourceAnyLevelDir;
1902
1915
  if (isInExcludedSourceDir) {
1903
1916
  continue;
1904
1917
  }
@@ -19,22 +19,13 @@ const { minimatch } = require('minimatch');
19
19
 
20
20
  // Source directories (or directory paths) whose i18n subdirectories are excluded from npm packaging
21
21
  // checks, since their contents are typically compiled/moved to build/ or admin/ during the build
22
- // process. Entries may be top-level directory names (e.g. 'src') or multi-level paths (e.g.
23
- // 'admin/src'). An i18n directory is ignored when its parent path equals one of these entries or
24
- // starts with one of these entries followed by '/'.
22
+ // process. Entries may be top-level directory names (e.g. 'src'), multi-level paths (e.g.
23
+ // 'admin/src'), or glob patterns (e.g. 'src-*'). An i18n directory is ignored when its parent
24
+ // path equals one of these entries, starts with one of these entries followed by '/', or (for
25
+ // glob patterns without '/') its first path segment matches the pattern.
25
26
  const SRC_DIRS_TO_IGNORE = [
26
27
  'src',
27
- 'src-admin',
28
- 'src-blockly', // javascript adapter blockly editor
29
- 'src-chart',
30
- 'src-devices', // lgtv
31
- 'src-editor', // java-script adapter
32
- 'src-preview',
33
- 'src-rules',
34
- 'src-shared',
35
- 'src-tab',
36
- 'src-vis',
37
- 'src-widgets',
28
+ 'src-*', // any top-level directory starting with 'src-' (e.g. src-admin, src-web, src-widgets, ...)
38
29
  'admin-src',
39
30
  'rules-src',
40
31
  'admin/src',
@@ -198,10 +189,17 @@ function findI18nDirs(filesList) {
198
189
  // parentPath is everything before the final '/i18n' segment
199
190
  const parts = i18nPath.split('/');
200
191
  const parentPath = parts.slice(0, -1).join('/'); // e.g. 'admin', 'src-rules/src', ''
201
- // Skip i18n dirs that reside inside a known source directory (or sub-path thereof)
202
- const isInSrcDir = SRC_DIRS_TO_IGNORE.some(
203
- srcDir => parentPath === srcDir || parentPath.startsWith(`${srcDir}/`),
204
- );
192
+ // Skip i18n dirs that reside inside a known source directory (or sub-path thereof).
193
+ // Entries without wildcards are matched exactly or as a path prefix.
194
+ // Glob patterns (e.g. 'src-*') are matched against the first path segment only.
195
+ const isInSrcDir = SRC_DIRS_TO_IGNORE.some(srcDir => {
196
+ if (/[*?{]/.test(srcDir) && !srcDir.includes('/')) {
197
+ // Wildcard single-segment pattern: match the first segment of parentPath
198
+ const firstSegment = parentPath.split('/')[0];
199
+ return minimatch(firstSegment, srcDir);
200
+ }
201
+ return parentPath === srcDir || parentPath.startsWith(`${srcDir}/`);
202
+ });
205
203
  if (!isInSrcDir) {
206
204
  i18nDirs.add(i18nDir);
207
205
  }
package/lib/common.js CHANGED
@@ -42,6 +42,8 @@ const githubHostnames = new Set([
42
42
  // Cache for getFilesList and getFile functions
43
43
  const filesListCache = new Map();
44
44
  const fileCache = new Map();
45
+ const DOWNLOAD_RETRIES = 3;
46
+ const DOWNLOAD_RETRY_DELAY_MS = 30000;
45
47
 
46
48
  /*
47
49
  Masks a token for logging: keeps the first 4 and last 4 characters and
@@ -252,6 +254,24 @@ function getResponseMessage(error) {
252
254
  return '';
253
255
  }
254
256
 
257
+ function isJsDelivrUrl(url) {
258
+ try {
259
+ return new URL(url).hostname === 'cdn.jsdelivr.net';
260
+ } catch {
261
+ return false;
262
+ }
263
+ }
264
+
265
+ function isHtmlResponse(response) {
266
+ const contentType = response.headers?.['content-type'];
267
+ if (typeof contentType === 'string' && contentType.toLowerCase().includes('text/html')) {
268
+ return true;
269
+ }
270
+
271
+ const data = Buffer.isBuffer(response.data) ? response.data.toString('utf8') : response.data;
272
+ return typeof data === 'string' && /^\s*(?:<\?xml[^>]*>\s*)?<(?:!doctype\s+html|html|head|body)\b/i.test(data);
273
+ }
274
+
255
275
  function isDebug() {
256
276
  return gDebug;
257
277
  }
@@ -306,15 +326,40 @@ async function downloadURL(context, url, binary) {
306
326
  const options = {};
307
327
  options.responseType = binary ? 'arraybuffer' : 'text';
308
328
  const instance = context.axios;
309
- try {
310
- // @ts-expect-error options work this way
311
- const response = await instance(url, options);
312
- debug(`Download succeded`);
313
- return response.data;
314
- } catch (e) {
315
- const message = getResponseMessage(e);
316
- error(`Cannot download ${url} ${e}${message ? ` - ${message}` : ''}`);
317
- return '';
329
+ const retryJsDelivr = isJsDelivrUrl(url);
330
+ const expectsJson = /\.json(?:[?#]|$)/i.test(url);
331
+
332
+ for (let attempt = 0; ; attempt++) {
333
+ try {
334
+ // @ts-expect-error options work this way
335
+ const response = await instance(url, options);
336
+ if (retryJsDelivr && expectsJson && isHtmlResponse(response)) {
337
+ const htmlError = new Error('Received HTML instead of JSON');
338
+ htmlError.response = response;
339
+ throw htmlError;
340
+ }
341
+ debug(`Download succeded`);
342
+ return response.data;
343
+ } catch (e) {
344
+ const message = getResponseMessage(e);
345
+ const status = e?.response?.status;
346
+ const isNotFound = status === 404 || /\bnot found\b/i.test(message);
347
+ if (retryJsDelivr && isNotFound) {
348
+ debug(`File not found at ${url}`);
349
+ return '';
350
+ }
351
+
352
+ if (retryJsDelivr && attempt < DOWNLOAD_RETRIES) {
353
+ warn(
354
+ `Download failed for ${url}${status ? ` (HTTP ${status})` : ''}${message ? ` - ${message}` : ''}; retrying in 30 seconds (${attempt + 1}/${DOWNLOAD_RETRIES})`,
355
+ );
356
+ await new Promise(resolve => setTimeout(resolve, DOWNLOAD_RETRY_DELAY_MS));
357
+ continue;
358
+ }
359
+
360
+ error(`Cannot download ${url}${status ? ` (HTTP ${status})` : ''} ${e}${message ? ` - ${message}` : ''}`);
361
+ return '';
362
+ }
318
363
  }
319
364
  }
320
365
 
@@ -49,6 +49,9 @@ const filterByAdapter = {
49
49
  ping: [
50
50
  '[E5049] process.env is used in source files (src/lib/ping.ts). process.env is incompatible with compact mode. Please use adapter configuration instead.',
51
51
  ],
52
+ rpi2: [
53
+ '[E6012] README.md suggests to install using direct npm commands. Adapters must not be installed using direct npm commands. Please remove these instructions.'
54
+ ],
52
55
  'schlueter-thermostat': [
53
56
  '[W1073] Potential sensitive data "apiKey" not listed at "protectedNative" in io-package.json',
54
57
  '[W1074] Potential sensitive data "apiKey" not listed at "encryptedNative" in io-package.json',
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.23.2",
2
+ "version": "5.24.0",
3
3
  "name": "@iobroker/repochecker",
4
4
  "dependencies": {
5
5
  "ajv": "^8.20.0",
@@ -16,7 +16,7 @@
16
16
  "@alcalzone/release-script": "^5.2.1",
17
17
  "@iobroker/eslint-config": "^2.3.4",
18
18
  "@tsconfig/node20": "^20.1.10",
19
- "@types/node": "^26.6.3",
19
+ "@types/node": "^26.6.6",
20
20
  "@types/semver": "^7.8.0"
21
21
  },
22
22
  "repository": {