Skip to content

Warn about unencrypted snapshots once per job - #162

Merged
CNSeniorious000 merged 1 commit into
mainfrom
unencrypted-warning-once
Nov 22, 2026
Merged

CNSeniorious000 merged 1 commit into
mainfrom
unencrypted-warning-once

Conversation

@CNSeniorious000

Copy link
Copy Markdown
Member

A run saves the session and the debug events in two separate steps, and snapshot.ts warned on every plaintext write, so encrypt-snapshots: false produced two identical annotations (#160).

save now records UNENCRYPTED_SNAPSHOT_WARNED in $GITHUB_ENV beside the first warning, and later saves of the same job inherit the marker and stay quiet. The warning follows the artifact itself: a save that writes nothing marks nothing, so the only archive that lands still warns, and encrypted saves never do. Each acceptance case in #160 is a regression test in scripts/snapshot.test.ts.

Fixes #160

@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-11-22T20:54:06.503751Z
We couldn’t complete this review. Comment @codex review to try again.
2067ddc 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.

@coderabbitai

coderabbitai Bot commented Nov 22, 2026

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Limits the plaintext snapshot warning to once per job.

  • scripts/snapshot.ts: The save writes the archive first. It warns only when UNENCRYPTED_SNAPSHOT_WARNED is unset. It then sets this marker in GITHUB_ENV.
  • A save that writes nothing sets no marker.
  • scripts/snapshot.test.ts: Adds tests for one warning per job, a warning after an earlier empty save, and no warning for encrypted saves. The test runner now captures stderr and parses $GITHUB_ENV.

Plaintext snapshot saves now write the archive before issuing a warning. The warning appears only when UNENCRYPTED_SNAPSHOT_WARNED is unset. When GITHUB_ENV is available, the save path appends the marker to suppress warnings on later saves in the job. Tests cover successful plaintext saves, saves that write no archive, and encrypted saves.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Merge Risk: Minimal · up to 2067d

The change makes plaintext snapshot warnings appear once per job while still warning whenever a plaintext archive is written. No concrete merge-blocking risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: plaintext snapshot warnings are emitted once per job. It matches the summary, which describes the warning being recorded in GITHUB_ENV to suppress repeat warnings in t…
Description check Passed The description states the problem (duplicate identical annotations from two save steps when encrypt-snapshots is false), the fix (recording UNENCRYPTED_SNAPSHOT_WARNED in $GITHUB_ENV), the edge cases…
Linked Issues check Passed [#160] Objectives: (1) one warning per job when encryption is off, (2) warning kept when any archive is written in plaintext, (3) no warning when encryption is on.

Evidence at head, `scripts/snapshot…
Out of Scope Changes check Passed The PR changes scripts/snapshot.ts (warning gating and marker) and scripts/snapshot.test.ts (regression tests and a jobEnv helper that parses GITHUB_ENV). Each change maps to #160 acceptance c…
Full details: Title check

Explanation

The title names the main change: plaintext snapshot warnings are emitted once per job. It matches the summary, which describes the warning being recorded in GITHUB_ENV to suppress repeat warnings in the same job. The title is concise and specific.

Full details: Description check

Explanation

The description states the problem (duplicate identical annotations from two save steps when encrypt-snapshots is false), the fix (recording UNENCRYPTED_SNAPSHOT_WARNED in $GITHUB_ENV), the edge cases (empty saves, encrypted saves), and the regression tests in scripts/snapshot.test.ts. It matches the changeset closely.

Full details: Linked Issues check

Explanation

[#160] Objectives: (1) one warning per job when encryption is off, (2) warning kept when any archive is written in plaintext, (3) no warning when encryption is on.

Evidence at head, scripts/snapshot.ts, save branch:

  • The plaintext path writes the archive first, then warns only when UNENCRYPTED_SNAPSHOT_WARNED is unset. It then appends UNENCRYPTED_SNAPSHOT_WARNED=1 to GITHUB_ENV. Later steps in the same job inherit the marker, so the second save stays quiet. This covers objective 1.
  • A save that writes nothing exits through the No session files error before the marker is set. Only a written plaintext archive can set it. This covers objective 2.
  • The encrypted branch never reaches the warning. This covers objective 3.

Evidence at head, scripts/snapshot.test.ts: tests cover both-archive single warning, warning after an empty save, and no warning for encrypted saves. The test file was read as a blob. The test runner was not executed.

The diff could not be read, so the changed hunks were checked against the full file at head only. The workflow YAML was not inspected. The fix depends on the save steps sharing GITHUB_ENV, which is standard GitHub Actions behavior.

Full details: Out of Scope Changes check

Explanation

The PR changes scripts/snapshot.ts (warning gating and marker) and scripts/snapshot.test.ts (regression tests and a jobEnv helper that parses GITHUB_ENV). Each change maps to #160 acceptance criteria. The summary reports no changes to exported declarations. The diff itself could not be read, so the full change set was judged from the head file and the test file, not from a diff. No unrelated change was found in those files.

Finishing Touches

Fix failing CI checks

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 693a13f9-4553-4cdc-832d-5d7cb9a1b1f0
Commits

Reviewing files that changed from the base of the PR and between 34fc7a2 and 2067ddc.

Files selected for processing: 2

  • scripts/snapshot.test.ts
  • scripts/snapshot.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@CNSeniorious000
CNSeniorious000 merged commit 52351a5 into main Nov 22, 2026
6 of 7 checks passed
@CNSeniorious000
CNSeniorious000 deleted the unencrypted-warning-once branch November 22, 2026 20:58
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.

emit the unencrypted snapshot warning only once per run

1 participant