Skip to content

Commit 2a7c36d

Browse files
#883 Remove standard PR validation approval gate (#884)
Co-authored-by: svelderrainruiz <noreply@github.com>
1 parent a1b5073 commit 2a7c36d

14 files changed

Lines changed: 61 additions & 116 deletions

.github/workflows/validate.yml

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,7 @@ jobs:
5959
lint:
6060
needs: smoke-gate
6161
if: needs.smoke-gate.outputs.skip != 'true'
62-
environment:
63-
name: validation
6462
runs-on: ubuntu-latest
65-
concurrency:
66-
group: validation-deploy-writer-${{ github.repository }}-validation
67-
cancel-in-progress: false
6863
steps:
6964
- uses: actions/checkout@v5
7065
- name: Check PR mergeability
@@ -381,53 +376,6 @@ jobs:
381376
)
382377
$lines -join "`n" | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Append -Encoding utf8
383378
}
384-
deployment-determinism:
385-
needs: [smoke-gate, lint]
386-
if: needs.smoke-gate.outputs.skip != 'true'
387-
runs-on: ubuntu-latest
388-
concurrency:
389-
group: validation-deploy-writer-${{ github.repository }}-validation
390-
cancel-in-progress: false
391-
steps:
392-
- uses: actions/checkout@v5
393-
- name: Assert validation deployment determinism
394-
shell: bash
395-
env:
396-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
397-
run: |
398-
node tools/npm/run-script.mjs priority:deployment:assert -- \
399-
--repo "${{ github.repository }}" \
400-
--environment validation \
401-
--run-id "${{ github.run_id }}" \
402-
--sha "${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}" \
403-
--report tests/results/_agent/deployments/validation-deployment-determinism.json
404-
- name: Normalize deployment determinism canary event
405-
if: always()
406-
shell: bash
407-
run: |
408-
set -euo pipefail
409-
report_path="tests/results/_agent/deployments/validation-deployment-determinism.json"
410-
if [ ! -f "$report_path" ]; then
411-
echo "::warning::Deployment determinism report missing at $report_path; skipping canary normalization."
412-
exit 0
413-
fi
414-
node tools/npm/run-script.mjs priority:event:ingest -- \
415-
--source-type deployment-state \
416-
--input "$report_path" \
417-
--report tests/results/_agent/canary/validation-deployment-incident-event.json
418-
- name: Upload deployment determinism report
419-
if: always()
420-
uses: actions/upload-artifact@v5
421-
with:
422-
name: validate-deployment-determinism
423-
path: tests/results/_agent/deployments/validation-deployment-determinism.json
424-
- name: Upload deployment determinism canary event report
425-
if: always()
426-
uses: actions/upload-artifact@v5
427-
with:
428-
name: validate-deployment-determinism-event
429-
path: tests/results/_agent/canary/validation-deployment-incident-event.json
430-
if-no-files-found: warn
431379
fixtures:
432380
runs-on: [self-hosted, Windows, X64]
433381
env:

docs/DEVELOPER_GUIDE.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -241,16 +241,17 @@ For Docker/Desktop VI history validation, run fast-loop lanes explicitly:
241241

242242
## Deployment approval gates
243243

244-
- Pull-request validation deployments use the GitHub Actions `validation` environment (see `Validate / lint`).
244+
- Standard pull-request and merge-queue `Validate` runs are machine-gated only and do not target a protected
245+
environment.
245246
- Tag releases use the GitHub Actions `production` environment (see `Release on tag / release`).
247+
- Monthly stability dispatch approvals use the `monthly-stability-release` environment gate.
246248
- Configure required reviewers in GitHub environment settings so deployment acknowledgement is explicit and review
247249
requests can be approved through GitHub web/mobile:
248-
Settings -> Environments -> `validation` / `production` -> Required reviewers.
249-
- Run `node tools/npm/run-script.mjs priority:deployment:gate-policy` to verify both environments enforce
250+
Settings -> Environments -> `production` / `monthly-stability-release` -> Required reviewers.
251+
- Run `node tools/npm/run-script.mjs priority:deployment:gate-policy` to verify the protected promotion environments enforce
250252
required reviewers and admin-bypass policy; report path:
251253
`tests/results/_agent/deployments/environment-gate-policy.json`.
252254
- `PR Auto-approve` and `PR Auto-approve Label` workflows were retired because branch policy requires `0` approvals.
253-
- Monthly stability dispatch approvals continue to use the `monthly-stability-release` environment gate.
254255

