Skip to content

OpenAI's Codex Security CLI and TypeScript SDK for finding, validating, and fixing security vulnerabilities. npm: https://www.npmjs.com/package/@openai/codex-security

ci(release): reduce progress noise and preserve manual updates (#1928)

Michael D'Angelo140c88bd4224
diff --git a/.github/actionlint.yaml b/.github/actionlint.yaml
index 971ef0a01..3d67b58db 100644
--- a/.github/actionlint.yaml
+++ b/.github/actionlint.yaml
@@ -1,5 +1,5 @@
paths:
- .github/workflows/{container-release,node-github-release,node-release-cut,node-release,release-progress}.yml:
+ .github/workflows/{container-release,node-github-release,node-release-cut,node-release-pr,node-release,release-progress}.yml:
ignore:
# actionlint 1.7.12 predates GitHub's queue: max support. Keep release queuing.
# https://docs.github.com/en/actions/how-tos/write-workflows/choose-when-workflows-run/control-workflow-concurrency
diff --git a/.github/workflows/node-release-cut.yml b/.github/workflows/node-release-cut.yml
index e689f0b28..1149dfc10 100644
--- a/.github/workflows/node-release-cut.yml
+++ b/.github/workflows/node-release-cut.yml
@@ -10,12 +10,22 @@ on:
permissions:
contents: read
-concurrency:
- group: node-release-cut
- queue: max
-
jobs:
+ progress:
+ if: >-
+ github.repository == 'openai/codex-security' &&
+ github.event_name == 'workflow_run' &&
+ github.event.workflow_run.event == 'push'
+ uses: ./.github/workflows/release-progress.yml
+ permissions:
+ actions: write
+ contents: read
+ pull-requests: write
+
cut:
+ concurrency:
+ group: node-release-cut
+ queue: max
if: >-
github.repository == 'openai/codex-security' &&
(github.event_name == 'workflow_dispatch' ||
diff --git a/.github/workflows/node-release-pr.yml b/.github/workflows/node-release-pr.yml
index 82327e162..9f23b665b 100644
--- a/.github/workflows/node-release-pr.yml
+++ b/.github/workflows/node-release-pr.yml
@@ -15,7 +15,8 @@ permissions:
pull-requests: read
concurrency:
- group: node-release-pr
+ # A newer push can replace a pending push without displacing a manual run.
+ group: node-release-pr-${{ github.event_name == 'push' && 'push' || github.run_id }}
cancel-in-progress: false
jobs:
@@ -26,6 +27,10 @@ jobs:
(github.event_name != 'workflow_dispatch' && vars.RELEASE_PR_ENABLED != 'true'))
name: preview release PR
runs-on: ubuntu-latest
+ # Keep the writer from changing the release branch while a preview reads it.
+ concurrency: &release-pr-queue
+ group: node-release-pr
+ queue: max
env:
RELEASE_PR_DRY_RUN: "true"
@@ -56,6 +61,7 @@ jobs:
(github.event_name != 'workflow_dispatch' && vars.RELEASE_PR_ENABLED == 'true'))
name: maintain release PR
runs-on: ubuntu-latest
+ concurrency: *release-pr-queue
permissions:
contents: write
pull-requests: write
diff --git a/.github/workflows/release-progress.yml b/.github/workflows/release-progress.yml
index 925c0b68f..cfa055089 100644
--- a/.github/workflows/release-progress.yml
+++ b/.github/workflows/release-progress.yml
@@ -1,8 +1,9 @@
name: release-progress
on:
+ workflow_call:
workflow_run:
- workflows: ["node-ci", "node-release", "node-github-release"]
+ workflows: ["node-release", "node-github-release"]
types: [in_progress, completed]
workflow_dispatch:
inputs:
@@ -20,19 +21,14 @@ permissions: {}
concurrency:
# Refreshes read the latest upstream state, so only one pending refresh is needed.
# Observers must not hold that slot while their upstream run awaits approval.
- group: release-progress-${{ inputs.run-id || github.event.workflow_run.id }}-${{ (inputs.watch || (github.event.action == 'in_progress' && github.event.workflow_run.name != 'node-ci')) && github.run_id || 'refresh' }}
+ group: release-progress-${{ inputs.run-id || github.event.workflow_run.id }}-${{ (inputs.watch || github.event.action == 'in_progress') && github.run_id || 'refresh' }}
cancel-in-progress: false
jobs:
identify:
if: >-
github.repository == 'openai/codex-security' &&
- (github.event_name != 'workflow_dispatch' || github.ref == 'refs/heads/main') &&
- (github.event_name != 'workflow_run' ||
- github.event.workflow_run.name != 'node-ci' ||
- (github.event.action == 'completed' &&
- github.event.workflow_run.event == 'push' &&
- github.event.workflow_run.head_branch == 'main'))
+ (github.event_name != 'workflow_dispatch' || github.ref == 'refs/heads/main')
name: identify release
runs-on: ubuntu-latest
continue-on-error: true
@@ -116,9 +112,7 @@ jobs:
if: >-
needs.report.outputs.pull != '' &&
((github.event_name == 'workflow_dispatch' && inputs.watch) ||
- (github.event_name == 'workflow_run' &&
- github.event.action == 'in_progress' &&
- github.event.workflow_run.name != 'node-ci'))
+ (github.event_name == 'workflow_run' && github.event.action == 'in_progress'))
name: observe release milestones
runs-on: ubuntu-latest
continue-on-error: true
diff --git a/RELEASING.md b/RELEASING.md
index b778f8a9a..2a7becbb6 100644
--- a/RELEASING.md
+++ b/RELEASING.md
@@ -92,6 +92,8 @@ Review this policy before enabling automation for `1.x`.
## Rolling release PRs
`node-release-pr` runs after pushes to `main` and can be dispatched manually.
+Newer pushes can replace pending pushes. Manual runs keep their own place.
+Previews and writes share one queue so a preview sees a consistent proposal.
It defaults to a read-only preview. It does not merge, tag, publish, or change
the existing publication gates.
@@ -320,8 +322,9 @@ do not prepare a release by editing or committing files there.
The merged release PR receives one progress comment covering post-merge CI,
release verification, protected npm approval, public-package provenance,
installation checks, Action publication, and container approval and publication.
-It links to the relevant workflow
-runs and updates at workflow boundaries. Each automatic release dispatch starts
+The main CI completion handler requests the first update for a merged release
+PR, including when CI fails. Subsequent updates link to the relevant workflows
+and track each publication stage. Each automatic release dispatch starts
a separate observer using the returned run ID; this does not depend on chained
`workflow_run` events from the built-in token. The observer checks release jobs
every 30 seconds, including while protected approval is pending, and requests a refresh
@@ -336,7 +339,7 @@ and `watch` enabled. GitHub publication starts its own observer after npm succee
The observer and comment writer execute only helpers from protected `main`.
Only the comment writer can update PR comments, and only the observer can request
-a refresh. Both run outside the publication workflows. Verification and
+a refresh. Reporting runs independently of the tag-cut job. Verification and
publication jobs retain their existing permissions. The dispatch jobs use their
existing Actions permission for a best-effort notification bounded to 15 seconds,
within the downstream resolver's 60-second completion wait. Progress-reporting
diff --git a/sdk/typescript/tests-ts/release-pr.test.ts b/sdk/typescript/tests-ts/release-pr.test.ts
index 2ad7f8766..73960a4aa 100644
--- a/sdk/typescript/tests-ts/release-pr.test.ts
+++ b/sdk/typescript/tests-ts/release-pr.test.ts
@@ -842,19 +842,50 @@ describe("GitHub request transport", () => {
});
describe("release workflow controls", () => {
- const { permissions, jobs } = Bun.YAML.parse(workflow) as {
+ const { permissions, jobs, concurrency } = Bun.YAML.parse(workflow) as {
permissions: Record<string, string>;
+ concurrency: { group: string; "cancel-in-progress": boolean };
jobs: Record<
string,
{
if: string;
permissions?: Record<string, string>;
+ concurrency?: { group: string; queue: string };
env: { RELEASE_PR_DRY_RUN: string };
steps: { id?: string; if?: string }[];
}
>;
};
+ test("manual release runs keep their place during a burst of main pushes", () => {
+ const slot = (event_name: string, run_id: number) =>
+ concurrency.group.replace(/\$\{\{(.*?)\}\}/gu, (_, expression) =>
+ String(
+ new Function("github", `return (${expression})`)({
+ event_name,
+ run_id,
+ }),
+ ),
+ );
+ const push = slot("push", 10);
+ expect(slot("push", 11)).toBe(push);
+ const slots = [
+ push,
+ slot("workflow_dispatch", 12),
+ slot("workflow_dispatch", 13),
+ ];
+ expect(new Set(slots).size).toBe(slots.length);
+ expect(concurrency["cancel-in-progress"]).toBe(false);
+ expect(slots).not.toContain(jobs["reconcile"]?.concurrency?.group);
+ expect(jobs["reconcile"]?.concurrency).toEqual({
+ group: "node-release-pr",
+ queue: "max",
+ });
+ expect(jobs["preview"]?.concurrency).toEqual(
+ jobs["reconcile"]?.concurrency,
+ );
+ });
+
test.each([
{ dryRun: "false", clientId: "", createsAppToken: false },
{ dryRun: "false", clientId: "synthetic-app-id", createsAppToken: true },
diff --git a/sdk/typescript/tests-ts/release-progress-workflow.test.ts b/sdk/typescript/tests-ts/release-progress-workflow.test.ts
index 9b6694c4b..e46785c11 100644
--- a/sdk/typescript/tests-ts/release-progress-workflow.test.ts
+++ b/sdk/typescript/tests-ts/release-progress-workflow.test.ts
@@ -7,6 +7,7 @@ const workflow = Bun.YAML.parse(
"utf8",
),
) as {
+ on: { workflow_run: { workflows: string[]; types: string[] } };
concurrency: { group: string };
jobs: {
identify: {
@@ -80,6 +81,61 @@ function identify(
return { output: output.join(""), calls };
}
+test("main CI completions report independently of cutting a release", () => {
+ expect(workflow.on).toHaveProperty("workflow_call");
+ expect(workflow.on.workflow_run).toEqual({
+ workflows: ["node-release", "node-github-release"],
+ types: ["in_progress", "completed"],
+ });
+ const cut = Bun.YAML.parse(
+ readFileSync(
+ new URL(
+ "../../../.github/workflows/node-release-cut.yml",
+ import.meta.url,
+ ),
+ "utf8",
+ ),
+ ) as {
+ on: { workflow_run: unknown };
+ jobs: { progress: { if: string; uses: string }; cut: unknown };
+ };
+ expect(cut.on.workflow_run).toEqual({
+ workflows: ["node-ci"],
+ types: ["completed"],
+ branches: ["main"],
+ });
+ expect(cut.jobs.progress.uses).toBe(
+ "./.github/workflows/release-progress.yml",
+ );
+ expect(cut.jobs.cut).not.toHaveProperty("needs");
+ expect(cut.jobs.progress).not.toHaveProperty("needs");
+ expect(cut.jobs.cut).toHaveProperty("concurrency", {
+ group: "node-release-cut",
+ queue: "max",
+ });
+ const selected = new Function("github", `return (${cut.jobs.progress.if})`);
+ const context = {
+ repository: "openai/codex-security",
+ event_name: "workflow_run",
+ event: { workflow_run: ciRun },
+ };
+ for (const conclusion of ["success", "failure", "cancelled"]) {
+ expect(
+ selected({
+ ...context,
+ event: { workflow_run: { ...ciRun, conclusion } },
+ }),
+ ).toBe(true);
+ }
+ expect(selected({ ...context, event_name: "workflow_dispatch" })).toBe(false);
+ expect(
+ selected({
+ ...context,
+ event: { workflow_run: { ...ciRun, event: "pull_request" } },
+ }),
+ ).toBe(false);
+});
+
test("ordinary CI commits do not reach release checkout or reporting", () => {
for (const pull of [
{ ...releasePull, title: "fix: improve reporting" },