BUILD-11417 Extract symlink keeper into its own sub-action#73
Conversation
Agentic Analysis: Early ResultsAgentic Analysis and Context Augmentation are available on your project. Here are some issues that could have been prevented. Follow the links to learn how to put them into action. 2 issue(s) found across 2 file(s):
Analyzed by SonarQube Agentic Analysis in 4.4 s |
5e0718f to
38e1e0b
Compare
Code Review ✅ Approved 1 resolved / 1 findingsExtracts symlink keeper into a dedicated sub-action and enables metrics across all backends via CI_METRICS_ENABLED. No issues found. ✅ 1 resolved✅ Bug: credential-guard post-if: success() prevents credential restore on failure
OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |
Move `ensureCacheMetricsSymlink` out of credential-guard-post into a new
`symlink-keeper/` sub-action and wire it as the LAST main step of the
top-level composite so its post fires FIRST in the LIFO post phase,
ahead of cache-metrics-post. That ordering is what makes the
`.actions/cache-metrics` workspace symlink survive a nested
actions/checkout sequence (clean → reset --hard → checkout --force)
between cache-metrics-main and cache-metrics-post.
Side effect of the split: credential-guard no longer carries the
metrics-symlink concern, so the `cache-backend == 's3'` gate previously
added to `cache-metrics-prep` is dropped. Metrics now opt in via
CI_METRICS_ENABLED on both backends.
`@symlink-keeper-1.0.0` is a branch ref pinned to this commit's SHA;
after merge to master it is replaced by a tag of the same name on the
same commit.
Files:
- symlink-keeper/{action.yml,dist/main/index.js,dist/post/index.js}: new
- src/symlink-keeper-{main,post}.ts: new (post is a verbatim port of the
keeper logic previously embedded in credential-guard-post)
- __tests__/symlink-keeper.test.ts: 6 tests (2 main, 4 post)
- src/credential-guard-{main,post}.ts, credential-guard/action.yml:
reverted to pre-keeper baseline
- credential-guard/dist/{main,post}/index.js: rebuilt
- __tests__/credential-guard.test.ts: 6 keeper-related tests dropped
- package.json: build:keeper-main / build:keeper-post added to `build`
- .gitignore, .pre-commit-config.yaml: add symlink-keeper/dist patterns
- action.yml: drop the s3 gate from cache-metrics-prep; remove the
cache-metrics-action-path parameter from the credential-guard step;
add the symlink-keeper step at the end of the main phase
38e1e0b to
6a89228
Compare
|
|
matemoln
left a comment
There was a problem hiding this comment.
Thanks for creating the improvement ticket! Approving this with BUILD-11445 in mind.



Summary
ensureCacheMetricsSymlinkout ofcredential-guard-postinto a newsymlink-keeper/sub-action;credential-setup/credential-guardrevert to their pre-keeper baseline..actions/cache-metricsbeforecache-metrics-postresolvesuses: ./.actions/cache-metrics.cache-backend == 's3'gate fromcache-metrics-prep— metrics can now opt-in viaCI_METRICS_ENABLEDon both backends.Ref strategy
action.ymlreferencesSonarSource/gh-action_cache/symlink-keeper@symlink-keeper-1.0.0. The branchsymlink-keeper-1.0.0is pinned at this PR's commit so CI on the PR can resolve the ref. After merge to master, the branch is replaced by a tag of the same name on the same commit (independent of the mainv1.x.ycadence).Test plan
npm test— all 54 unit tests pass (6 keeper tests now under__tests__/symlink-keeper.test.ts; credential-guard tests slimmed to credential-restore only).npm run build— produces the newsymlink-keeper/dist/{main,post}/index.jsbundles and the rebuiltcredential-guard/dist/{main,post}/index.js.pre-commit run --all-files— clean.test-s3-cache-survives-git-clean-with-metrics(.github/workflows/test-action.yml) green on this PR — provessymlink-keeper-postrecreates.actions/cache-metricsbeforecache-metrics-postfires after a nestedactions/checkout.test-s3-cache-with-credential-interference,test-s3-cache-windows,test-s3-cache-multiple-invocations,test-s3-cache-with-preset-aws-config,test-s3-cache-survives-git-clean— proves the credential-guard revert didn't regress credential restore.Links