255256
### Release metadata
256257

@@ -474,9 +475,9 @@ pwsh -File scripts/CompareVI.ps1 `
474475
fetch helper so they can operate on fork heads safely.
475476
- PR approval is no longer automated; merge queue admission relies on required checks and repository branch policy
476477
(currently `0` required reviewers on queue-managed branches).
477-
- Deployment acknowledgement now flows through GitHub Actions environment reviewers (`validation`, `production`,
478-
`monthly-stability-release`) so approval notifications can be handled through GitHub's built-in deployment review UI
479-
(web/mobile).
478+
- Deployment acknowledgement for protected promotion flows now uses GitHub Actions environment reviewers
479+
(`production`, `monthly-stability-release`) so approval notifications can be handled through GitHub's built-in
480+
deployment review UI (web/mobile).
480481
- Agent reviewer routing/policy is owner-agnostic: set repository variable `REQUIRED_AGENT_REVIEWER` to pin a specific
481482
login; when unset it defaults to `github.repository_owner`.
482483
- Manual `/vi-stage` and `/vi-history` workflows accept an optional `fetch_depth` input (default `20`). Increase it when

docs/DOWNSTREAM_RELEASE_TRAIN_ONBOARDING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ What it evaluates:
4646
- workflow reference to the upstream compare-vi action
4747
- immutable certified ref pinning (stable semver tag or full commit SHA)
4848
- successful workflow consumption run
49-
- validation/production environment presence
49+
- protected production environment presence
5050
- visibility of policy-required branch checks
5151

5252
## Pilot stabilization loop

docs/RELEASE_OPERATIONS_RUNBOOK.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Downstream onboarding runbook: `docs/DOWNSTREAM_RELEASE_TRAIN_ONBOARDING.md`.
1111
## Scope
1212

1313
- Promotion events (`rc -> stable -> lts`) and monthly stability cuts.
14-
- Deployment approval gates (`validation`, `production`, `monthly-stability-release`).
14+
- Deployment approval gates (`production`, `monthly-stability-release`).
1515
- Incident triage, escalation, and rollback communication.
1616

1717
## Roles and ownership
@@ -29,7 +29,6 @@ Configure these roles as required reviewers in GitHub repository environment set
2929

3030
| Environment | Workflow entrypoints | Required reviewer role |
3131
| --- | --- | --- |
32-
| `validation` | PR validation flows (`Validate / lint`, deployment-backed PR checks) | Deployment gate approver |
3332
| `production` | Tag release flow (`Release on tag / release`) | Deployment gate approver |
3433
| `monthly-stability-release` | Scheduled/manual monthly stability cut | Deployment gate approver + incident commander (on exceptions) |
3534

docs/knowledgebase/FEATURE_BRANCH_POLICY.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,9 +260,9 @@ to confirm each workflow includes both triggers.
260260
6. Autonomous merge tooling now requires upstream-owned PR heads. Fork-headed PRs are intentionally ineligible for
261261
`priority:queue:supervisor` and `priority:merge-sync`; mirror the branch to upstream and open the PR from the
262262
upstream-owned branch before queueing.
263-
7. Validate deployment evidence is run-scoped: `priority:deployment:assert` verifies the `validation` environment using
264-
the current workflow run id, fails when the newest deployment is owned by another run, and tolerates terminal
265-
`inactive` statuses only when they follow a successful deployment for the same run.
263+
7. Standard `Validate` PR and merge-queue runs are machine-gated only: they do not use a protected `validation`
264+
deployment or require environment approval. Protected environment approvals are reserved for release/promotion
265+
flows (`production`, `monthly-stability-release`).
266266

267267
### PR Metadata Contract (queue supervisor)
268268
- `Coupling: independent|soft|hard` (default: `independent`)

docs/knowledgebase/VICompare-Refs-Workflow.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ gh workflow run vi-compare-refs.yml `
332332
- The command-driven workflows (pr-vi-staging.yml, pr-vi-history.yml) now reuse the helper so they operate on fork commits safely without bespoke checkout logic.
333333
- Manual `/vi-stage` and `/vi-history` dispatches accept an optional `fetch_depth` input (default `20`) so you can deepen history when needed.
334334
- PRs no longer use auto-approval labels; queue admission depends on required checks and branch policy while deployment
335-
acknowledgement uses environment reviewers (`validation` / `production`).
335+
acknowledgement for protected promotion flows uses environment reviewers (`production` / `monthly-stability-release`).
336336

