backend-manager 5.0.196 → 5.0.197
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/CHANGELOG.md +4 -0
- package/package.json +1 -1
- package/src/cli/commands/setup.js +34 -2
package/CHANGELOG.md
CHANGED
|
@@ -14,6 +14,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|
|
14
14
|
- `Fixed` for any bug fixes.
|
|
15
15
|
- `Security` in case of vulnerabilities.
|
|
16
16
|
|
|
17
|
+
# [5.0.197] - 2026-04-10
|
|
18
|
+
### Added
|
|
19
|
+
- `--retry=N` flag on `npx mgr setup` — re-runs the full setup sequence up to N times, stopping early as soon as all checks pass. Useful for test cases that only succeed after a prior run creates fixtures or indexes propagate.
|
|
20
|
+
|
|
17
21
|
# [5.0.196] - 2026-04-10
|
|
18
22
|
### Changed
|
|
19
23
|
- Moved disposable domain fetch from `prepublishOnly` lifecycle hook to `prepare-package`'s new `hooks.before` config. The fetch now runs on every `npm run prepare` / `npm install` / `npm publish`, so fresh domains land in both the git working tree and the published tarball — no more drift between git and npm.
|
package/package.json
CHANGED
|
@@ -10,11 +10,43 @@ const bem_allRulesRegex = /(\/\/\/---backend-manager---\/\/\/)(.*?)(\/\/\/------
|
|
|
10
10
|
|
|
11
11
|
class SetupCommand extends BaseCommand {
|
|
12
12
|
async execute() {
|
|
13
|
+
const self = this.main;
|
|
14
|
+
|
|
13
15
|
// Load config
|
|
14
16
|
await this.loadConfig();
|
|
15
17
|
|
|
16
|
-
//
|
|
17
|
-
|
|
18
|
+
// Resolve retry limit from --retry flag (default 1 = no retry)
|
|
19
|
+
const maxAttempts = Math.max(1, parseInt(self.argv.retry, 10) || 1);
|
|
20
|
+
|
|
21
|
+
// Run setup, retrying up to maxAttempts times until all tests pass
|
|
22
|
+
let attempt = 0;
|
|
23
|
+
while (attempt < maxAttempts) {
|
|
24
|
+
attempt++;
|
|
25
|
+
|
|
26
|
+
if (maxAttempts > 1) {
|
|
27
|
+
this.logSuccess(`\n==== SETUP ATTEMPT ${attempt}/${maxAttempts} ====`);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Reset counters so each attempt starts fresh
|
|
31
|
+
self.testCount = 0;
|
|
32
|
+
self.testTotal = 0;
|
|
33
|
+
|
|
34
|
+
await this.runSetup();
|
|
35
|
+
|
|
36
|
+
const allPassed = self.testCount === self.testTotal;
|
|
37
|
+
if (allPassed) {
|
|
38
|
+
if (maxAttempts > 1 && attempt > 1) {
|
|
39
|
+
this.logSuccess(`\nAll checks passed on attempt ${attempt}/${maxAttempts}.`);
|
|
40
|
+
}
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (attempt < maxAttempts) {
|
|
45
|
+
this.logWarning(`\nAttempt ${attempt}/${maxAttempts} had failures. Retrying...`);
|
|
46
|
+
} else if (maxAttempts > 1) {
|
|
47
|
+
this.logWarning(`\nReached retry limit (${maxAttempts}). Some checks still failing.`);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
18
50
|
}
|
|
19
51
|
|
|
20
52
|
async loadConfig() {
|