Skip to content

emit the unencrypted snapshot warning only once per run #160

Closed

Description

@CNSeniorious000

When encrypt-snapshots is false, a normal review run shows two identical check-run warnings:

Snapshots are not encrypted; anyone who can read this repository can download them.

This is not GitHub duplicating one annotation. The action calls snapshot.sh save twice:

  • Archive codex session saves CODEX_HOME.
  • Archive Codex events saves codex.jsonl.

scripts/snapshot.ts emits the same ::warning:: for every unencrypted save, so the run produces two annotations at different log locations. It reads like a duplicate error and adds avoidable noise to the check run.

Proposal

  • Warn at most once per job when snapshots are unencrypted.
  • Keep the warning whenever any artifact is written in plaintext; do not silently weaken the security signal.
  • For example, set a per-run marker in $GITHUB_ENV after the first warning, or pass a quiet flag to the debug-events save.

Acceptance

  • With encrypt-snapshots: false, a run that saves both the session and debug artifacts shows one warning.
  • The warning still appears when only one archive is written.
  • With encryption enabled, the unencrypted-snapshot warning never appears.

Source:

https://github.com/promplate/code-review/blob/b5b38f2143c405cfe0526a2735cc9582240abc10/.github/workflows/review.yml#L569-L578

https://github.com/promplate/code-review/blob/b5b38f2143c405cfe0526a2735cc9582240abc10/.github/workflows/review.yml#L645-L657

if (!key) {
console.log("::warning::Snapshots are not encrypted; anyone who can read this repository can download them.");
await Bun.write(archive, Buffer.concat([plainMark, plain]));
} else {
const iv = crypto.getRandomValues(new Uint8Array(12));
const sealed = await crypto.subtle.encrypt({ name: "AES-GCM", iv }, key, plain);
await Bun.write(archive, Buffer.concat([encryptedMark, iv, new Uint8Array(sealed)]));
}
console.log(`Saved ${present.join(", ")} into ${archive}`);
} else if (command === "load") {
// An artifact saved before snapshots became one archive already unpacked its files.
if (!(await Bun.file(archive).exists())) {
// Restoring nothing would silently start a fresh session that looks like a continuation.

Activity

  1. coderabbitai commented on Nov 22, 2026

    @coderabbitai
    🔗 Related PRs

    #129 - Encrypt session snapshots with repository-scoped keys [merged]


    📝 Issue Planner

    Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.

    • Create Plan

    🧪 Issue enrichment is currently in open beta.

    You can configure auto-planning by selecting labels in the issue_enrichment configuration.

    To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

    issue_enrichment:
      auto_enrich:
        enabled: false

    💬 Have feedback or questions? Drop into our discord!

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions