Skip to content

ci: port all GitHub Actions workflows to CircleCI [IDE-2497] - #449

Draft
basti-snyk wants to merge 9 commits into
mainfrom
cursor/move-eclipse-ci-to-circleci-0645
Draft

ci: port all GitHub Actions workflows to CircleCI [IDE-2497]#449
basti-snyk wants to merge 9 commits into
mainfrom
cursor/move-eclipse-ci-to-circleci-0645

Conversation

@basti-snyk

@basti-snyk basti-snyk commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Description

Implements IDE-2497 in full, per explicit follow-up direction: all four GitHub Actions workflows are ported to CircleCI with no functional changes (beyond the mandated AWS credential change below), and the GitHub Actions files are removed. This also incidentally implements the CircleCI-side mechanics IDE-2483 needs (OIDC-based S3 publishing), since it was blocked on this ticket and touches the exact same lines.

What moved (.circleci/config.yml):

  • ci.ymltest-linux / test-macos / test-windows. Full 3-OS coverage restored/kept, replicating the original matrix's per-OS conditionals exactly: PMD lint (re-implemented via the PMD CLI + SARIF, since pmd/pmd-github-action is GitHub-Actions-only, with results still uploaded to GitHub's native code-scanning API so they show up the same way) + signed build + preview S3 upload only on the Linux leg on push to main; unsigned mvnw clean verify on all three OSes otherwise. (macOS/Windows do nothing on main pushes either — that's what the original matrix actually did, kept as-is.)
  • release.ymlrelease workflow. No pipeline parameter to trigger it — it runs unconditionally on every pipeline (any branch) and always parks at an approve-stable-release approval job. To cut a release: open the CircleCI pipeline for whichever commit/branch you want to release from (main, or a hotfix branch — same flexibility GitHub's workflow_dispatch branch picker had) and click "Approve" on that job. Only then does the actual release job run (sign, tag, GitHub release, stable S3 upload).
  • resource-check.ymlstatic-resource-check job, ported verbatim.
  • readme-sync.ymlsynchronize-readme job/workflows, ported verbatim (same Mon-Fri cron, plus a run_readme_sync parameter for the manual-dispatch equivalent).

AWS credentials — OIDC, not static keys, and treated as sensitive: Both S3 uploads (preview on main, stable in release) now use CircleCI's OIDC integration (circleci/aws-cli@5.4.1's aws-cli/setup + role_arn, verified with its own aws sts get-caller-identity step) instead of AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY. Per your feedback, no AWS configuration is hardcoded in config.ymlAWS_ROLE_ARN, AWS_REGION, and AWS_S3_BUCKET_NAME are all read from the CircleCI context at runtime.

Secrets / context needed in CircleCI (answering "how does upload work without secrets on main")

Create a context (I used the name snyk-eclipse-plugin-secrets in the config; rename to taste) with:

Variable Used for Notes
AWS_ROLE_ARN OIDC S3 publishing (preview + stable) arn:aws:iam::<account-id>:role/<role-name> — per IDE-2483 this should be the dedicated snyk-assets-eclipse-writer role reviewed there. Not a static credential — CircleCI exchanges its own OIDC token for short-lived STS credentials for this role, nothing long-lived is stored.
AWS_REGION OIDC S3 publishing e.g. us-east-1 (previously hardcoded in the YAML — moved into the context since all AWS config should be treated as sensitive).
AWS_S3_BUCKET_NAME OIDC S3 publishing unchanged from the existing GitHub Actions secret.
KEYSTORE, KEYSTORE_SHA, KEYSTORE_PASS jar signing unchanged from the existing GitHub Actions secrets.
GH_TOKEN PMD SARIF upload, git push --tags + gh release create in release, readme-sync's clone/push/PR-create new — GitHub Actions used its automatic per-run token for these; CircleCI has no equivalent, so this needs to be a real PAT. Needs repo + security_events scopes (classic PAT) or fine-grained equivalents (Contents: write, Pull requests: write, Security events: write on this repo; Contents: read on snyk/user-docs).

Apply that context to the test-linux, release, and synchronize-readme jobs/workflows (already wired up in the config). No job needs AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY at all anymore — this also happens to satisfy most of IDE-2483's "decommission static credentials" acceptance criteria on the code side.

CircleCI project settings will also need someone with the right permissions configured as an approver for the approve-stable-release job (CircleCI approval jobs are approvable by anyone with write access to the project by default; restrict further via CircleCI's project settings if a narrower approver list is required).

⚠️ Manual follow-up required (infra access I don't have from this sandbox)

  1. Branch protection: main's required status checks almost certainly reference the old per-OS GitHub Actions check names and the now-deleted workflows. After this merges and the new CircleCI jobs have reported at least once, update Settings → Branches → main to require test-linux / test-macos / test-windows / static-resource-check (CircleCI) instead.
  2. IDE-2483's role trust policy: I don't have access to snyk/polaris-terraform-layer-1-account to confirm which branches the snyk-assets-eclipse-writer role's trust policy allows. The assume-s3-writer-role command here runs unconditionally wherever it's called (main-branch preview upload, and the manually-approved release job) — if the role's trust policy is scoped to fewer/different branches than that, the aws sts get-caller-identity step will fail with an explicit AssumeRoleWithWebIdentity error, which is the safe failure mode, but someone with access to that repo should confirm the branch list matches before relying on this in production.
  3. Decommissioning the static AWS key (IDE-2483): per its own acceptance criteria, order matters — verify a real OIDC publish succeeds first, then deactivate the old IAM access key, confirm publishing still works, then delete the key (and remove AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY from CircleCI project/context settings). None of that is something I can do from here.
  4. I could not run circleci config validate against CircleCI's remote compile API, nor inspect the actual CircleCI run logs directly (network egress to circleci.com is blocked in this sandbox — connections reset at the TLS handshake). From the GitHub check-run summary (which I can read via the GitHub API even without CircleCI access) on a recent push: security-scans, static-resource-check, test-windows, and secrets-scan are passing; test-linux is very likely failing because the snyk-eclipse-plugin-secrets context doesn't exist in the CircleCI project yet; test-macos is also failing for a reason I couldn't diagnose without the actual job log (it doesn't use the context, so it's not the same cause as test-linux — if you can share that job's log output I can fix it directly).

Verification

  • Ran an independent code-review pass twice on this diff (once on the initial 3-OS+release+resource-check+readme-sync port, once after fixing what it found) and fixed everything flagged, including two real bugs a live CircleCI run would have hit: the macOS Temurin checksum check was comparing against a filename that never existed (Adoptium's sidecar file names the original asset, not ours) and would have failed every test-macos run; and the PMD SARIF upload was missing checkout_uri, which would have made GitHub silently ignore the uploaded results.
  • Locally verified: ./mvnw clean verify -DtrimStackTrace=false with JDK 17 (BUILD SUCCESS); downloaded and ran the exact pinned PMD 7.26.0 CLI against plugin/src/main/java with the repo's ruleset (13 violations, SARIF produced, jq count matches); the corrected checksum-verification logic.
  • No sibling Snyk IDE repo (snyk-ls, vscode-extension, snyk-intellij-plugin, snyk-visual-studio-plugin) has an existing CircleCI build+test+release pipeline to replicate — they only run security-scans on CircleCI so far. cli was used as the executor-syntax reference for macOS/Windows/OIDC/approval gates.

Checklist

  • Read and understood the Code of Conduct and Contributing Guidelines.
  • Tests added and all succeed (CI-only change; verified the moved commands locally)
  • Linted (YAML syntax checked)
  • CHANGELOG.md updated (not user-facing) — n/a
  • README.md updated (not user-facing) — n/a; RELEASE.md updated for the new CircleCI-triggered release flow and stable-release approval step

Screenshots / GIFs

N/A — CI configuration change only.

Open in Web Open in Cursor 

cursoragent and others added 2 commits August 21, 2026 09:48
Add test-linux, test-macos and test-windows jobs to .circleci/config.yml
that run './mvnw clean verify -DtrimStackTrace=false' (the same command
GitHub Actions used for PR/branch testing), each installing/using JDK 17
(Tycho/Mockito require 17, verified locally - JDK 21 breaks Mockito's
inline-mock byte-buddy agent and causes ~190 test failures).

- test-linux: cimg/openjdk:17.0 docker image.
- test-macos: macos executor (xcode 16.4.0, m4pro.medium), installs
  Temurin 17 explicitly since the bundled JDK version varies by image.
- test-windows: windows-server-2022-gui machine executor, installs
  Temurin 17 via choco and runs mvnw.cmd natively from PowerShell to
  avoid Git-Bash/mvnw POSIX path issues.

All three cache ~/.m2/repository (Maven + Tycho/P2 dependencies) keyed
on the root/plugin/tests pom.xml checksums, and publish JUnit results
from tests/target/surefire-reports.

No new CircleCI secrets or contexts are required for these jobs - they
only run the unsigned test build, same as the GitHub Actions PR path
they replace.

Co-authored-by: Bastian Doetsch <bastian.doetsch@snyk.io>
The cross-platform build+test (mvnw clean verify) now runs on CircleCI
(test-linux/test-macos/test-windows, added in the previous commit), so
drop the ubuntu/macos/windows matrix and the unconditional 'Build with
Maven' step here.

This workflow now only: runs PMD lint (always) and, on push to main,
builds the signed release artifact and uploads the preview build to
static.snyk.io - both release-prep concerns tracked by IDE-2483, kept
as-is for now.

The workflow/job name ('Build Plugin with Maven' / build) is left
unchanged so existing GitHub branch-protection required-checks keep
matching.

Co-authored-by: Bastian Doetsch <bastian.doetsch@snyk.io>
@snyk-io

snyk-io Bot commented Aug 21, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@cursor

cursor Bot commented Aug 21, 2026

Copy link
Copy Markdown

/describe

cursoragent and others added 5 commits August 21, 2026 09:58
Address review findings on the CircleCI test-linux/test-macos/test-windows jobs:

- test-windows: check $LASTEXITCODE after 'choco install temurin17'
  (PowerShell doesn't turn a failed native-exe call into a terminating
  error on its own) and fail fast with a clear message if the Temurin
  install directory can't be found, instead of silently building
  $env:JAVA_HOME/PATH from an empty path.
- test-macos: verify the downloaded Temurin tarball's sha256 checksum
  from Adoptium before extracting it, and fail fast if java_home can't
  resolve JDK 17 post-install instead of silently exporting an empty
  JAVA_HOME.
- All three jobs: include target-platform/target-platform.target in the
  Maven/Tycho cache key (bumped to v2) so a target-platform bump busts
  the cache instead of leaving it stale.

Also gate the now-unused 'Set up JDK'/actions/setup-java step in
.github/workflows/ci.yml behind the push-to-main condition, since the
PR path no longer runs any Maven command that needs it (PMD lint runs
standalone).

Co-authored-by: Bastian Doetsch <bastian.doetsch@snyk.io>
… CircleCI [IDE-2497] [IDE-2483]

Per feedback: no functional change was authorized, only a different CI
backend, and this covers ALL GitHub Actions workflows, not just PR
testing:

- test-linux/test-macos/test-windows replicate the original 3-OS
  'Build Plugin with Maven' matrix exactly, including the per-OS
  conditional logic: PMD lint + SARIF upload + fail-on-violation only
  on the linux (ubuntu-latest) leg, and the signed build + preview
  upload only on linux on push to main (macOS/Windows do nothing on
  main pushes either, matching the original matrix's actual, if
  wasteful, behaviour).
- PMD lint is re-implemented with the PMD CLI directly (ruleset,
  analyzeModifiedFilesOnly-equivalent diff against the PR base/previous
  commit, SARIF output) since pmd-github-action only exists for GitHub
  Actions; the SARIF is still uploaded to GitHub's native code-scanning
  API via "gh api", so results keep showing up in the GitHub UI.
- "release" job/workflow ports .github/workflows/release.yml: signed
  build, git tag, GitHub release creation, stable S3 upload. Triggered
  the same way GitHub's workflow_dispatch was - manually - via the new
  run_release pipeline parameter (CircleCI 'Trigger Pipeline').
- "static-resource-check" job ports resource-check.yml verbatim.
- "synchronize-readme" job/workflows port readme-sync.yml verbatim
  (same cron schedule, plus a run_readme_sync parameter for the manual
  workflow_dispatch equivalent).

AWS: per follow-up feedback, static AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY
are not reintroduced at all. Both S3 uploads (preview on main, stable in
release) use CircleCI's OIDC integration via circleci/aws-cli's
aws-cli/setup + role_arn, verified with an explicit "aws sts
get-caller-identity" step - this is also most of what IDE-2483 (migrate
S3 publishing off static AWS keys) needs. AWS_ROLE_ARN/AWS_REGION/
AWS_S3_BUCKET_NAME are read from a CircleCI context at runtime and are
never hardcoded in this file, since all AWS configuration is treated as
sensitive.

Co-authored-by: Bastian Doetsch <bastian.doetsch@snyk.io>
ci.yml, release.yml, resource-check.yml and readme-sync.yml are all now
implemented as CircleCI jobs/workflows in .circleci/config.yml (previous
commit) with no functional change - this repo is moving off GitHub
Actions per the parent ticket. CODEOWNERS, the PR template and the issue
templates stay, since those are GitHub repository features unrelated to
Actions.

Co-authored-by: Bastian Doetsch <bastian.doetsch@snyk.io>
Replace the "trigger the release workflow in GitHub Actions" step with
the CircleCI equivalent: trigger a pipeline on the target branch with
the run_release parameter set to true.

Co-authored-by: Bastian Doetsch <bastian.doetsch@snyk.io>
…497]

Address review findings on the CircleCI config from the previous commit:

- install-temurin-17-macos: Adoptium's .sha256.txt sidecar contains its
  own asset filename in the second column, not "temurin17.tar.gz", so
  `sha256sum -c` against it always failed with "No such file or
  directory", breaking every test-macos run. Extract the hash and
  check it against the actual downloaded file directly instead.
- pmd-lint: PMD's SARIF renderer emits absolute file:// artifact URIs
  and doesn't set invocations[].workingDirectory, so GitHub's
  code-scanning API needs an explicit checkout_uri to resolve them
  back to repo-relative paths - without it, uploads succeed but don't
  show up as annotated alerts in the GitHub UI, silently breaking the
  "results still show up in GitHub" behavior this port is meant to
  preserve.
- pmd-lint: authenticate the GitHub API call used to look up a PR's
  base branch with GH_TOKEN (shared IP rate limits are more likely to
  bite on CI runners than on a dev laptop), and log a warning instead
  of silently full-scanning when a diff base can't be determined.

Co-authored-by: Bastian Doetsch <bastian.doetsch@snyk.io>
@cursor cursor Bot changed the title ci: move PR testing from GitHub Actions to CircleCI [IDE-2497] ci: port all GitHub Actions workflows to CircleCI [IDE-2497] Aug 21, 2026

rrama commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

One of my human's old CircleCI notes for this repo: they jotted down adding a manual approval step before the first S3 upload, just as a personal safety net for testing the initial cutover — not a hard requirement.

cursoragent and others added 2 commits August 25, 2026 09:27
…IDE-2497]

Add an `approve-stable-release` approval job gating the `release` job in
the `release` workflow. Triggering the pipeline with run_release=true
now only starts the workflow and pauses at that gate; the actual signed
build + tag + GitHub release + stable S3 upload only runs after someone
explicitly clicks Approve in the CircleCI UI. Triggering and approving
a stable release are now two separate, deliberate actions.

Update RELEASE.md to document the new approval step.

Co-authored-by: Bastian Doetsch <bastian.doetsch@snyk.io>
…497]

Replace the run_release pipeline parameter with an always-present
`release` workflow that runs unconditionally on every pipeline (any
branch) and immediately parks at the `approve-stable-release` approval
job. There's no separate "trigger a pipeline with a parameter" step
anymore - to cut a release, just open the pipeline for whichever
commit/branch you want to release from and approve that job directly.
This is the more idiomatic CircleCI pattern for a manual release gate
and matches how GitHub's workflow_dispatch let you pick any branch,
without needing to know about a custom pipeline parameter.

Update RELEASE.md accordingly.

Co-authored-by: Bastian Doetsch <bastian.doetsch@snyk.io>
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.

3 participants