Repository navigation
ci: move publish-preview job to CircleCI [IDE-2483] - #462
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
This comment was marked as outdated.
This comment was marked as outdated.
|
PR Description updated to latest commit (4ccb3ab) |
This comment has been minimized.
This comment has been minimized.
4ccb3ab to
8a46930
Compare
f484afa to
51218bd
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
nick-y-snyk
left a comment
There was a problem hiding this comment.
Two things I'd like settled before this merges, plus a couple of smaller ones.
- Approving an old pipeline rolls preview back. Details in the inline comment on the approval gate.
- Preview no longer publishes on its own. Before this PR every push to
mainpublished preview. Now nothing ships until someone clicksApprove preview release, and unapproved holds pile up on older commits. That changes the process for the whole team, so it's worth calling out in the PR description and in Slack when this lands.
Smaller:
ci.ymlnow runs the full Maven build on all three OSes for pushes tomain. It used to skip the build on macOS and Windows there, and on PRs it duplicates the CircleCI test matrix. The only thing it does that CircleCI doesn't is the PMD lint. Follow-up idea: cutci.ymldown to PMD, or move PMD into CircleCI.- Nit:
upload-to-s3.shdefaultsAWS_S3_BUCKET_NAMEtosnyk-test. The job sets it, so nothing breaks, but defaulting tosnyk-assetswould let theenvironment:block go (the script already defaults the region). Two blocks once #468 lands.
This comment has been minimized.
This comment has been minimized.
The approval button was requested by ProdSec, as it changes who the pipeline is run as, which ensure permissions to the context. I had also asked the same Q, but they just wanted a standard way across the org, even though I don't see us having many people outside the CircleCI context push to main and if they do, we can just re-run the failed step to run it as us with access to the context. I have updated the PR description and will post to Slack after.
I think it is better to have it run all OSes on main, we don't require your branch to be up-to-date with main when we merge, so it may find issues. Made apparent in the PR description.
Good follow-on task, not for me to figure out today.
Good call. Have changed. |
nick-y-snyk
left a comment
There was a problem hiding this comment.
Thanks for the replies. Waiting to see whether the preview rollback ever happens is fine, given how quiet main is. One small correction: the guard wouldn't have held back your change, because the newer main HEAD contains your commit, so approving the newest pipeline ships it too. The only cost is waiting for that pipeline's tests.
5b1f53b to
3d64ae3
Compare
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
This comment has been minimized.
This comment has been minimized.
Adds a publish-preview job that assumes the snyk-assets-eclipse-writer IAM role via CircleCI OIDC and uploads the signed p2 repository (built by build-sign) to s3://snyk-assets/eclipse/preview/, replacing the GitHub Actions preview upload that used static AWS keys. The milestone-1 approval gate (previously "Approve signing job") is renamed to "Approve preview release" and now authorizes the whole preview pipeline — sign and publish — as a single approval, rather than gating each step separately. Removes ci.yml's preview-publish machinery (the -P sign build variant, keystore decode step, S3 upload step) in this same commit so there is never a window where both paths publish preview simultaneously. release.yml (stable) is untouched — migrated in a later milestone. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
build-sign (and therefore publish-preview, which depends on it) now also requires security-scans and Scan repository for secrets, not just the approval and test jobs. A preview release must not proceed if either scan hasn't passed. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
3d64ae3 to
323d056
Compare
PR Reviewer Guide 🔍
|

User description
Description
Milestone 2 of migrating snyk-eclipse-plugin's S3 publishing off static AWS keys onto CircleCI OIDC (IDE-2483). Stacked on #460 (milestone 1, the
build-signjob).Adds a
publish-previewCircleCI job that assumes thesnyk-assets-eclipse-writerIAM role via CircleCI OIDC and uploads the signed p2 repository (built bybuild-sign, consumed via a CircleCI workspace rather than rebuilt) tos3://snyk-assets/eclipse/preview/, replacing the GitHub Actions preview publish step that used staticAWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEYsecrets.Removes
ci.yml's preview-publish machinery (the-P signbuild variant, keystore decode step, S3 upload step) in this same PR, so there is never a window where both paths could publish preview simultaneously.release.yml(stable) is untouched — migrated in a later milestone once preview is confirmed working end-to-end.The milestone-1 approval gate (
Approve signing job) is renamed toApprove preview releaseand now authorizes the whole preview pipeline — sign and publish — as a single approval, rather than gating each step separately.build-signadditionally requiressecurity-scansand the repository secrets scan to pass before it can execute, so a preview release can't proceed if either check is failing.ProdSec prescribed the explicit human approval here — it changes which identity the pipeline runs as, which is what grants it access to the restricted CircleCI context holding the signing/publishing credentials.
Verified end-to-end on real CircleCI OIDC runs (where the branch filter was temporarily widened for the testing):
AccessDeniedonAssumeRoleWithWebIdentity) when run from a branch not in the IAM role's trust policy.sts get-caller-identityconfirmed the assumed role ARN, and the resulting published jar's signing certificate (owner/issuer/serial/SHA-256 fingerprint) and full content matched the pre-migration artifact exactly, aside from the expected build-timestamp bump..github/upload-to-s3.shalso had the wrong default bucket name (snyk-test, dead code since the job always overrode it) — fixed tosnyk-assets, which letpublish-preview's explicitenvironment:block (bucket + region, both now redundant with the script's own defaults) be dropped entirely.Out of scope for this PR (tracked as later milestones on IDE-2483): migrating
release.yml's stable publish to CircleCI OIDC, and removing the static AWS key GitHub secrets / deactivating the IAM access key —release.ymlstill needs them until it's migrated too.Checklist
Screenshots / GIFs
N/A — CI config change.
🤖 Generated with Claude Code
PR Stack — Merge Order
flowchart LR main(["main"]) PR1["#460 build-sign\nCircleCI signing"] PR2["#462 publish-preview ← YOU ARE HERE\nCircleCI OIDC publish"] PR3["#463 stable-release scaffold\nworkflow + build-sign-stable"] PR4["#468 publish-stable\nOIDC publish, DO NOT MERGE yet"] PR5["#465 remove legacy workflow\nDO NOT MERGE yet"] main --> PR1 --> PR2 --> PR3 --> PR4 --> PR5 style PR2 fill:#ffd700,color:#000Depends on: #460
PR Type
Enhancement
Description
Migrate preview publishing to CircleCI using OIDC.
Replace static AWS secrets with IAM role assumption.
Enhance
build-signjob dependencies and approval gates.Remove redundant preview publish logic from GitHub Actions.
Diagram Walkthrough
flowchart LR subgraph gh["GitHub Actions"] ci_yml["ci.yml"] end subgraph cci["CircleCI"] config_yml[".circleci/config.yml"] approval_gate["Approve Preview Release Gate"] build_sign_job["Build Sign Job"] publish_preview_job["Publish Preview Job"] oidc_auth["OIDC Authentication"] end AWS_S3["AWS S3 Bucket"] AWS_IAM_Role["snyk-assets-eclipse-writer IAM Role"] ci_yml -- "no longer publishes preview" --> config_yml approval_gate -- "approves entire preview pipeline" --> build_sign_job build_sign_job -- "outputs artifacts" --> publish_preview_job publish_preview_job -- "uses" --> oidc_auth oidc_auth -- "assumes role" --> AWS_IAM_Role AWS_IAM_Role -- "grants access" --> AWS_S3 publish_preview_job -- "uploads to" --> AWS_S3File Walkthrough
config.yml
CircleCI configuration for OIDC preview publishing..circleci/config.yml
aws-cliorb for AWS interactions.publish-previewjob that leverages OIDC for AWSauthentication via a specific IAM role.
build-signjob now persists necessary artifacts to the workspace.Approve preview releaseand enhanced jobdependencies for
build-sign.publish-previewjob to theCICDworkflow.ci.yml
Removed GitHub Actions preview publishing logic..github/workflows/ci.yml
related to preview releases.
GitHub Actions.
Note
Medium Risk
Changes how preview artifacts reach production S3 (new IAM/OIDC path and removed GHA publish), though gated by human approval and role verification.
Overview
Moves Eclipse plugin preview publishing from GitHub Actions to CircleCI, using OIDC to assume
snyk-assets-eclipse-writerinstead of static AWS keys.CircleCI gains a
publish-previewjob that attaches the signed p2 repo frombuild-sign(now persisted to a workspace) and runs.github/upload-to-s3.sh previewafter verifying the assumed-role ARN. The approval gate is renamed to Approve preview release and gates sign + publish together;build-signonmainalso waits on all OS tests plus security and secrets scans.GitHub Actions
ci.ymlno longer decodes the keystore, runs-P sign, or uploads to S3—only unsiged./mvnw clean verifyacross the matrix. The upload script’s default bucket changes fromsnyk-testtosnyk-assets(stable publish viarelease.ymlis unchanged).Reviewed by Cursor Bugbot for commit 323d056. Bugbot is set up for automated code reviews on this repo. Configure here.