Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .changeset/major-lilies-hunt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
31 changes: 31 additions & 0 deletions .github/workflows/qa-gate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
25 changes: 25 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -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-<commit SHA>`,
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-<major>`, 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
Expand Down
Loading