Skip to content

fix(cli): turn the shared graph cache off when its secret is too short - #264

Merged
adityankale190895 merged 2 commits into
DiffCI:mainfrom
FredApps:fix/graph-cache-short-secret
Nov 18, 2026
Merged

adityankale190895 merged 2 commits into
DiffCI:mainfrom
FredApps:fix/graph-cache-short-secret

Conversation

@FredApps

Copy link
Copy Markdown
Contributor

Fixes #263

Changed behavior

When DIFFCI_GRAPH_CACHE_SECRET is set but shorter than 16 characters, configureGraphCache no longer creates an unencrypted remote tier. The shared tier is turned off with the note shared graph cache off: DIFFCI_GRAPH_CACHE_SECRET must be at least 16 characters, as --redact-paths without a secret already does. The local tier is unaffected, and the --no-send, endpoint and token checks still come first.

Validation

  • New test in tests/client/shared-graph-cache.test.ts: a five-character secret with an https api-url and a token. On main a remote tier without a secret is created. With this change there is no remote tier and the note is shown, without echoing the secret.
  • node --import tsx --test tests/client/shared-graph-cache.test.ts: 17 passed.
  • tsc --noEmit -p packages/diffci-cli: clean.

A DIFFCI_GRAPH_CACHE_SECRET under 16 characters was ignored and the
remote tier still uploaded graphs, with their file paths, as plaintext.

Fixes DiffCI#263

Signed-off-by: FredApps <[email protected]>
…unset

A workflow's ${{ secrets.DIFFCI_GRAPH_CACHE_SECRET }} is an empty string when the secret is missing,
which turned the shared tier on without encryption. An empty value now turns it off with the same note
as a short one.

Refs DiffCI#263

Signed-off-by: FredApps <[email protected]>
@FredApps

Copy link
Copy Markdown
Contributor Author

Cross-review (FredApps, head a3cdf0b). Not an approval.

Checked

Fixed: a3cdf0b

  • A secret set to an empty string was still treated as unset, so the remote tier came up unencrypted.
  • That is the common CI case: DIFFCI_GRAPH_CACHE_SECRET: ${{ secrets.X }} is empty when the secret is missing.
  • An empty value now turns the shared tier off with the same note. The Action doesn't set this variable, so default users are unaffected.
  • Added a test that fails without the fix.

Open: none.

@FredApps
FredApps marked this pull request as ready for review November 18, 2026 00:56
@adityankale190895
adityankale190895 merged commit b75d36a into DiffCI:main Nov 18, 2026
13 checks passed
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.

Shared graph cache: a too-short DIFFCI_GRAPH_CACHE_SECRET falls back to plaintext uploads

2 participants