Skip to content

Add ci deploy --annotations to surface deploy check outcomes on the run summary - #136

Open
tranhoangtu-it wants to merge 1 commit into
prooflinedev:mainfrom
tranhoangtu-it:ci-deploy-annotations
Open

tranhoangtu-it wants to merge 1 commit into
prooflinedev:mainfrom
tranhoangtu-it:ci-deploy-annotations

Conversation

@tranhoangtu-it

Copy link
Copy Markdown

Who this helps

Teams running proofline ci deploy in GitHub Actions who want regressed or unestablished deploy checks surfaced directly on the workflow run summary on every GitHub plan, without digging through job logs or passing --json.

- run: proofline ci deploy --annotations --until 1h

What changed

  • src/annotations.rs exposes Level, escape_data, escape_property, and write_job (pub(crate)), sharing write_command with ci review --annotations so workflow-command formatting and escaping live in one place.
  • src/deploy.rs adds --annotations to CiDeployArgs, threads a testable stderr Write sink into wait_with_output, shares raw vs. terminal-folded helpers (deploy_label/label, deploy_rollback/rollback_line, checkpoints_in_scope, deploy_gaps, regressed_checkpoints), and emits:
    • nothing on Verdict::Done (never claiming a deploy is safe) or on transport/auth/usage errors;
    • ::error per regressed deploy on Verdict::Regressed (including failures and regressions recorded after --until), naming the deploy label, regressed checkpoints, state, rollback/rolled_back details, gaps, and deploy_url;
    • ::warning per affected deploy on Verdict::NotComplete (Waiting, Superseded, Unverified, Inactive, Ended, UnknownState, NotEstablished), or one job-level ::warning when zero matching deploys were recorded, an unsuccessful workflow_run concluded with no deploy, or no verification read answered.
  • tests/http.rs adds an end-to-end mock-server integration test for proofline ci deploy --annotations.
  • README.md documents --annotations right beside the ci deploy documentation.

Decisions

  • Evidence-faithful severities: Verdict::Done (HEALTHY, no gaps) emits zero annotations; only regressions emit ::error, and unestablished results emit ::warning.
  • Single-pass escaping: Untrusted server and GitHub strings (github_environment, deployment_task, aws_provider, aws_run_id, state, gaps, deploy_url, rollback pages, repository name, conclusion) are assembled unescaped and passed once through annotations::write_job, which runs text::terminal_safe and @actions/core-style escaping (%25, %0A, and %3A/%2C in properties) so a payload cannot forge a second workflow command or inject ANSI/bidi sequences.
  • Opt-in on stderr: Matches ci review --annotations (src/lib.rs) so existing CI logs do not change unless requested and --json output on stdout stays a single valid JSON document.

Verification

  • Unit tests in src/annotations.rs (write_job_escapes_title_and_message_onto_one_line) and src/deploy.rs (annotations_report_regressions_and_unestablished_checks_as_escaped_commands) covering opt-in behavior, Verdict::Done, Verdict::Regressed (including later regressions, FAILED, AWS runs, rollbacks, gaps, and --json), all Verdict::NotComplete readings + zero-deploy cases, 401/403/503 error paths, and injection payloads.
  • Integration test in tests/http.rs (ci_deploy_annotations_report_regressions_and_unestablished_deploys_as_escaped_commands) running the compiled proofline binary against an axum mock server.
  • Local CI checks passed on 1.100.0-aarch64-apple-darwin (from rust-toolchain.toml):

Add an opt-in --annotations flag to `proofline ci deploy` that writes `::error` and `::warning` workflow commands on stderr for regressed and unestablished deploy checks while leaving stdout JSON untouched.

Shared escaping and job-level command formatting live in `src/annotations.rs`, so values from server responses and GitHub metadata are sanitized through `text::terminal_safe` and escaped like `@actions/core` without duplication. Clean `HEALTHY` runs with no gaps and transport/auth failures emit no deploy annotations.
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-12-01T15:11:12.209598Z
We couldn’t complete this review. Comment @codex review to try again.
630305a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant