amsd-pipeline-workflow 0.1.16 → 0.1.18
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/driver/release-lines.js +17 -9
- package/package.json +1 -1
package/driver/release-lines.js
CHANGED
|
@@ -46,13 +46,13 @@ async function runReleaseLines(ctx, lane, clPrd, laneLog, laneEnv, canonical, ph
|
|
|
46
46
|
// A RESUMED LINE'S COMMITTED WORK IS NOT REWRITTEN (operator, 2026-10-20): its story completed by its commit, as a lane's is
|
|
47
47
|
if (env.EPAM_RESUME_RUN && fs.existsSync(linePrd)) {
|
|
48
48
|
const id = (JSON.parse(fs.readFileSync(linePrd, 'utf8')).stories[0] || {}).id;
|
|
49
|
-
if (id) completeLineByCommit(env, wt, lineLog, linePrd,
|
|
49
|
+
if (id) completeLineByCommit(env, wt, lineLog, linePrd, lineBranch(env, id, slug), log);
|
|
50
50
|
}
|
|
51
51
|
const done = lineIsDone(linePrd);
|
|
52
52
|
if (bash(env, 'resume_preserves', ['completed-stories']).status === 0 && done
|
|
53
53
|
&& !handler(env, 'spec-predates-plan', [linePrd, canonical || clPrd]).stdout.trim()) { // :96–106
|
|
54
54
|
rerun = [];
|
|
55
|
-
const lb =
|
|
55
|
+
const lb = lineBranch(env, JSON.parse(fs.readFileSync(linePrd, 'utf8')).stories[0].id, slug);
|
|
56
56
|
if (git(wt, 'checkout', '-q', lb).status !== 0) log(`[orch] Codeline '${cl}': could not check out ${lb} for its review`);
|
|
57
57
|
handler(env, 'carry-plan', [linePrd, canonical || clPrd], { log });
|
|
58
58
|
log(`[orch] Codeline '${cl}' — release line ${line} completed in this run — its reviewer judges it again against the story's plan`);
|
|
@@ -94,6 +94,16 @@ async function runReleaseLines(ctx, lane, clPrd, laneLog, laneEnv, canonical, ph
|
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
+
/**
|
|
98
|
+
* A RELEASE LINE'S BRANCH NAME — the shared run-state core's ONE rule (story_branch_name, lib/git-ops.sh; backlog B75, finding RS-10), asked of the install's own
|
|
99
|
+
* function: the driver keeps no second copy of the rule. An install that predates it is said, loudly.
|
|
100
|
+
*/
|
|
101
|
+
function lineBranch(env, id, slug) {
|
|
102
|
+
const r = bash(env, 'story_branch_name', [id, `-${slug}`]);
|
|
103
|
+
if (r.status !== 0 || !r.stdout.trim()) throw new Error(`the install's lib/git-ops.sh has no story_branch_name (exit ${r.status}) — it needs amsd-pipeline-shared >= 0.5.2 (amsd-pipeline-shared install --into <install>)`);
|
|
104
|
+
return r.stdout.trim();
|
|
105
|
+
}
|
|
106
|
+
|
|
97
107
|
/**
|
|
98
108
|
* A RESUMED RELEASE LINE (LIVE-AMSD-2974-11): the line's branch checked out and the pipeline's own
|
|
99
109
|
* story_resume_completed_by_commit run on the line's log and PRD. The pipeline applies it to lanes only, so a line whose
|
|
@@ -104,13 +114,11 @@ function completeLineByCommit(env, wt, lineLog, linePrd, branch, log) {
|
|
|
104
114
|
if (git(wt, 'rev-parse', '--verify', '--quiet', branch).status !== 0) return;
|
|
105
115
|
if (git(wt, 'checkout', '-q', branch).status !== 0) { log(`[orch] could not check out ${branch} to read its committed work`); return; }
|
|
106
116
|
bash({ ...env, PROJECT_ROOT: wt }, 'story_resume_completed_by_commit', [wt, lineLog, linePrd], { log });
|
|
107
|
-
//
|
|
108
|
-
//
|
|
109
|
-
// A Writer-completed story carries both; this one does too.
|
|
117
|
+
// B78 (RS-5): the shared function sets `completed` AND `status` (a Writer-completed story carries both), which the line's done test reads. The driver used to
|
|
118
|
+
// patch `status` itself, behind the pipeline's back; it now only CHECKS, and an install whose function predates the fix is said — never worked around silently.
|
|
110
119
|
const p = JSON.parse(fs.readFileSync(linePrd, 'utf8'));
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
if (changed) fs.writeFileSync(linePrd, JSON.stringify(p, null, 2));
|
|
120
|
+
const half = (p.stories || []).filter((s) => s.completed === true && s.status !== 'completed' && s.status !== 'deprecated');
|
|
121
|
+
if (half.length) throw new Error(`the install's story_resume_completed_by_commit marked ${half.map((s) => s.id).join(', ')} completed without a status — it predates the fix (needs amsd-pipeline-shared >= 0.5.3: amsd-pipeline-shared install --into <install>)`);
|
|
114
122
|
}
|
|
115
123
|
|
|
116
124
|
/** A line whose every story is completed — the pipeline's own test (lib/release-lines.sh:96). */
|
|
@@ -120,4 +128,4 @@ function lineIsDone(linePrd) {
|
|
|
120
128
|
return (p.stories || []).length > 0 && p.stories.every((s) => s.status === 'completed');
|
|
121
129
|
}
|
|
122
130
|
|
|
123
|
-
module.exports = { runReleaseLines, completeLineByCommit, lineIsDone };
|
|
131
|
+
module.exports = { runReleaseLines, completeLineByCommit, lineIsDone, lineBranch };
|
package/package.json
CHANGED