From e1e854663e997c9d4792185d7797737b891d1566 Mon Sep 17 00:00:00 2001 From: Jens Meisner Date: Thu, 19 Nov 2026 09:44:54 +0100 Subject: [PATCH 1/5] docs: Plan the workspace SBOM upload to Dependency-Track (CKE-140) Add a plan for uploading a CycloneDX SBOM of the whole workspace to Dependency-Track for main and future maintenance/ branches, as component-foundation does. The setup of component-foundation can't be reused here: this repository is public, so it can't call the private reusable-sbom-upload.yml of CoreMedia/github-actions or safely use the self-hosted runner, and Dependency-Track is only reachable from the internal network. As a temporary solution, the QA gate generates the SBOM before the push and stores it as the artifact sbom-. A nightly job on the team Jenkins venus-ci-01, defined in the venus-ci-01 branch of CoreMedia/ci-jobs, uploads the artifact of each branch head as ckeditor-plugins-workspace below the parent project Ckeditor Plugins. The plan tracks decisions, open questions, prerequisites and rollout steps as checkboxes. It is removed before the branch is integrated. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- docs-internal/plans/sbom-upload/plan.md | 268 ++++++++++++++++++++++++ 1 file changed, 268 insertions(+) create mode 100644 docs-internal/plans/sbom-upload/plan.md diff --git a/docs-internal/plans/sbom-upload/plan.md b/docs-internal/plans/sbom-upload/plan.md new file mode 100644 index 0000000000..e0404d0a08 --- /dev/null +++ b/docs-internal/plans/sbom-upload/plan.md @@ -0,0 +1,268 @@ +# Plan: Upload the Workspace SBOM to Dependency-Track (CKE-140) + +Goal: upload a CycloneDX SBOM of the whole ckeditor-plugins workspace to +Dependency-Track, as component-foundation already does. Uploads cover `main` +and all future `maintenance/` branches. The legacy branches +`maintenance/23.0`, `24.0`, `25.0` and the test branch `maintenance/28` are +out of scope. + +This is a temporary solution: the [QA gate][qa-gate] generates the SBOM as an +artifact, and a nightly job on the team's Jenkins `venus-ci-01` uploads it. +It does not use the shared `reusable-sbom-upload.yml` of +`CoreMedia/github-actions`. + +Mark each item as done (`[x]`) once it is complete and verified. + +## Background + +component-foundation generates the SBOM with `pnpm sbom` in its +[QA gate][cf-qa-gate] and uploads it through the shared reusable workflow on +`coremedia-selfhosted-runner-k8s`. ckeditor-plugins cannot do either part of +the upload from GitHub: + +- ckeditor-plugins is **public**, and GitHub lets a public repository call only + reusable workflows from public repositories. `CoreMedia/github-actions` is + private. +- A self-hosted runner in a public repository is not safe: a pull request from + a fork can change a workflow so it runs on that runner. +- Dependency-Track is **not reachable from GitHub-hosted runners**. Checked + 2026-11-18: `apiserver.dependency-track.coremedia.io` doesn't exist in public + DNS (NXDOMAIN at Cloudflare and Google). On the corporate network it resolves + to `10.100.4.217` and `10.100.7.125` (private Route 53 zone, load balancer + `moebius-internal-services`, see `aws/prod/README.md` in + `CoreMedia/dependency-track-infra`). + +Jenkins runs inside the network and reaches both GitHub and Dependency-Track. +It already uploads SBOMs: `blueprint-sbom-upload.Jenkinsfile` in +`CoreMedia/cms` uses `dependencyTrackPublisher` with the credential +`dependency-track-prod`. GitHub cannot trigger the internal Jenkins, so the job +runs on a schedule. + +The team's Jenkins is `https://jenkins.venus-ci-01.coremedia.vm`. Its jobs are +Job DSL in the branch `venus-ci-01` of `CoreMedia/ci-jobs` (`ci/pipelines/`, +`ci/jenkinsfiles/`); see `ci/pipelines/perso_testsystem.groovy` there for a +nightly job. Nobody creates jobs in the Jenkins UI. The job **Seed** (defined +in `jenkins/seed-files/` of `CoreMedia/devops-tools`) creates them: + +- It runs every evening at 21:00 (`0 21 * * *`) and can be started by hand. +- It checks out the `ci-jobs` branch named after the host (`venus-ci-01`, or the + branch in its parameter `CI_JOBS_BRANCH`) and `ci-configuration` (`main`). +- It runs Job DSL over `ci/pipelines/*.groovy` and `ci/defaultPipelines.json`: + new definitions create jobs, changed ones update them, and jobs whose + definition is gone are **deleted** (`removedJobAction: 'DELETE'`). +- `readFileFromWorkspace` copies the Jenkinsfile into the job's configuration, + so a Jenkinsfile change takes effect only after the next Seed run. +- Changes made in the Jenkins UI are overwritten by the next Seed run. + +`pnpm sbom` works on this workspace: a local test produced CycloneDX 1.6 with +the root component `@coremedia/ckeditor5`, 925 components, 890 of them with +licenses. + +## Decisions + +- [x] **Mechanism:** the QA gate generates the SBOM before the push and stores + it as an artifact. A nightly Jenkins job downloads the artifact of each + branch head through the GitHub API, checks it, and uploads it. +- [x] **No Dependency-Track secrets in ckeditor-plugins:** only Jenkins talks to + Dependency-Track. +- [x] **Job location:** Job DSL and Jenkinsfile both in the branch + `venus-ci-01` of `CoreMedia/ci-jobs` (internal), next to the team's other + jobs. The job runs on `venus-ci-01`. +- [x] **Schedule:** nightly. +- [x] **Artifact name:** `sbom-`, where the SHA is the commit the + QA gate pushes. Jenkins finds the artifact of a branch head by name, without + mapping pull-request runs to pushed commits. +- [x] **Dependency-Track project:** `ckeditor-plugins-workspace`, below the + parent project `Ckeditor Plugins` (parent version `-`). +- [x] **Project version:** `main` for `main`, `maintenance-` for + `maintenance/` (e.g. `maintenance-30`). +- [x] **Project tags:** + `workspace,team-venus,,snapshot,internal,commit-`. + The version comes from `packages/ckeditor5-common/package.json`; all + published packages share one version. +- [x] **Unchanged heads:** Jenkins skips a branch whose Dependency-Track project + already has the tag `commit-` of the current head. + +## Open Questions + +- [ ] Check whether the parent project `Ckeditor Plugins` already exists in + Dependency-Track, and look up how `Component Foundation` stores its version + (`-` or none), so the parent version matches. +- [ ] Decide whether a fresh `maintenance/` branch needs an SBOM before + its first merged pull request (see D). + +## A. Prerequisites + +- [ ] Create the parent project `Ckeditor Plugins` in Dependency-Track if it + doesn't exist, or let the Jenkins job create it as the Blueprint job does + (lookup, then `PUT /api/v1/project`). +- [ ] Check your rights on `venus-ci-01`: log in, open `/whoAmI/` for your + user and groups, and check that you may build the job **Seed** (**Build with + Parameters**). Without that right, the job is still created by the 21:00 + Seed run, but you can't test a feature branch (see C). +- [ ] Check on `venus-ci-01` under `/credentials/` whether these credentials + exist: + - [ ] a Dependency-Track API key (e.g. `dependency-track-prod`, which the + Blueprint job uses on the cms Jenkins); + - [ ] a GitHub token (e.g. `github`) that can read the Actions artifacts of + `CoreMedia/ckeditor-plugins`. +- [ ] Request missing credentials by email to support@coremedia.com, using the + template in the `CoreMedia/ci-configuration` README (secret ID + `venus-ci-01/`, or `jenkins-global/` if it + already exists for other instances). +- [ ] Make sure the Dependency-Track API key has `BOM_UPLOAD`, + `PROJECT_CREATION_UPLOAD` and `VIEW_PORTFOLIO` (for the tag lookup). + +## B. Changes in ckeditor-plugins (Branch `venus/CKE-140-SBOM-upload`) + +- [ ] In the `integrate` job of the [QA gate][qa-gate], after the merge and + before the push, take the commit to be pushed: `git rev-parse HEAD`. +- [ ] After "Checks" and before the push, generate the SBOM. A failure blocks + the merge. + + ```bash + pnpm sbom \ + --sbom-format cyclonedx \ + --sbom-spec-version 1.6 \ + --sbom-type application \ + --out build/sbom/ckeditor-plugins-workspace.cdx.json + ``` + +- [ ] Write `build/sbom/metadata.json` with: + - [ ] `branch`: the base branch (`main` or `maintenance/`); + - [ ] `commit`: the SHA from the first step; + - [ ] `version`: the version from `packages/ckeditor5-common/package.json`. +- [ ] Upload `build/sbom` as the artifact `sbom-` with + `if-no-files-found: error` and `retention-days: 90` (the maximum for public + repositories). `build/` is already git-ignored. +- [ ] Document the SBOM artifact, the nightly Jenkins upload and where the job + lives in [DEVELOPMENT.md][development], including that this is a temporary + solution outside the shared workflow. +- [ ] Add an empty changeset (`pnpm changeset add --empty`). The checks + require a new changeset in every pull request, and changes to `.github/` and + docs don't touch any package. +- [ ] Remove this plan before the branch is integrated. + +## C. Jenkins Job in `CoreMedia/ci-jobs` (Branch `venus-ci-01`) + +- [ ] Add `ci/pipelines/ckeditor_plugins_sbom.groovy` with a folder (e.g. + `CKEditor-Plugins`) and a `pipelineJob` (e.g. `nightly-sbom-upload`) with: + - [ ] a nightly trigger, e.g. `cron('H 2 * * *')`; + - [ ] the parameters `BRANCH` (default: all release branches) and `DRY_RUN` + (only log what would be uploaded); + - [ ] the Jenkinsfile through + `readFileFromWorkspace('ci/jenkinsfiles/ckeditorPluginsSbomUpload.Jenkinsfile')` + with `sandbox()`, as the perso jobs do. +- [ ] Add `ci/jenkinsfiles/ckeditorPluginsSbomUpload.Jenkinsfile`. +- [ ] In the Jenkinsfile, list the branches of `CoreMedia/ckeditor-plugins` + through the GitHub API and keep those matching + `^(main|maintenance/[1-9][0-9]*)$`. This leaves out `maintenance/23.0`–`25.0`. +- [ ] For each branch: + - [ ] read the head SHA; + - [ ] derive the project version (`main` or `maintenance-`); + - [ ] skip the branch if the Dependency-Track project already has the tag + `commit-`; + - [ ] look up the artifact with + `GET /repos/CoreMedia/ckeditor-plugins/actions/artifacts?name=sbom-`. + If none exists or all expired, log a warning and continue with the next + branch; + - [ ] keep only artifacts whose run is `.github/workflows/qa-gate.yml` of + `CoreMedia/ckeditor-plugins` and whose step "Push to base branch" (job + "Integrate and Merge") succeeded. Don't require the whole job to succeed: + "Deploy Storybook" runs after the push and may fail although the commit was + pushed; + - [ ] if several artifacts remain (a retried QA gate after a fast-forward + merge pushes the same SHA again), take the newest unexpired one; + - [ ] download and unzip the artifact; + - [ ] check that `metadata.json` names this branch and this SHA, and that the + SBOM is CycloneDX 1.6 with the root component + `pkg:npm/%40coremedia/ckeditor5@…`; + - [ ] upload it with `dependencyTrackPublisher`, as the Blueprint job does: + - [ ] `projectName: 'ckeditor-plugins-workspace'` + - [ ] `projectVersion`: `main` or `maintenance-` + - [ ] `artifact`: `ckeditor-plugins-workspace.cdx.json` + - [ ] `autoCreateProjects: true` + - [ ] `projectProperties`: `parentName: 'Ckeditor Plugins'`, + `parentVersion: '-'`, tags + `workspace,team-venus,,snapshot,internal,commit-` +- [ ] Fail the build if any branch failed, after all branches were processed, + so one broken branch doesn't block the others. +- [ ] Clean up the workspace in `post { always { cmCleanup() } }`. +- [ ] Test the job before the merge: + - [ ] rebase the feature branch onto the current `venus-ci-01`, because Seed + deletes every job that is missing from the branch it reads; + - [ ] start Seed by hand with `CI_JOBS_BRANCH=`; + - [ ] check that the job exists at + `https://jenkins.venus-ci-01.coremedia.vm/job/CKEditor-Plugins/job/nightly-sbom-upload/` + and that the team's other jobs are unchanged; + - [ ] run it with `DRY_RUN=true`; + - [ ] expect the job to be deleted again by the next 21:00 Seed run, which + reads `venus-ci-01`, until the pull request is merged. +- [ ] Open a pull request into `venus-ci-01` and get it reviewed by the team. +- [ ] After the merge, wait for the 21:00 Seed run or start Seed by hand without + `CI_JOBS_BRANCH`, and check that the job exists. Its first nightly run + follows at about 02:00. +- [ ] Check that the sandbox allows everything the Jenkinsfile needs (e.g. + JSON parsing, `dependencyTrackPublisher`); request script approvals on + `venus-ci-01` if not. + +## D. Maintenance Branches + +- [ ] Check that ckeditor-plugins needs no further change. The + [Create Maintenance Branch][create-maintenance-branch] workflow cuts + `maintenance/` from a release tag, and the QA gate runs for + `maintenance/*` too. The Jenkins job picks up new branches by name. +- [ ] Accept or close the gap: the first commit of a new branch + ("ci: Create maintenance/ from ") is pushed by that workflow, not + by the QA gate, so it has no artifact. The branch gets its first upload after + its first merged pull request. Option: also generate the artifact in + `create-maintenance-branch.yml`. +- [ ] Note in [DEVELOPMENT.md][development]: a maintenance branch cut from a + release made before this change (e.g. `maintenance/29` from `29.0.0`) needs + this change cherry-picked to get SBOM artifacts. +- [ ] Remove the test branch `maintenance/28` before the job runs, or it gets + uploaded once it has an artifact. + +## E. Rollout and Verification + +- [ ] Complete the prerequisites (A). +- [ ] Open the pull request from `venus/CKE-140-SBOM-upload` (B), get it + reviewed and integrated. +- [ ] Check that the QA-gate run of that integration has the artifact + `sbom-` for the SHA now at the head of `main`. +- [ ] Merge the Jenkins job (C), let Seed create it on `venus-ci-01`, and run it + once by hand with `DRY_RUN`. +- [ ] Run it without `DRY_RUN` and check that Dependency-Track shows + `ckeditor-plugins-workspace` / `main` below `Ckeditor Plugins`, with about + 925 components and the expected tags. +- [ ] Run it again and check that `main` is skipped as unchanged. +- [ ] After the first merge to a new `maintenance/` branch, check that + the next nightly run creates `ckeditor-plugins-workspace` / + `maintenance-`. + +## F. Follow-ups (Outside This Task) + +- [ ] Add `ckeditor-plugins-workspace` to the cve-rating skill. +- [ ] Agree on how to remove `maintenance-` versions from + Dependency-Track when a branch is deleted (manual for now). + +## Risks + +- **Delay:** an upload arrives up to a day after the merge. +- **Expired artifacts:** a branch head older than 90 days has no artifact left. + That's harmless once it was uploaded (the job skips it by the commit tag), + but a head that was never uploaded within 90 days stays missing until the + next merge. +- **Trust in the artifact:** with the `pull_request` trigger, the PR's own + version of the QA gate runs, so anyone with write access could produce a + different SBOM. That's the same trust level as the push itself. The job's + checks (run, push step, branch, SHA, root component) limit what it accepts. + +[cf-qa-gate]: + + "component-foundation QA gate" +[qa-gate]: <../../../.github/workflows/qa-gate.yml> "QA gate" +[create-maintenance-branch]: + <../../../.github/workflows/create-maintenance-branch.yml> + "Create Maintenance Branch" +[development]: <../../../DEVELOPMENT.md> "Development" From 5cbca9c747a0ec60df687360f0eebf41a836cca9 Mon Sep 17 00:00:00 2001 From: Jens Meisner Date: Thu, 19 Nov 2026 09:59:47 +0100 Subject: [PATCH 2/5] docs: Resolve the open questions of the SBOM upload plan (CKE-140) The parent project Ckeditor Plugins already exists in Dependency-Track with the version "-", which the Jenkins job sends as parentVersion, so the job doesn't need to create it. A fresh maintenance/ branch gets no SBOM before its first merged pull request: its first commit only changes .changeset/config.json, and every release from the branch goes through the QA gate first. The Jenkins job logs a warning for the missing artifact and doesn't count it as a failed branch. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- docs-internal/plans/sbom-upload/plan.md | 34 +++++++++++++++---------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/docs-internal/plans/sbom-upload/plan.md b/docs-internal/plans/sbom-upload/plan.md index e0404d0a08..8cc1bb37bd 100644 --- a/docs-internal/plans/sbom-upload/plan.md +++ b/docs-internal/plans/sbom-upload/plan.md @@ -85,17 +85,19 @@ licenses. ## Open Questions -- [ ] Check whether the parent project `Ckeditor Plugins` already exists in - Dependency-Track, and look up how `Component Foundation` stores its version - (`-` or none), so the parent version matches. -- [ ] Decide whether a fresh `maintenance/` branch needs an SBOM before - its first merged pull request (see D). +- [x] Check whether the parent project `Ckeditor Plugins` already exists in + Dependency-Track. **Result (2026-11-19): it exists.** +- [x] Look up the version of the parent project `Ckeditor Plugins` (`-` or + none), so `parentVersion` matches it. **Result (2026-11-19): `-`.** +- [x] Decide whether a fresh `maintenance/` branch needs an SBOM before + its first merged pull request (see D). **Decision (2026-11-19): no.** The + Jenkins job logs a warning for the missing artifact. ## A. Prerequisites -- [ ] Create the parent project `Ckeditor Plugins` in Dependency-Track if it - doesn't exist, or let the Jenkins job create it as the Blueprint job does - (lookup, then `PUT /api/v1/project`). +- [x] Create the parent project `Ckeditor Plugins` in Dependency-Track if it + doesn't exist. It already exists, so the Jenkins job doesn't need to create + it. - [ ] Check your rights on `venus-ci-01`: log in, open `/whoAmI/` for your user and groups, and check that you may build the job **Seed** (**Build with Parameters**). Without that right, the job is still created by the 21:00 @@ -165,7 +167,8 @@ licenses. - [ ] look up the artifact with `GET /repos/CoreMedia/ckeditor-plugins/actions/artifacts?name=sbom-`. If none exists or all expired, log a warning and continue with the next - branch; + branch. A missing artifact is not a failure, e.g. for a fresh + `maintenance/` branch (see D); - [ ] keep only artifacts whose run is `.github/workflows/qa-gate.yml` of `CoreMedia/ckeditor-plugins` and whose step "Push to base branch" (job "Integrate and Merge") succeeded. Don't require the whole job to succeed: @@ -186,7 +189,8 @@ licenses. `parentVersion: '-'`, tags `workspace,team-venus,,snapshot,internal,commit-` - [ ] Fail the build if any branch failed, after all branches were processed, - so one broken branch doesn't block the others. + so one broken branch doesn't block the others. A missing artifact only logs a + warning and doesn't count as failed. - [ ] Clean up the workspace in `post { always { cmCleanup() } }`. - [ ] Test the job before the merge: - [ ] rebase the feature branch onto the current `venus-ci-01`, because Seed @@ -212,11 +216,13 @@ licenses. [Create Maintenance Branch][create-maintenance-branch] workflow cuts `maintenance/` from a release tag, and the QA gate runs for `maintenance/*` too. The Jenkins job picks up new branches by name. -- [ ] Accept or close the gap: the first commit of a new branch +- [x] Accept the gap (decided 2026-11-19): the first commit of a new branch ("ci: Create maintenance/ from ") is pushed by that workflow, not - by the QA gate, so it has no artifact. The branch gets its first upload after - its first merged pull request. Option: also generate the artifact in - `create-maintenance-branch.yml`. + by the QA gate, so it has no artifact. No SBOM is generated for it; the + Jenkins job logs a warning, and the branch gets its first upload after its + first merged pull request. That's enough: the commit only changes + `.changeset/config.json`, and every release from the branch goes through the + QA gate first. - [ ] Note in [DEVELOPMENT.md][development]: a maintenance branch cut from a release made before this change (e.g. `maintenance/29` from `29.0.0`) needs this change cherry-picked to get SBOM artifacts. From 215667347931bdcb20de8fac03caab8a3af096fb Mon Sep 17 00:00:00 2001 From: Jens Meisner Date: Thu, 19 Nov 2026 10:32:20 +0100 Subject: [PATCH 3/5] ci: Generate the workspace SBOM in the QA gate (CKE-140) Before the push to main or a maintenance branch, the QA gate generates a CycloneDX 1.6 SBOM of the whole workspace with pnpm sbom, so an SBOM that cannot be generated blocks the merge. It stores the SBOM with a metadata.json (branch, commit, version) as the artifact sbom-, named after the pushed commit and kept for 90 days. A nightly job on an internal Jenkins uploads the SBOM of each branch head to Dependency-Track. This repository is public, so it can neither use the shared private upload workflow nor reach Dependency-Track itself. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .changeset/major-lilies-hunt.md | 2 ++ .github/workflows/qa-gate.yml | 31 +++++++++++++++++++++ DEVELOPMENT.md | 25 +++++++++++++++++ docs-internal/plans/sbom-upload/plan.md | 36 +++++++++++-------------- 4 files changed, 74 insertions(+), 20 deletions(-) create mode 100644 .changeset/major-lilies-hunt.md diff --git a/.changeset/major-lilies-hunt.md b/.changeset/major-lilies-hunt.md new file mode 100644 index 0000000000..a845151cc8 --- /dev/null +++ b/.changeset/major-lilies-hunt.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/.github/workflows/qa-gate.yml b/.github/workflows/qa-gate.yml index 7562cf70b5..9ef5b74385 100644 --- a/.github/workflows/qa-gate.yml +++ b/.github/workflows/qa-gate.yml @@ -161,6 +161,37 @@ jobs: base-ref: origin/${{ env.BASE_BRANCH }} target-branch: ${{ env.BASE_BRANCH }} + # Before the push: an SBOM that cannot be generated blocks the merge. + # Not "--lockfile-only": reading the installed packages adds their licenses to the SBOM. + # 1.6, not pnpm's 1.7 default: 1.6 is the spec version our Dependency-Track ingests. + - name: Generate SBOM + id: sbom + run: | + COMMIT=$(git rev-parse HEAD) + VERSION=$(jq -r .version packages/ckeditor5-common/package.json) + + pnpm sbom \ + --sbom-format cyclonedx \ + --sbom-spec-version 1.6 \ + --sbom-type application \ + --out build/sbom/ckeditor-plugins-workspace.cdx.json + + # Read by the nightly Dependency-Track upload, see DEVELOPMENT.md. + jq -n --arg branch "$BASE_BRANCH" --arg commit "$COMMIT" --arg version "$VERSION" \ + '{branch: $branch, commit: $commit, version: $version}' \ + > build/sbom/metadata.json + + echo "commit=$COMMIT" >> "$GITHUB_OUTPUT" + + # Named after the pushed commit, so the nightly upload finds the SBOM of a branch head. + - name: Upload SBOM + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: sbom-${{ steps.sbom.outputs.commit }} + path: build/sbom + if-no-files-found: error + retention-days: 90 + - name: Push to base branch env: PR_NUMBER: ${{ needs.check-queue.outputs.pr-number }} diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 0d6e58a32f..62a122115e 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -96,6 +96,31 @@ introduced. Releases of the old release process (up to `28.1.1`) and the legacy branches `maintenance/23.0`, `24.0` and `25.0` are not supported by this workflow. Major 28 becomes maintainable with its first release made with Changesets. +## SBOM + +Before the QA gate pushes to `main` or a maintenance branch, it generates a +CycloneDX SBOM (spec version 1.6) of the whole workspace with `pnpm sbom`. An SBOM +that cannot be generated blocks the merge. The QA gate stores it together with a +`metadata.json` (branch, commit, version) as the artifact `sbom-`, +named after the pushed commit and kept for 90 days. + +A nightly job on an internal Jenkins of CoreMedia uploads the SBOM of each branch +head to Dependency-Track as the project `ckeditor-plugins-workspace`, version +`main` or `maintenance-`, below the parent project `Ckeditor Plugins`. +Each upload replaces the previous one of that version, and it arrives up to a day +after the merge. The job is defined in the internal repository +`CoreMedia/ci-jobs`. + +This is a temporary solution. Other CoreMedia workspaces upload their SBOM from +GitHub Actions through a shared workflow, but this repository is public: it can +neither use that private workflow nor reach Dependency-Track, which is only +available internally. + +A new maintenance branch has no SBOM until its first merged pull request, because +its first commit is pushed by _Create Maintenance Branch_ and not by the QA gate; +the nightly job only logs a warning for it. A maintenance branch created from a +release without the SBOM step needs this step cherry-picked into its QA gate. + ## Update Process All dependency versions are maintained centrally in the `catalog` of diff --git a/docs-internal/plans/sbom-upload/plan.md b/docs-internal/plans/sbom-upload/plan.md index 8cc1bb37bd..685a8795f8 100644 --- a/docs-internal/plans/sbom-upload/plan.md +++ b/docs-internal/plans/sbom-upload/plan.md @@ -26,11 +26,8 @@ the upload from GitHub: - A self-hosted runner in a public repository is not safe: a pull request from a fork can change a workflow so it runs on that runner. - Dependency-Track is **not reachable from GitHub-hosted runners**. Checked - 2026-11-18: `apiserver.dependency-track.coremedia.io` doesn't exist in public - DNS (NXDOMAIN at Cloudflare and Google). On the corporate network it resolves - to `10.100.4.217` and `10.100.7.125` (private Route 53 zone, load balancer - `moebius-internal-services`, see `aws/prod/README.md` in - `CoreMedia/dependency-track-infra`). + 2026-11-18: its API server is not in public DNS and is only reachable from + the internal network. Jenkins runs inside the network and reaches both GitHub and Dependency-Track. It already uploads SBOMs: `blueprint-sbom-upload.Jenkinsfile` in @@ -38,7 +35,7 @@ It already uploads SBOMs: `blueprint-sbom-upload.Jenkinsfile` in `dependency-track-prod`. GitHub cannot trigger the internal Jenkins, so the job runs on a schedule. -The team's Jenkins is `https://jenkins.venus-ci-01.coremedia.vm`. Its jobs are +The team has its own internal Jenkins instance, `venus-ci-01`. Its jobs are Job DSL in the branch `venus-ci-01` of `CoreMedia/ci-jobs` (`ci/pipelines/`, `ci/jenkinsfiles/`); see `ci/pipelines/perso_testsystem.groovy` there for a nightly job. Nobody creates jobs in the Jenkins UI. The job **Seed** (defined @@ -98,7 +95,7 @@ licenses. - [x] Create the parent project `Ckeditor Plugins` in Dependency-Track if it doesn't exist. It already exists, so the Jenkins job doesn't need to create it. -- [ ] Check your rights on `venus-ci-01`: log in, open `/whoAmI/` for your +- [x] Check your rights on `venus-ci-01`: log in, open `/whoAmI/` for your user and groups, and check that you may build the job **Seed** (**Build with Parameters**). Without that right, the job is still created by the 21:00 Seed run, but you can't test a feature branch (see C). @@ -117,9 +114,9 @@ licenses. ## B. Changes in ckeditor-plugins (Branch `venus/CKE-140-SBOM-upload`) -- [ ] In the `integrate` job of the [QA gate][qa-gate], after the merge and +- [x] In the `integrate` job of the [QA gate][qa-gate], after the merge and before the push, take the commit to be pushed: `git rev-parse HEAD`. -- [ ] After "Checks" and before the push, generate the SBOM. A failure blocks +- [x] After "Checks" and before the push, generate the SBOM. A failure blocks the merge. ```bash @@ -130,17 +127,17 @@ licenses. --out build/sbom/ckeditor-plugins-workspace.cdx.json ``` -- [ ] Write `build/sbom/metadata.json` with: - - [ ] `branch`: the base branch (`main` or `maintenance/`); - - [ ] `commit`: the SHA from the first step; - - [ ] `version`: the version from `packages/ckeditor5-common/package.json`. -- [ ] Upload `build/sbom` as the artifact `sbom-` with +- [x] Write `build/sbom/metadata.json` with: + - [x] `branch`: the base branch (`main` or `maintenance/`); + - [x] `commit`: the SHA from the first step; + - [x] `version`: the version from `packages/ckeditor5-common/package.json`. +- [x] Upload `build/sbom` as the artifact `sbom-` with `if-no-files-found: error` and `retention-days: 90` (the maximum for public repositories). `build/` is already git-ignored. -- [ ] Document the SBOM artifact, the nightly Jenkins upload and where the job +- [x] Document the SBOM artifact, the nightly Jenkins upload and where the job lives in [DEVELOPMENT.md][development], including that this is a temporary solution outside the shared workflow. -- [ ] Add an empty changeset (`pnpm changeset add --empty`). The checks +- [x] Add an empty changeset (`pnpm changeset add --empty`). The checks require a new changeset in every pull request, and changes to `.github/` and docs don't touch any package. - [ ] Remove this plan before the branch is integrated. @@ -196,9 +193,8 @@ licenses. - [ ] rebase the feature branch onto the current `venus-ci-01`, because Seed deletes every job that is missing from the branch it reads; - [ ] start Seed by hand with `CI_JOBS_BRANCH=`; - - [ ] check that the job exists at - `https://jenkins.venus-ci-01.coremedia.vm/job/CKEditor-Plugins/job/nightly-sbom-upload/` - and that the team's other jobs are unchanged; + - [ ] check that the job `CKEditor-Plugins/nightly-sbom-upload` exists on + `venus-ci-01` and that the team's other jobs are unchanged; - [ ] run it with `DRY_RUN=true`; - [ ] expect the job to be deleted again by the next 21:00 Seed run, which reads `venus-ci-01`, until the pull request is merged. @@ -223,7 +219,7 @@ licenses. first merged pull request. That's enough: the commit only changes `.changeset/config.json`, and every release from the branch goes through the QA gate first. -- [ ] Note in [DEVELOPMENT.md][development]: a maintenance branch cut from a +- [x] Note in [DEVELOPMENT.md][development]: a maintenance branch cut from a release made before this change (e.g. `maintenance/29` from `29.0.0`) needs this change cherry-picked to get SBOM artifacts. - [ ] Remove the test branch `maintenance/28` before the job runs, or it gets From 6fa069377b1093c27d3f7fee53f692606ed319eb Mon Sep 17 00:00:00 2001 From: Jens Meisner Date: Tue, 24 Nov 2026 09:21:26 +0100 Subject: [PATCH 4/5] docs: Record the Jenkins upload job in the SBOM upload plan (CKE-140) The nightly job on venus-ci-01 is implemented on the ci-jobs branch ckeditor-plugins-sbom-upload. It uploads the SBOM artifact of each branch head with the dependencyTrackPublisher step of the Dependency-Track plugin, as the Blueprint SBOM upload does, and takes the Dependency-Track URL and API key from the plugin's global configuration. The job uploads every night without skipping unchanged heads, since re-uploading the same SBOM is harmless. A failed upload fails only its branch; a missing artifact only logs a warning. The prerequisites now include the plugin and its global configuration on venus-ci-01. They also list the API key permissions the plugin needs: after the upload it looks up the project and updates its tags, which requires VIEW_PORTFOLIO and PORTFOLIO_MANAGEMENT besides BOM_UPLOAD and PROJECT_CREATION_UPLOAD. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- docs-internal/plans/sbom-upload/plan.md | 103 +++++++++++++++--------- 1 file changed, 65 insertions(+), 38 deletions(-) diff --git a/docs-internal/plans/sbom-upload/plan.md b/docs-internal/plans/sbom-upload/plan.md index 685a8795f8..a40b9281b3 100644 --- a/docs-internal/plans/sbom-upload/plan.md +++ b/docs-internal/plans/sbom-upload/plan.md @@ -77,8 +77,14 @@ licenses. `workspace,team-venus,,snapshot,internal,commit-`. The version comes from `packages/ckeditor5-common/package.json`; all published packages share one version. -- [x] **Unchanged heads:** Jenkins skips a branch whose Dependency-Track project - already has the tag `commit-` of the current head. +- [x] **Unchanged heads:** no skip (decided 2026-11-19). Jenkins uploads the + artifact of each branch head every night; re-uploading the same SBOM is + harmless. +- [x] **Upload mechanism:** the Jenkins plugin step `dependencyTrackPublisher` + of the Dependency-Track plugin, as the Blueprint job does (decided + 2026-11-19, replacing an earlier decision for `curl`). The plugin takes the + Dependency-Track URL and API key from its global configuration on + `venus-ci-01`. The job still uses `curl` for the GitHub API. ## Open Questions @@ -99,18 +105,29 @@ licenses. user and groups, and check that you may build the job **Seed** (**Build with Parameters**). Without that right, the job is still created by the 21:00 Seed run, but you can't test a feature branch (see C). +- [ ] Check on `venus-ci-01` whether the Dependency-Track plugin is installed + (**Manage Jenkins** > **Plugins** > **Installed plugins**) and configured + globally (**Manage Jenkins** > **System** > **Dependency-Track**: API server + URL and API key credential). - [ ] Check on `venus-ci-01` under `/credentials/` whether these credentials exist: - - [ ] a Dependency-Track API key (e.g. `dependency-track-prod`, which the - Blueprint job uses on the cms Jenkins); + - [ ] a Dependency-Track API key as secret text (e.g. + `dependency-track-prod`, which the Blueprint job uses on the cms Jenkins), + selected in the plugin's global configuration; - [ ] a GitHub token (e.g. `github`) that can read the Actions artifacts of - `CoreMedia/ckeditor-plugins`. -- [ ] Request missing credentials by email to support@coremedia.com, using the - template in the `CoreMedia/ci-configuration` README (secret ID + `CoreMedia/ckeditor-plugins`. The job uses `github` (username/password); it + exists on `venus-ci-01`, since the team's AI test-system job already reads + Actions artifacts with it. +- [ ] Request what is missing (plugin, its global configuration, credentials) + by a ticket or email to support@coremedia.com, using the template in the + `CoreMedia/ci-configuration` README for credentials (secret ID `venus-ci-01/`, or `jenkins-global/` if it already exists for other instances). - [ ] Make sure the Dependency-Track API key has `BOM_UPLOAD`, - `PROJECT_CREATION_UPLOAD` and `VIEW_PORTFOLIO` (for the tag lookup). + `PROJECT_CREATION_UPLOAD`, `VIEW_PORTFOLIO` and `PORTFOLIO_MANAGEMENT`. + After the upload, the plugin looks up the project (`VIEW_PORTFOLIO`) and sets + its tags with a project update (`PORTFOLIO_MANAGEMENT`); without these, the + upload step fails. ## B. Changes in ckeditor-plugins (Branch `venus/CKE-140-SBOM-upload`) @@ -144,51 +161,59 @@ licenses. ## C. Jenkins Job in `CoreMedia/ci-jobs` (Branch `venus-ci-01`) -- [ ] Add `ci/pipelines/ckeditor_plugins_sbom.groovy` with a folder (e.g. +Implemented on the branch `ckeditor-plugins-sbom-upload` of `ci-jobs`, not +committed yet. Tested locally against GitHub: branch listing, missing artifact, +run and push checks (on a real QA-gate run), the checks of `metadata.json` and +the SBOM, and the dry run. Groovy syntax checked. + +- [x] Add `ci/pipelines/ckeditor_plugins_sbom.groovy` with a folder (e.g. `CKEditor-Plugins`) and a `pipelineJob` (e.g. `nightly-sbom-upload`) with: - - [ ] a nightly trigger, e.g. `cron('H 2 * * *')`; - - [ ] the parameters `BRANCH` (default: all release branches) and `DRY_RUN` + - [x] a nightly trigger, e.g. `cron('H 2 * * *')`; + - [x] the parameters `BRANCH` (default: all release branches) and `DRY_RUN` (only log what would be uploaded); - - [ ] the Jenkinsfile through + - [x] the Jenkinsfile through `readFileFromWorkspace('ci/jenkinsfiles/ckeditorPluginsSbomUpload.Jenkinsfile')` with `sandbox()`, as the perso jobs do. -- [ ] Add `ci/jenkinsfiles/ckeditorPluginsSbomUpload.Jenkinsfile`. -- [ ] In the Jenkinsfile, list the branches of `CoreMedia/ckeditor-plugins` +- [x] Add `ci/jenkinsfiles/ckeditorPluginsSbomUpload.Jenkinsfile`. +- [x] In the Jenkinsfile, list the branches of `CoreMedia/ckeditor-plugins` through the GitHub API and keep those matching `^(main|maintenance/[1-9][0-9]*)$`. This leaves out `maintenance/23.0`–`25.0`. -- [ ] For each branch: - - [ ] read the head SHA; - - [ ] derive the project version (`main` or `maintenance-`); - - [ ] skip the branch if the Dependency-Track project already has the tag - `commit-`; - - [ ] look up the artifact with +- [x] For each branch: + - [x] read the head SHA; + - [x] derive the project version (`main` or `maintenance-`); + - [x] look up the artifact with `GET /repos/CoreMedia/ckeditor-plugins/actions/artifacts?name=sbom-`. If none exists or all expired, log a warning and continue with the next branch. A missing artifact is not a failure, e.g. for a fresh `maintenance/` branch (see D); - - [ ] keep only artifacts whose run is `.github/workflows/qa-gate.yml` of + - [x] keep only artifacts whose run is `.github/workflows/qa-gate.yml` of `CoreMedia/ckeditor-plugins` and whose step "Push to base branch" (job "Integrate and Merge") succeeded. Don't require the whole job to succeed: "Deploy Storybook" runs after the push and may fail although the commit was pushed; - - [ ] if several artifacts remain (a retried QA gate after a fast-forward + - [x] if several artifacts remain (a retried QA gate after a fast-forward merge pushes the same SHA again), take the newest unexpired one; - - [ ] download and unzip the artifact; - - [ ] check that `metadata.json` names this branch and this SHA, and that the + - [x] download and unzip the artifact; + - [x] check that `metadata.json` names this branch and this SHA, and that the SBOM is CycloneDX 1.6 with the root component `pkg:npm/%40coremedia/ckeditor5@…`; - - [ ] upload it with `dependencyTrackPublisher`, as the Blueprint job does: - - [ ] `projectName: 'ckeditor-plugins-workspace'` - - [ ] `projectVersion`: `main` or `maintenance-` - - [ ] `artifact`: `ckeditor-plugins-workspace.cdx.json` - - [ ] `autoCreateProjects: true` - - [ ] `projectProperties`: `parentName: 'Ckeditor Plugins'`, + - [x] upload it with `dependencyTrackPublisher`, as the Blueprint job does: + - [x] `projectName: 'ckeditor-plugins-workspace'` + - [x] `projectVersion`: `main` or `maintenance-` + - [x] `artifact`: `sbom//ckeditor-plugins-workspace.cdx.json` + - [x] `autoCreateProjects: true`, `synchronous: false` + - [x] `projectProperties`: `parentName: 'Ckeditor Plugins'`, `parentVersion: '-'`, tags `workspace,team-venus,,snapshot,internal,commit-` -- [ ] Fail the build if any branch failed, after all branches were processed, + - [x] count a failed upload (the plugin throws `AbortException`) as a failed + branch and continue with the next one. +- [x] Fail the build if any branch failed, after all branches were processed, so one broken branch doesn't block the others. A missing artifact only logs a warning and doesn't count as failed. -- [ ] Clean up the workspace in `post { always { cmCleanup() } }`. +- [x] Delete the workspace in `post { cleanup { deleteDir() } }`. Not + `cmCleanup()`: it also stops and removes all Docker containers on the node. +- [x] A dry run doesn't call the plugin, so it works before the plugin and the + Dependency-Track key are available on `venus-ci-01`. - [ ] Test the job before the merge: - [ ] rebase the feature branch onto the current `venus-ci-01`, because Seed deletes every job that is missing from the branch it reads; @@ -202,8 +227,9 @@ licenses. - [ ] After the merge, wait for the 21:00 Seed run or start Seed by hand without `CI_JOBS_BRANCH`, and check that the job exists. Its first nightly run follows at about 02:00. -- [ ] Check that the sandbox allows everything the Jenkinsfile needs (e.g. - JSON parsing, `dependencyTrackPublisher`); request script approvals on +- [ ] Check that the sandbox and the agent allow everything the Jenkinsfile + needs (`curl`, `jq` and `unzip` on the agent; `tokenize`, `join` and the + step `dependencyTrackPublisher` in the sandbox); request script approvals on `venus-ci-01` if not. ## D. Maintenance Branches @@ -237,7 +263,8 @@ licenses. - [ ] Run it without `DRY_RUN` and check that Dependency-Track shows `ckeditor-plugins-workspace` / `main` below `Ckeditor Plugins`, with about 925 components and the expected tags. -- [ ] Run it again and check that `main` is skipped as unchanged. +- [ ] Run it again and check that `main` is uploaded again without errors and + the tags follow the upload (see the permission in A). - [ ] After the first merge to a new `maintenance/` branch, check that the next nightly run creates `ckeditor-plugins-workspace` / `maintenance-`. @@ -252,9 +279,9 @@ licenses. - **Delay:** an upload arrives up to a day after the merge. - **Expired artifacts:** a branch head older than 90 days has no artifact left. - That's harmless once it was uploaded (the job skips it by the commit tag), - but a head that was never uploaded within 90 days stays missing until the - next merge. + Dependency-Track keeps the last upload, and the job logs a warning for that + branch every night until the next merge. A head that was never uploaded + within 90 days stays missing until the next merge. - **Trust in the artifact:** with the `pull_request` trigger, the PR's own version of the QA gate runs, so anyone with write access could produce a different SBOM. That's the same trust level as the push itself. The job's From dbd7a1a44a908d13034a44b7707cb1e8177ef625 Mon Sep 17 00:00:00 2001 From: Jens Meisner Date: Tue, 24 Nov 2026 14:28:18 +0100 Subject: [PATCH 5/5] remove plan --- docs-internal/plans/sbom-upload/plan.md | 297 ------------------------ 1 file changed, 297 deletions(-) delete mode 100644 docs-internal/plans/sbom-upload/plan.md diff --git a/docs-internal/plans/sbom-upload/plan.md b/docs-internal/plans/sbom-upload/plan.md deleted file mode 100644 index a40b9281b3..0000000000 --- a/docs-internal/plans/sbom-upload/plan.md +++ /dev/null @@ -1,297 +0,0 @@ -# Plan: Upload the Workspace SBOM to Dependency-Track (CKE-140) - -Goal: upload a CycloneDX SBOM of the whole ckeditor-plugins workspace to -Dependency-Track, as component-foundation already does. Uploads cover `main` -and all future `maintenance/` branches. The legacy branches -`maintenance/23.0`, `24.0`, `25.0` and the test branch `maintenance/28` are -out of scope. - -This is a temporary solution: the [QA gate][qa-gate] generates the SBOM as an -artifact, and a nightly job on the team's Jenkins `venus-ci-01` uploads it. -It does not use the shared `reusable-sbom-upload.yml` of -`CoreMedia/github-actions`. - -Mark each item as done (`[x]`) once it is complete and verified. - -## Background - -component-foundation generates the SBOM with `pnpm sbom` in its -[QA gate][cf-qa-gate] and uploads it through the shared reusable workflow on -`coremedia-selfhosted-runner-k8s`. ckeditor-plugins cannot do either part of -the upload from GitHub: - -- ckeditor-plugins is **public**, and GitHub lets a public repository call only - reusable workflows from public repositories. `CoreMedia/github-actions` is - private. -- A self-hosted runner in a public repository is not safe: a pull request from - a fork can change a workflow so it runs on that runner. -- Dependency-Track is **not reachable from GitHub-hosted runners**. Checked - 2026-11-18: its API server is not in public DNS and is only reachable from - the internal network. - -Jenkins runs inside the network and reaches both GitHub and Dependency-Track. -It already uploads SBOMs: `blueprint-sbom-upload.Jenkinsfile` in -`CoreMedia/cms` uses `dependencyTrackPublisher` with the credential -`dependency-track-prod`. GitHub cannot trigger the internal Jenkins, so the job -runs on a schedule. - -The team has its own internal Jenkins instance, `venus-ci-01`. Its jobs are -Job DSL in the branch `venus-ci-01` of `CoreMedia/ci-jobs` (`ci/pipelines/`, -`ci/jenkinsfiles/`); see `ci/pipelines/perso_testsystem.groovy` there for a -nightly job. Nobody creates jobs in the Jenkins UI. The job **Seed** (defined -in `jenkins/seed-files/` of `CoreMedia/devops-tools`) creates them: - -- It runs every evening at 21:00 (`0 21 * * *`) and can be started by hand. -- It checks out the `ci-jobs` branch named after the host (`venus-ci-01`, or the - branch in its parameter `CI_JOBS_BRANCH`) and `ci-configuration` (`main`). -- It runs Job DSL over `ci/pipelines/*.groovy` and `ci/defaultPipelines.json`: - new definitions create jobs, changed ones update them, and jobs whose - definition is gone are **deleted** (`removedJobAction: 'DELETE'`). -- `readFileFromWorkspace` copies the Jenkinsfile into the job's configuration, - so a Jenkinsfile change takes effect only after the next Seed run. -- Changes made in the Jenkins UI are overwritten by the next Seed run. - -`pnpm sbom` works on this workspace: a local test produced CycloneDX 1.6 with -the root component `@coremedia/ckeditor5`, 925 components, 890 of them with -licenses. - -## Decisions - -- [x] **Mechanism:** the QA gate generates the SBOM before the push and stores - it as an artifact. A nightly Jenkins job downloads the artifact of each - branch head through the GitHub API, checks it, and uploads it. -- [x] **No Dependency-Track secrets in ckeditor-plugins:** only Jenkins talks to - Dependency-Track. -- [x] **Job location:** Job DSL and Jenkinsfile both in the branch - `venus-ci-01` of `CoreMedia/ci-jobs` (internal), next to the team's other - jobs. The job runs on `venus-ci-01`. -- [x] **Schedule:** nightly. -- [x] **Artifact name:** `sbom-`, where the SHA is the commit the - QA gate pushes. Jenkins finds the artifact of a branch head by name, without - mapping pull-request runs to pushed commits. -- [x] **Dependency-Track project:** `ckeditor-plugins-workspace`, below the - parent project `Ckeditor Plugins` (parent version `-`). -- [x] **Project version:** `main` for `main`, `maintenance-` for - `maintenance/` (e.g. `maintenance-30`). -- [x] **Project tags:** - `workspace,team-venus,,snapshot,internal,commit-`. - The version comes from `packages/ckeditor5-common/package.json`; all - published packages share one version. -- [x] **Unchanged heads:** no skip (decided 2026-11-19). Jenkins uploads the - artifact of each branch head every night; re-uploading the same SBOM is - harmless. -- [x] **Upload mechanism:** the Jenkins plugin step `dependencyTrackPublisher` - of the Dependency-Track plugin, as the Blueprint job does (decided - 2026-11-19, replacing an earlier decision for `curl`). The plugin takes the - Dependency-Track URL and API key from its global configuration on - `venus-ci-01`. The job still uses `curl` for the GitHub API. - -## Open Questions - -- [x] Check whether the parent project `Ckeditor Plugins` already exists in - Dependency-Track. **Result (2026-11-19): it exists.** -- [x] Look up the version of the parent project `Ckeditor Plugins` (`-` or - none), so `parentVersion` matches it. **Result (2026-11-19): `-`.** -- [x] Decide whether a fresh `maintenance/` branch needs an SBOM before - its first merged pull request (see D). **Decision (2026-11-19): no.** The - Jenkins job logs a warning for the missing artifact. - -## A. Prerequisites - -- [x] Create the parent project `Ckeditor Plugins` in Dependency-Track if it - doesn't exist. It already exists, so the Jenkins job doesn't need to create - it. -- [x] Check your rights on `venus-ci-01`: log in, open `/whoAmI/` for your - user and groups, and check that you may build the job **Seed** (**Build with - Parameters**). Without that right, the job is still created by the 21:00 - Seed run, but you can't test a feature branch (see C). -- [ ] Check on `venus-ci-01` whether the Dependency-Track plugin is installed - (**Manage Jenkins** > **Plugins** > **Installed plugins**) and configured - globally (**Manage Jenkins** > **System** > **Dependency-Track**: API server - URL and API key credential). -- [ ] Check on `venus-ci-01` under `/credentials/` whether these credentials - exist: - - [ ] a Dependency-Track API key as secret text (e.g. - `dependency-track-prod`, which the Blueprint job uses on the cms Jenkins), - selected in the plugin's global configuration; - - [ ] a GitHub token (e.g. `github`) that can read the Actions artifacts of - `CoreMedia/ckeditor-plugins`. The job uses `github` (username/password); it - exists on `venus-ci-01`, since the team's AI test-system job already reads - Actions artifacts with it. -- [ ] Request what is missing (plugin, its global configuration, credentials) - by a ticket or email to support@coremedia.com, using the template in the - `CoreMedia/ci-configuration` README for credentials (secret ID - `venus-ci-01/`, or `jenkins-global/` if it - already exists for other instances). -- [ ] Make sure the Dependency-Track API key has `BOM_UPLOAD`, - `PROJECT_CREATION_UPLOAD`, `VIEW_PORTFOLIO` and `PORTFOLIO_MANAGEMENT`. - After the upload, the plugin looks up the project (`VIEW_PORTFOLIO`) and sets - its tags with a project update (`PORTFOLIO_MANAGEMENT`); without these, the - upload step fails. - -## B. Changes in ckeditor-plugins (Branch `venus/CKE-140-SBOM-upload`) - -- [x] In the `integrate` job of the [QA gate][qa-gate], after the merge and - before the push, take the commit to be pushed: `git rev-parse HEAD`. -- [x] After "Checks" and before the push, generate the SBOM. A failure blocks - the merge. - - ```bash - pnpm sbom \ - --sbom-format cyclonedx \ - --sbom-spec-version 1.6 \ - --sbom-type application \ - --out build/sbom/ckeditor-plugins-workspace.cdx.json - ``` - -- [x] Write `build/sbom/metadata.json` with: - - [x] `branch`: the base branch (`main` or `maintenance/`); - - [x] `commit`: the SHA from the first step; - - [x] `version`: the version from `packages/ckeditor5-common/package.json`. -- [x] Upload `build/sbom` as the artifact `sbom-` with - `if-no-files-found: error` and `retention-days: 90` (the maximum for public - repositories). `build/` is already git-ignored. -- [x] Document the SBOM artifact, the nightly Jenkins upload and where the job - lives in [DEVELOPMENT.md][development], including that this is a temporary - solution outside the shared workflow. -- [x] Add an empty changeset (`pnpm changeset add --empty`). The checks - require a new changeset in every pull request, and changes to `.github/` and - docs don't touch any package. -- [ ] Remove this plan before the branch is integrated. - -## C. Jenkins Job in `CoreMedia/ci-jobs` (Branch `venus-ci-01`) - -Implemented on the branch `ckeditor-plugins-sbom-upload` of `ci-jobs`, not -committed yet. Tested locally against GitHub: branch listing, missing artifact, -run and push checks (on a real QA-gate run), the checks of `metadata.json` and -the SBOM, and the dry run. Groovy syntax checked. - -- [x] Add `ci/pipelines/ckeditor_plugins_sbom.groovy` with a folder (e.g. - `CKEditor-Plugins`) and a `pipelineJob` (e.g. `nightly-sbom-upload`) with: - - [x] a nightly trigger, e.g. `cron('H 2 * * *')`; - - [x] the parameters `BRANCH` (default: all release branches) and `DRY_RUN` - (only log what would be uploaded); - - [x] the Jenkinsfile through - `readFileFromWorkspace('ci/jenkinsfiles/ckeditorPluginsSbomUpload.Jenkinsfile')` - with `sandbox()`, as the perso jobs do. -- [x] Add `ci/jenkinsfiles/ckeditorPluginsSbomUpload.Jenkinsfile`. -- [x] In the Jenkinsfile, list the branches of `CoreMedia/ckeditor-plugins` - through the GitHub API and keep those matching - `^(main|maintenance/[1-9][0-9]*)$`. This leaves out `maintenance/23.0`–`25.0`. -- [x] For each branch: - - [x] read the head SHA; - - [x] derive the project version (`main` or `maintenance-`); - - [x] look up the artifact with - `GET /repos/CoreMedia/ckeditor-plugins/actions/artifacts?name=sbom-`. - If none exists or all expired, log a warning and continue with the next - branch. A missing artifact is not a failure, e.g. for a fresh - `maintenance/` branch (see D); - - [x] keep only artifacts whose run is `.github/workflows/qa-gate.yml` of - `CoreMedia/ckeditor-plugins` and whose step "Push to base branch" (job - "Integrate and Merge") succeeded. Don't require the whole job to succeed: - "Deploy Storybook" runs after the push and may fail although the commit was - pushed; - - [x] if several artifacts remain (a retried QA gate after a fast-forward - merge pushes the same SHA again), take the newest unexpired one; - - [x] download and unzip the artifact; - - [x] check that `metadata.json` names this branch and this SHA, and that the - SBOM is CycloneDX 1.6 with the root component - `pkg:npm/%40coremedia/ckeditor5@…`; - - [x] upload it with `dependencyTrackPublisher`, as the Blueprint job does: - - [x] `projectName: 'ckeditor-plugins-workspace'` - - [x] `projectVersion`: `main` or `maintenance-` - - [x] `artifact`: `sbom//ckeditor-plugins-workspace.cdx.json` - - [x] `autoCreateProjects: true`, `synchronous: false` - - [x] `projectProperties`: `parentName: 'Ckeditor Plugins'`, - `parentVersion: '-'`, tags - `workspace,team-venus,,snapshot,internal,commit-` - - [x] count a failed upload (the plugin throws `AbortException`) as a failed - branch and continue with the next one. -- [x] Fail the build if any branch failed, after all branches were processed, - so one broken branch doesn't block the others. A missing artifact only logs a - warning and doesn't count as failed. -- [x] Delete the workspace in `post { cleanup { deleteDir() } }`. Not - `cmCleanup()`: it also stops and removes all Docker containers on the node. -- [x] A dry run doesn't call the plugin, so it works before the plugin and the - Dependency-Track key are available on `venus-ci-01`. -- [ ] Test the job before the merge: - - [ ] rebase the feature branch onto the current `venus-ci-01`, because Seed - deletes every job that is missing from the branch it reads; - - [ ] start Seed by hand with `CI_JOBS_BRANCH=`; - - [ ] check that the job `CKEditor-Plugins/nightly-sbom-upload` exists on - `venus-ci-01` and that the team's other jobs are unchanged; - - [ ] run it with `DRY_RUN=true`; - - [ ] expect the job to be deleted again by the next 21:00 Seed run, which - reads `venus-ci-01`, until the pull request is merged. -- [ ] Open a pull request into `venus-ci-01` and get it reviewed by the team. -- [ ] After the merge, wait for the 21:00 Seed run or start Seed by hand without - `CI_JOBS_BRANCH`, and check that the job exists. Its first nightly run - follows at about 02:00. -- [ ] Check that the sandbox and the agent allow everything the Jenkinsfile - needs (`curl`, `jq` and `unzip` on the agent; `tokenize`, `join` and the - step `dependencyTrackPublisher` in the sandbox); request script approvals on - `venus-ci-01` if not. - -## D. Maintenance Branches - -- [ ] Check that ckeditor-plugins needs no further change. The - [Create Maintenance Branch][create-maintenance-branch] workflow cuts - `maintenance/` from a release tag, and the QA gate runs for - `maintenance/*` too. The Jenkins job picks up new branches by name. -- [x] Accept the gap (decided 2026-11-19): the first commit of a new branch - ("ci: Create maintenance/ from ") is pushed by that workflow, not - by the QA gate, so it has no artifact. No SBOM is generated for it; the - Jenkins job logs a warning, and the branch gets its first upload after its - first merged pull request. That's enough: the commit only changes - `.changeset/config.json`, and every release from the branch goes through the - QA gate first. -- [x] Note in [DEVELOPMENT.md][development]: a maintenance branch cut from a - release made before this change (e.g. `maintenance/29` from `29.0.0`) needs - this change cherry-picked to get SBOM artifacts. -- [ ] Remove the test branch `maintenance/28` before the job runs, or it gets - uploaded once it has an artifact. - -## E. Rollout and Verification - -- [ ] Complete the prerequisites (A). -- [ ] Open the pull request from `venus/CKE-140-SBOM-upload` (B), get it - reviewed and integrated. -- [ ] Check that the QA-gate run of that integration has the artifact - `sbom-` for the SHA now at the head of `main`. -- [ ] Merge the Jenkins job (C), let Seed create it on `venus-ci-01`, and run it - once by hand with `DRY_RUN`. -- [ ] Run it without `DRY_RUN` and check that Dependency-Track shows - `ckeditor-plugins-workspace` / `main` below `Ckeditor Plugins`, with about - 925 components and the expected tags. -- [ ] Run it again and check that `main` is uploaded again without errors and - the tags follow the upload (see the permission in A). -- [ ] After the first merge to a new `maintenance/` branch, check that - the next nightly run creates `ckeditor-plugins-workspace` / - `maintenance-`. - -## F. Follow-ups (Outside This Task) - -- [ ] Add `ckeditor-plugins-workspace` to the cve-rating skill. -- [ ] Agree on how to remove `maintenance-` versions from - Dependency-Track when a branch is deleted (manual for now). - -## Risks - -- **Delay:** an upload arrives up to a day after the merge. -- **Expired artifacts:** a branch head older than 90 days has no artifact left. - Dependency-Track keeps the last upload, and the job logs a warning for that - branch every night until the next merge. A head that was never uploaded - within 90 days stays missing until the next merge. -- **Trust in the artifact:** with the `pull_request` trigger, the PR's own - version of the QA gate runs, so anyone with write access could produce a - different SBOM. That's the same trust level as the push itself. The job's - checks (run, push step, branch, SHA, root component) limit what it accepts. - -[cf-qa-gate]: - - "component-foundation QA gate" -[qa-gate]: <../../../.github/workflows/qa-gate.yml> "QA gate" -[create-maintenance-branch]: - <../../../.github/workflows/create-maintenance-branch.yml> - "Create Maintenance Branch" -[development]: <../../../DEVELOPMENT.md> "Development"