337337
### Acceptance checklist (bucket coverage)
338338

tests/Workflow.ValidateGuard.Tests.ps1

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,11 @@ Describe 'Validate workflow guard (delta integration)' -Tag 'Unit' {
1515
($wf -match 'Append fixture summary') | Should -BeTrue
1616
($wf -match 'Upload fixture summary artifact') | Should -BeTrue
1717
}
18+
19+
It 'keeps the standard Validate path free of validation environment approvals' {
20+
$wf = Get-Content -LiteralPath (Join-Path $PSScriptRoot '..' '.github' 'workflows' 'validate.yml') -Raw
21+
($wf -match '(?ms)^\s*environment:\s*\r?\n\s*name:\s*validation\b') | Should -BeFalse
22+
($wf -match '(?m)^\s*deployment-determinism:\s*$') | Should -BeFalse
23+
($wf -match 'priority:deployment:assert') | Should -BeFalse
24+
}
1825
}

tools/policy/downstream-onboarding-checklist.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"schema": "priority/downstream-onboarding-policy@v1",
33
"requiredEnvironments": [
4-
"validation",
54
"production"
65
],
76
"requiredBranchChecks": [
@@ -39,10 +38,10 @@
3938
},
4039
{
4140
"id": "protected-environments-configured",
42-
"description": "Validation and production environments exist for human-gated promotions.",
41+
"description": "A protected production environment exists for human-gated promotions.",
4342
"required": false,
4443
"severity": "P2",
45-
"recommendation": "Create validation/production environments and configure required reviewers."
44+
"recommendation": "Create a production environment and configure required reviewers."
4645
},
4746
{
4847
"id": "required-checks-visible",

tools/priority/__tests__/deployment-gate-policy-schema.test.mjs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ test('environment gate policy report validates schema', async () => {
1616
const schema = JSON.parse(await readFile(schemaPath, 'utf8'));
1717

1818
const requestGitHubJsonFn = async (url) => {
19-
if (String(url).endsWith('/environments/validation')) {
19+
if (String(url).endsWith('/environments/production')) {
2020
return {
21-
name: 'validation',
21+
name: 'production',
2222
can_admins_bypass: false,
2323
protection_rules: [
2424
{
@@ -38,7 +38,7 @@ test('environment gate policy report validates schema', async () => {
3838
};
3939
}
4040
return {
41-
name: 'production',
41+
name: 'monthly-stability-release',
4242
can_admins_bypass: false,
4343
protection_rules: [
4444
{
@@ -64,7 +64,7 @@ test('environment gate policy report validates schema', async () => {
6464
args: {
6565
reportPath: 'tests/results/_agent/deployments/environment-gate-policy.json',
6666
repo: 'owner/repo',
67-
environments: ['validation', 'production'],
67+
environments: ['production', 'monthly-stability-release'],
6868
failOnAdminBypass: true,
6969
failOnMissingReviewers: true,
7070
help: false

tools/priority/__tests__/deployment-gate-policy.test.mjs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { evaluateEnvironmentGatePolicy, parseArgs, runDeploymentGatePolicy } fro
66

77
function makeEnvironment(payload = {}) {
88
return {
9-
name: 'validation',
9+
name: 'production',
1010
can_admins_bypass: false,
1111
protection_rules: [
1212
{
@@ -30,7 +30,7 @@ function makeEnvironment(payload = {}) {
3030
test('parseArgs applies defaults and explicit flags', () => {
3131
const defaults = parseArgs(['node', 'check-deployment-gates.mjs']);
3232
assert.equal(defaults.reportPath.endsWith('environment-gate-policy.json'), true);
33-
assert.deepEqual(defaults.environments, ['validation', 'production']);
33+
assert.deepEqual(defaults.environments, ['production', 'monthly-stability-release']);
3434
assert.equal(defaults.failOnAdminBypass, true);
3535
assert.equal(defaults.failOnMissingReviewers, true);
3636

@@ -42,13 +42,13 @@ test('parseArgs applies defaults and explicit flags', () => {
4242
'--repo',
4343
'owner/repo',
4444
'--environments',
45-
'validation',
45+
'production',
4646
'--allow-admin-bypass',
4747
'--allow-no-reviewers'
4848
]);
4949
assert.equal(parsed.reportPath, 'out.json');
5050
assert.equal(parsed.repo, 'owner/repo');
51-
assert.deepEqual(parsed.environments, ['validation']);
51+
assert.deepEqual(parsed.environments, ['production']);
5252
assert.equal(parsed.failOnAdminBypass, false);
5353
assert.equal(parsed.failOnMissingReviewers, false);
5454
});
@@ -75,8 +75,8 @@ test('evaluateEnvironmentGatePolicy fails when reviewer rule missing or admin by
7575

7676
test('runDeploymentGatePolicy emits fail when an environment is missing', async () => {
7777
const requestGitHubJsonFn = async (url) => {
78-
if (String(url).endsWith('/environments/validation')) {
79-
return makeEnvironment({ name: 'validation' });
78+
if (String(url).endsWith('/environments/production')) {
79+
return makeEnvironment({ name: 'production' });
8080
}
8181
const error = new Error('missing');
8282
error.statusCode = 404;
@@ -88,7 +88,7 @@ test('runDeploymentGatePolicy emits fail when an environment is missing', async
8888
args: {
8989
reportPath: 'tests/results/_agent/deployments/environment-gate-policy.json',
9090
repo: 'owner/repo',
91-
environments: ['validation', 'production'],
91+
environments: ['production', 'monthly-stability-release'],
9292
failOnAdminBypass: true,
9393
failOnMissingReviewers: true,
9494
help: false
@@ -100,17 +100,17 @@ test('runDeploymentGatePolicy emits fail when an environment is missing', async
100100

101101
assert.equal(exitCode, 1);
102102
assert.equal(report.summary.status, 'fail');
103-
assert.deepEqual(report.summary.failingEnvironments, ['production']);
103+
assert.deepEqual(report.summary.failingEnvironments, ['monthly-stability-release']);
104104
});
105105

106106
test('runDeploymentGatePolicy passes when all environments are protected', async () => {
107107
const requestGitHubJsonFn = async (url) => {
108-
if (String(url).endsWith('/environments/validation')) {
109-
return makeEnvironment({ name: 'validation' });
110-
}
111108
if (String(url).endsWith('/environments/production')) {
112109
return makeEnvironment({ name: 'production' });
113110
}
111+
if (String(url).endsWith('/environments/monthly-stability-release')) {
112+
return makeEnvironment({ name: 'monthly-stability-release' });
113+
}
114114
throw new Error(`unexpected url: ${url}`);
115115
};
116116

@@ -119,7 +119,7 @@ test('runDeploymentGatePolicy passes when all environments are protected', async
119119
args: {
120120
reportPath: 'tests/results/_agent/deployments/environment-gate-policy.json',
121121
repo: 'owner/repo',
122-
environments: ['validation', 'production'],
122+
environments: ['production', 'monthly-stability-release'],
123123
failOnAdminBypass: true,
124124
failOnMissingReviewers: true,
125125
help: false

0 commit comments

Comments
 (0)