@metasession.co/devaudit-sdlc 1.8.0 → 1.9.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/package.json
CHANGED
|
@@ -478,10 +478,13 @@ function classifyPrStatus(pr, checks, portalStatus, watch, options) {
|
|
|
478
478
|
}
|
|
479
479
|
|
|
480
480
|
if (failingChecks.length > 0) {
|
|
481
|
+
const redRequired = requiredFailingChecks(failingChecks, isReleasePr);
|
|
481
482
|
return {
|
|
482
483
|
kind: 'blocked',
|
|
483
484
|
exitCode: 3,
|
|
484
|
-
summary:
|
|
485
|
+
summary: redRequired.length > 0
|
|
486
|
+
? `PR #${watch.prNumber} has failing REQUIRED release checks: ${redRequired.map(formatCheckName).join(', ')}. This release is blocked until the failure is fixed or accepted with a documented exception (devaudit-installer#1016); do not proceed to UAT or evidence upload with it unresolved.`
|
|
487
|
+
: `PR #${watch.prNumber} has failing checks that need code fixes: ${failingChecks.map(formatCheckName).join(', ')}.`,
|
|
485
488
|
};
|
|
486
489
|
}
|
|
487
490
|
|
|
@@ -510,6 +513,83 @@ function classifyPrStatus(pr, checks, portalStatus, watch, options) {
|
|
|
510
513
|
};
|
|
511
514
|
}
|
|
512
515
|
|
|
516
|
+
// devaudit-installer#1016 (R5) -- a red REQUIRED check on the release PR must be
|
|
517
|
+
// visible within one poll, not discovered at portal UAT approval. The release
|
|
518
|
+
// approval gate has its own retry path, so it is excluded here.
|
|
519
|
+
function requiredFailingChecks(failingChecks, isReleasePr) {
|
|
520
|
+
if (!isReleasePr) return [];
|
|
521
|
+
return failingChecks.filter(check =>
|
|
522
|
+
REQUIRED_RELEASE_CHECKS.includes(String(check.name || '')) && !isReleaseGateCheck(check));
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
function readGateTimeoutHours() {
|
|
526
|
+
const config = loadJsonFile(path.join(process.cwd(), 'sdlc-config.json'), {});
|
|
527
|
+
const value = Number(config && config.phase4 && config.phase4.gate_timeout_hours);
|
|
528
|
+
return Number.isFinite(value) && value > 0 ? value : 24;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
function updateStickyStatus(issue, last, next) {
|
|
532
|
+
const script = path.join(process.cwd(), 'scripts', 'update-sdlc-status.sh');
|
|
533
|
+
if (!issue || !fs.existsSync(script)) return;
|
|
534
|
+
spawnSync('bash', [script, String(issue), last, next], { cwd: process.cwd(), encoding: 'utf8', env: process.env });
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
function notifyRequiredGateFailure(repo, watch, pr, checks, options) {
|
|
538
|
+
const failing = checks.filter(check => isFailingState(check.state || check.bucket));
|
|
539
|
+
const red = requiredFailingChecks(failing, isReleasePromotionPr(pr || {}, options));
|
|
540
|
+
if (red.length === 0) {
|
|
541
|
+
delete watch.triageNotified;
|
|
542
|
+
delete watch.redSince;
|
|
543
|
+
delete watch.escalatedFor;
|
|
544
|
+
return;
|
|
545
|
+
}
|
|
546
|
+
const issue = options.issue || process.env.ISSUE_NUM || null;
|
|
547
|
+
const names = red.map(formatCheckName).sort();
|
|
548
|
+
const key = names.join(' | ');
|
|
549
|
+
const now = new Date();
|
|
550
|
+
watch.redSince = watch.redSince || now.toISOString();
|
|
551
|
+
const links = red.map(check => `- ${formatCheckName(check)}${check.link ? `: ${check.link}` : ''}`).join('\n');
|
|
552
|
+
const post = (title, extra) => {
|
|
553
|
+
const body = [
|
|
554
|
+
`**${title}**`,
|
|
555
|
+
'',
|
|
556
|
+
`Required check(s) failing on release PR #${watch.prNumber}:`,
|
|
557
|
+
links,
|
|
558
|
+
'',
|
|
559
|
+
'This release is blocked until one of these is completed:',
|
|
560
|
+
'1. **Fix** - a `fix/<issue#>-<slug>` PR into the integration branch, then a green re-run on the PR head SHA.',
|
|
561
|
+
'2. **Accept** - a documented exception: copy `.claude/skills/sdlc-implementer/references/e2e-accepted-failure.md.template` to `compliance/evidence/REQ-XXX/accepted-e2e-failure-<spec>.md`, fill the impact assessment, and record it with `scripts/report-test-execution.sh resolve --resolution-type accepted_exception --remediation-reference <tracking-issue> --record <that file>`. Never automatic: the operator decides.',
|
|
562
|
+
'',
|
|
563
|
+
'No merge into the release head is needed to record the triage in the portal.',
|
|
564
|
+
extra || '',
|
|
565
|
+
].join('\n');
|
|
566
|
+
if (issue) {
|
|
567
|
+
try {
|
|
568
|
+
runGh(['issue', 'comment', String(issue), '--repo', repo, '--body', body]);
|
|
569
|
+
} catch (error) {
|
|
570
|
+
console.error(`⚠️ Could not comment on issue #${issue}: ${error.message}`);
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
};
|
|
574
|
+
if (watch.triageNotified !== key) {
|
|
575
|
+
post('Required gate failing on the release PR - fix or accept with a documented exception');
|
|
576
|
+
updateStickyStatus(
|
|
577
|
+
issue,
|
|
578
|
+
`Phase 4 BLOCKED - required check(s) failing on release PR #${watch.prNumber}: ${key}`,
|
|
579
|
+
'Operator action - fix the failure, or accept it with a documented exception record (impact, owner, review date, tracking issue); sdlc-implementer will not proceed to UAT with it unresolved',
|
|
580
|
+
);
|
|
581
|
+
watch.triageNotified = key;
|
|
582
|
+
console.log(`🚨 Required release check(s) failing: ${key}. Fix or accept with a documented exception.`);
|
|
583
|
+
}
|
|
584
|
+
const hours = readGateTimeoutHours();
|
|
585
|
+
const elapsedHours = (now.getTime() - new Date(watch.redSince).getTime()) / 3600000;
|
|
586
|
+
if (elapsedHours >= hours && watch.escalatedFor !== key) {
|
|
587
|
+
post(`Phase 4 BLOCKED ${hours}h - required gate still failing`, `Escalation required: ${key} has been red for ${Math.floor(elapsedHours)}h.`);
|
|
588
|
+
updateStickyStatus(issue, `Phase 4 BLOCKED ${hours}h - required check(s) still failing: ${key}`, 'Escalation required');
|
|
589
|
+
watch.escalatedFor = key;
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
|
|
513
593
|
function performWatchAction(repo, watch, decision) {
|
|
514
594
|
if (!decision.action) return;
|
|
515
595
|
runGh(['run', 'rerun', decision.action.runId, '--repo', repo]);
|
|
@@ -557,6 +637,7 @@ async function watchPullRequest() {
|
|
|
557
637
|
flakyPatterns: flakyPatterns.length > 0 ? flakyPatterns : DEFAULT_FLAKY_PATTERNS,
|
|
558
638
|
integrationBranch: getOption('integration-branch') || DEFAULT_INTEGRATION_BRANCH,
|
|
559
639
|
releaseBranch: getOption('release-branch') || DEFAULT_RELEASE_BRANCH,
|
|
640
|
+
issue: getOption('issue'),
|
|
560
641
|
};
|
|
561
642
|
|
|
562
643
|
let pollsRemaining = once ? 1 : maxPolls;
|
|
@@ -580,6 +661,7 @@ async function watchPullRequest() {
|
|
|
580
661
|
watch.lastPortalStatus = portalStatus || watch.lastPortalStatus || null;
|
|
581
662
|
|
|
582
663
|
const decision = classifyPrStatus(pr || {}, checks, portalStatus, watch, options);
|
|
664
|
+
notifyRequiredGateFailure(repo, watch, pr || {}, checks, options);
|
|
583
665
|
if (decision.kind === 'action') {
|
|
584
666
|
try {
|
|
585
667
|
performWatchAction(repo, watch, decision);
|
|
@@ -273,7 +273,7 @@ git pull --rebase origin develop
|
|
|
273
273
|
git push origin develop
|
|
274
274
|
```
|
|
275
275
|
|
|
276
|
-
Pushing to `develop` triggers the full CI pipeline (TypeScript, SAST, dependency audit, E2E, build). All gate results are automatically uploaded to DevAudit tagged with the release version and `environment=uat`. The develop branch auto-deploys to the UAT environment (
|
|
276
|
+
Pushing to `develop` triggers the full CI pipeline (TypeScript, SAST, dependency audit, E2E, build). All gate results are automatically uploaded to DevAudit tagged with the release version and `environment=uat`. The develop branch auto-deploys to the UAT environment (your hosting platform's staging). UAT will be formally reviewed and approved in DevAudit before a PR to main can be created.
|
|
277
277
|
|
|
278
278
|
### WAIT CHECKPOINT: Confirm CI Green
|
|
279
279
|
|
|
@@ -82,7 +82,7 @@ A release is classified by version shape and release mode. **Most of this doc wa
|
|
|
82
82
|
|
|
83
83
|
### Housekeeping outcomes
|
|
84
84
|
|
|
85
|
-
Normal housekeeping skips the per-requirement evidence and approval path. Run the relevant gates, obtain terminal-green PR review, and merge to `develop`;
|
|
85
|
+
Normal housekeeping skips the per-requirement evidence and approval path. Run the relevant gates, obtain terminal-green PR review, and merge to `develop`; integration housekeeping registers no portal row (#1020), so the run is GitHub CI history only. When a tracked release later absorbs the work, its bundled-change manifest preserves the source title, evidence ownership, stage, and executions.
|
|
86
86
|
|
|
87
87
|
Use standalone housekeeping only when the change cannot reasonably wait for that tracked release. Follow `docs/release-playbooks/housekeeping-release.md`: add the validated `STANDALONE-HOUSEKEEPING-vYYYY.MM.DD.json` declaration, document why promotion is necessary, pass the required checks, and verify production. There is no automatic release-ticket or security-summary stub PR for either housekeeping outcome.
|
|
88
88
|
|
|
@@ -132,6 +132,7 @@ cat > compliance/evidence/REQ-XXX/test-execution-summary.md << 'EOF'
|
|
|
132
132
|
**Date:** [YYYY-MM-DD]
|
|
133
133
|
**Git SHA:** [short SHA]
|
|
134
134
|
**CI Run:** [run ID or "local"]
|
|
135
|
+
**CI as of:** [run id]/[attempt] @ [head sha] <!-- authored pre-PR: use `local @ <sha>`; regenerate after the release PR's CI reaches a terminal state and after every re-run, triage, fix or deferral (devaudit-installer#1016) -->
|
|
135
136
|
|
|
136
137
|
## Test design (devaudit#50)
|
|
137
138
|
|
|
@@ -161,6 +162,22 @@ Records the design-time decisions before listing run results — what was tested
|
|
|
161
162
|
| E2E Tests | PASS | [N]/[N] passed |
|
|
162
163
|
| Build | PASS | Production build succeeded |
|
|
163
164
|
|
|
165
|
+
## E2E failures & triage
|
|
166
|
+
|
|
167
|
+
Required whenever ANY execution failed - local runs and every CI attempt, including a failed attempt that a later re-run superseded (devaudit-installer#1016). Optional ("None - no failed execution") when nothing failed. A gate row may not read PASS while a failure here is unresolved, and "known unrelated flakes" is not a disposition. The validator (`validate-test-summary.sh`) fails when a failure is recorded without a row, and `reconcile-e2e-summary.sh` compares these rows with the CI results for the head SHA.
|
|
168
|
+
|
|
169
|
+
| Spec / check | Source | Classification | Evidence | Disposition | Reference |
|
|
170
|
+
| ------------ | ------ | -------------- | -------- | ----------- | --------- |
|
|
171
|
+
| e2e/critical/foo.spec.ts | CI 123/1 | flake | 5 isolated re-runs pass, code unchanged since REQ-049 | Fix | PR #510 |
|
|
172
|
+
| e2e/critical/bar.spec.ts | local | seed-data gap | seed lacks a transaction for the day | Accepted exception | compliance/evidence/REQ-XXX/accepted-e2e-failure-bar.md |
|
|
173
|
+
| e2e/critical/baz.spec.ts | CI 123/1 | test bug | selector drift | Deferral | https://github.com/owner/repo/issues/512 |
|
|
174
|
+
|
|
175
|
+
Rules:
|
|
176
|
+
- **Source** is `local` or `CI <run id>/<attempt>`.
|
|
177
|
+
- **Classification** is one of `flake`, `test bug`, `app defect`, `seed-data gap` (the `e2e-test-engineer` Phase 6 buckets).
|
|
178
|
+
- **Disposition** is `Fix` (a `fix/` PR and a green re-run on the head SHA), `Accepted exception` (the record from `.claude/skills/sdlc-implementer/references/e2e-accepted-failure.md.template`, recorded in the portal with `report-test-execution.sh resolve --resolution-type accepted_exception --record ...`), or `Deferral` (tracking issue and target release).
|
|
179
|
+
- **Reference** is mandatory: PR/issue (`#N` or URL) for Fix and Deferral; the accepted-failure record path or tracking issue URL for Accepted exception.
|
|
180
|
+
|
|
164
181
|
## Accepted skips
|
|
165
182
|
|
|
166
183
|
Required when E2E gate result is `SKIPPED`. Optional when no accepted skips exist.
|
|
@@ -187,7 +204,7 @@ curl -s -H "Authorization: Bearer ${DEVAUDIT_API_KEY}" \
|
|
|
187
204
|
bash scripts/render-test-executions.sh /tmp/release-journey.json
|
|
188
205
|
```
|
|
189
206
|
|
|
190
|
-
The helper renders a first-class table when `.testExecutions[]` is present. It must not infer executions from legacy artifact grouping.
|
|
207
|
+
The helper renders a first-class table when `.testExecutions[]` is present, preceded by a `<!-- generated-by: render-test-executions.sh ... -->` marker. It must not infer executions from legacy artifact grouping. **Paste the helper's output as-is - never type rows by hand.** It lists every CI execution per attempt (run id and attempt), so a failed attempt 1 that a passing attempt 2 superseded stays visible. A summary carrying a `CI as of:` stamp without the marker fails validation (devaudit-installer#1016); record local runs with their real counts (`3 failed`), never plain `passed` when failures occurred.
|
|
191
208
|
|
|
192
209
|
| Source Release | SDLC Stage | Execution | Kind | Outcome | Workflow / Run | Related Evidence | Incident / Remediation | Date |
|
|
193
210
|
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
|
|
@@ -530,7 +547,7 @@ Create `compliance/pending-releases/RELEASE-TICKET-REQ-XXX.md`:
|
|
|
530
547
|
|
|
531
548
|
## Bundled Changes
|
|
532
549
|
|
|
533
|
-
Required when `compliance/pending-releases/BUNDLED-CHANGES-REQ-XXX.md` exists or when predecessor bare-date releases are being superseded into this REQ.
|
|
550
|
+
Required when `compliance/pending-releases/BUNDLED-CHANGES-REQ-XXX.md` exists or when legacy predecessor bare-date releases (rows created before #1020) are being superseded into this REQ.
|
|
534
551
|
|
|
535
552
|
- **Core tracked release:** [REQ-XXX]
|
|
536
553
|
- **Absorbed predecessor releases:** [versions or `None`]
|
|
@@ -55,7 +55,7 @@ A worked end-to-end example for a zero-risk change (a typo, a dependency bump, a
|
|
|
55
55
|
3. **Commit with a housekeeping type.** `docs:` / `chore:` / `ci:` / `build:` / `test:` / `revert:` are **exempt** from the `[REQ-XXX]` rule — e.g. `git commit -m "docs: fix typo in README"`. A `feat` / `fix` / `refactor` / `perf` subject without a `[REQ-XXX]` or `Ref: REQ-XXX` is **rejected** by commitlint and `validate-commits.sh` — if that fires, you picked the wrong type and the change isn't trivial.
|
|
56
56
|
4. **Run the gates locally — not optional.** `npx tsc --noEmit`, lint, and the test suite must pass before you push. Trivial ≠ unverified.
|
|
57
57
|
5. **Push and open a PR.** CI runs the same quality gates. `compliance-validation.yml` finds no `REQ-XXX` and **skips** artifact validation; no release ticket, no RTM row, no evidence pack is required.
|
|
58
|
-
6. **Merge only after terminal-green CI** and reviewer approval. A housekeeping push
|
|
58
|
+
6. **Merge only after terminal-green CI** and reviewer approval. A housekeeping push registers no portal release (#1020): it is GitHub CI history only, not a UAT/production approval release. It needs no release ticket, security-summary stub, per-REQ evidence pack, or portal sign-off. The next tracked REQ records absorbed work through bundled-change lineage. Use standalone housekeeping only through the explicit declaration and production-verification path in the release playbook.
|
|
59
59
|
|
|
60
60
|
If at any step it stops feeling trivial — it changes behaviour, touches auth/payments/data, or an auditor would ask about it — switch to a tracked change and run `sdlc-implementer`. When unsure, it's not trivial.
|
|
61
61
|
|