Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
128 commits
Select commit Hold shift + click to select a range
11b67b9
rewrite the bundler
jkowalleck Oct 6, 2026
b3019dc
testability
jkowalleck Oct 7, 2026
0790280
wip
jkowalleck Oct 7, 2026
9475fd3
wip
jkowalleck Oct 7, 2026
c2da92b
wip
jkowalleck Oct 7, 2026
0e3aa5b
wip
jkowalleck Oct 7, 2026
2d991f4
wip
jkowalleck Oct 7, 2026
6612a21
wip
jkowalleck Oct 7, 2026
db7d0cf
wip
jkowalleck Oct 7, 2026
072041d
wip
jkowalleck Oct 7, 2026
d882b7d
wip
jkowalleck Oct 7, 2026
df9f964
wip
jkowalleck Oct 8, 2026
a802835
wip
jkowalleck Oct 8, 2026
979cd7f
wip
jkowalleck Oct 8, 2026
cc797ce
wip
jkowalleck Oct 8, 2026
b8f09cc
wip
jkowalleck Oct 8, 2026
cc751c6
wip
jkowalleck Oct 8, 2026
34d1ac0
wip
jkowalleck Oct 8, 2026
5291b5b
wip
jkowalleck Oct 8, 2026
3e378ea
wip
jkowalleck Oct 8, 2026
ae5f63f
wip
jkowalleck Oct 8, 2026
acb1751
wip
jkowalleck Oct 8, 2026
e9ee121
wip
jkowalleck Oct 8, 2026
e01a610
wip
jkowalleck Oct 8, 2026
e09dd00
wip
jkowalleck Oct 8, 2026
914101f
wip
jkowalleck Oct 8, 2026
eaafcc5
wip
jkowalleck Oct 8, 2026
48a20d1
wip
jkowalleck Oct 8, 2026
95948e5
wip
jkowalleck Oct 8, 2026
c5f4b74
wip
jkowalleck Oct 8, 2026
a7b5d2d
wip
jkowalleck Oct 8, 2026
48760eb
wip
jkowalleck Oct 8, 2026
67f3df5
run bundler
jkowalleck Oct 8, 2026
31fa803
wip
jkowalleck Oct 8, 2026
6f0527e
wip
jkowalleck Oct 8, 2026
ab61605
wip
jkowalleck Oct 8, 2026
cf913ba
wip
jkowalleck Oct 8, 2026
d363051
wip
jkowalleck Oct 8, 2026
d0c1a59
wip
jkowalleck Oct 8, 2026
a737fd7
wip
jkowalleck Oct 8, 2026
3bb9c80
wip
jkowalleck Oct 8, 2026
9806e1e
wip
jkowalleck Oct 8, 2026
2b5845b
wip
jkowalleck Oct 8, 2026
099d5b0
wip
jkowalleck Oct 8, 2026
34259f2
wip
jkowalleck Oct 8, 2026
d767451
wip
jkowalleck Oct 8, 2026
b55a6b7
wip
jkowalleck Oct 8, 2026
a067796
wip
jkowalleck Oct 9, 2026
3a33f15
wip
jkowalleck Oct 9, 2026
740b831
wip
jkowalleck Oct 9, 2026
6240eba
wip
jkowalleck Oct 9, 2026
da014c0
wip
jkowalleck Oct 9, 2026
7315023
wip
jkowalleck Oct 9, 2026
b1c3f5d
wip
jkowalleck Oct 9, 2026
03a4627
wip
jkowalleck Oct 9, 2026
be45b9c
wip
jkowalleck Oct 9, 2026
c9170f4
wip
jkowalleck Oct 10, 2026
3018ad4
wip
jkowalleck Oct 10, 2026
9274369
wip
jkowalleck Oct 10, 2026
8849b4b
wip
jkowalleck Oct 10, 2026
28833b1
wip
jkowalleck Oct 10, 2026
7f68ab0
wip
jkowalleck Oct 10, 2026
0694a36
wip
jkowalleck Oct 10, 2026
1fb5926
wip
jkowalleck Oct 10, 2026
173499a
wip
jkowalleck Oct 10, 2026
406ced3
wip
jkowalleck Oct 10, 2026
cece238
wip
jkowalleck Oct 10, 2026
eabd44b
wip
jkowalleck Oct 10, 2026
455c810
chore(bundler): regression test for `$comment` bug
jkowalleck Oct 10, 2026
9fbe488
tests
jkowalleck Oct 10, 2026
9ab8600
ci
jkowalleck Oct 10, 2026
80f4be5
zizmor
jkowalleck Oct 10, 2026
07b0bf1
ci
jkowalleck Oct 10, 2026
ee0e838
wip
jkowalleck Oct 10, 2026
6638f01
Merge branch '2.0-dev_bundler-regression-comment' into 2.0-dev_bundle…
jkowalleck Oct 10, 2026
8f12a6c
tests
jkowalleck Oct 12, 2026
fa65d63
tidy
jkowalleck Oct 12, 2026
913e657
docs
jkowalleck Oct 12, 2026
2a8302e
docs
jkowalleck Oct 12, 2026
deb7d47
revert schemas
jkowalleck Oct 12, 2026
1124898
fix
jkowalleck Oct 12, 2026
22d005c
fix
jkowalleck Oct 12, 2026
d9e6555
fix
jkowalleck Oct 12, 2026
3e65fd0
fix
jkowalleck Oct 12, 2026
e71ab48
chore: update bundled schemas [skip ci]
github-actions[bot] Oct 12, 2026
244ab38
tests
jkowalleck Oct 12, 2026
7f74b21
revert schema
jkowalleck Oct 12, 2026
021a0a9
chore: update bundled schemas [skip ci]
github-actions[bot] Oct 12, 2026
77577d8
fix
jkowalleck Oct 12, 2026
1654391
ct: alway test bundled
jkowalleck Oct 12, 2026
5cf2e33
fix
jkowalleck Oct 12, 2026
8e6e09a
fix
jkowalleck Oct 12, 2026
b4c4f11
fix
jkowalleck Oct 12, 2026
856b119
ci: lint
jkowalleck Oct 13, 2026
53ba1f4
ci: lint
jkowalleck Oct 13, 2026
f6acc5a
schemarevert
jkowalleck Oct 13, 2026
b7199f1
ci
jkowalleck Oct 13, 2026
6d8df21
ci
jkowalleck Oct 13, 2026
ca2cde2
chore: update bundled schemas [skip ci]
github-actions[bot] Oct 13, 2026
800e832
conf
jkowalleck Oct 13, 2026
5461f39
conf
jkowalleck Oct 13, 2026
b3fc733
Merge remote-tracking branch 'origin/2.0-dev' into 2.0-dev_bundler-re…
jkowalleck Oct 13, 2026
67ec620
cleanup
jkowalleck Oct 13, 2026
d6e1cc8
cleanup
jkowalleck Oct 13, 2026
bb08d5a
Merge remote-tracking branch 'origin/2.0-dev' into 2.0-dev_bundler-re…
jkowalleck Oct 13, 2026
1a9049e
docs
jkowalleck Oct 13, 2026
90cdc39
cleanup
jkowalleck Oct 13, 2026
286914b
cleanup
jkowalleck Oct 14, 2026
8720b0d
ci
jkowalleck Oct 14, 2026
b4f0021
ci
jkowalleck Oct 14, 2026
c140a9a
Merge remote-tracking branch 'origin/2.0-dev' into 2.0-dev_bundler-re…
jkowalleck Oct 14, 2026
deaf40f
bundled
jkowalleck Oct 14, 2026
5665afe
ci
jkowalleck Oct 14, 2026
b42277e
revert-bundled
jkowalleck Oct 14, 2026
7a8930a
ci
jkowalleck Oct 14, 2026
82ed779
streamline
jkowalleck Oct 14, 2026
81c639e
ci
jkowalleck Oct 14, 2026
9d5e12e
chore: update bundled schemas [skip ci]
github-actions[bot] Oct 14, 2026
d742f86
ci
jkowalleck Oct 14, 2026
b24e60f
ci
jkowalleck Oct 14, 2026
5f4bc07
revert-bundled
jkowalleck Oct 14, 2026
b53e475
chore: update bundled schemas
github-actions[bot] Oct 14, 2026
c5cf69b
docs
jkowalleck Oct 15, 2026
9b3756c
ci
jkowalleck Oct 15, 2026
d5ca383
refactor
jkowalleck Oct 15, 2026
4754bdb
readability & docs
jkowalleck Oct 15, 2026
6415b14
rename
jkowalleck Oct 15, 2026
caa9126
docs
jkowalleck Oct 15, 2026
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
11 changes: 11 additions & 0 deletions .config/cyclonedx-2.0-bundled.cdxlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$comment": "This ia a cdxlinter config for file `../schema/2.0/cyclonedx-2.0-bundled[.min].schema.json`",
"checks": {
},
"includeChecks": [
"schema-draft",
"schema-id-pattern",
"schema-id-filepath",
"schema-comment"
]
}
180 changes: 154 additions & 26 deletions .github/workflows/bundle_2.0_schemas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,24 @@ concurrency:
cancel-in-progress: true

# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/controlling-permissions-for-github_token
permissions: {}
permissions: { }

env:
SCHEMA_VERSION: '2.0'
SCHEMA_DIR: schema/2.0
MODULES_DIR: schema/2.0/modules
SOURCE_FILE: schema/2.0/cyclonedx-2.0.schema.json
BUNDLED_FILE: schema/2.0/cyclonedx-2.0-bundled.schema.json
MINIFIED_FILE: schema/2.0/cyclonedx-2.0-bundled.min.schema.json
NODE_VERSION: '24.x'

jobs:
bundle-schemas:
name: Bundle Schemas
outputs:
has_changes: ${{ steps.changes.outputs.has_changes }}
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: write # Required to push changes
env:
MODULES_DIR: schema/2.0/modules
SOURCE_FILE: schema/2.0/cyclonedx-2.0.schema.json
BUNDLED_FILE: schema/2.0/cyclonedx-2.0-bundled.schema.json
MINIFIED_FILE: schema/2.0/cyclonedx-2.0-bundled.min.schema.json
timeout-minutes: 10
steps:
- name: Checkout repository
# see https://github.com/actions/checkout
Expand All @@ -42,32 +46,156 @@ jobs:
# see https://github.com/actions/setup-node
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: '24.x'
node-version: ${{ env.NODE_VERSION }}
package-manager-cache: false
- name: Install dependencies
working-directory: tools/src/main/js/bundler
run: npm ci --no-fund --no-audit
- name: Bundle schemas
run: >
node tools/src/main/js/bundler/cli.js
"$MODULES_DIR" "$SOURCE_FILE"
- name: Detect changes
id: changes
run: |
set -eux
node tools/src/main/js/bundler/bundle-schemas.js \
"$MODULES_DIR" "$SOURCE_FILE"
if git diff --quiet; then
echo "has_changes=false" >> "$GITHUB_OUTPUT"
else
echo "has_changes=true" >> "$GITHUB_OUTPUT"
fi
- name: Upload modified
if: ${{ steps.changes.outputs.has_changes == 'true' }}
# see https://github.com/actions/upload-artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: modified
if-no-files-found: error
path: |
${{ env.BUNDLED_FILE }}
${{ env.MINIFIED_FILE }}
retention-days: 1
test-schemas:
name: Test Bundled Schemas
needs:
- bundle-schemas
if: ${{ needs.bundle-schemas.outputs.has_changes == 'true' }}
runs-on: ubuntu-latest
timeout-minutes: 10
defaults:
run:
working-directory: tools/src/test/js/schema-v2
steps:
- name: Checkout repository
# see https://github.com/actions/checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Download modified
# see https://github.com/actions/download-artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: modified
path: ${{ env.SCHEMA_DIR }}
- name: Setup Node.js
# see https://github.com/actions/setup-node
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: ${{ env.NODE_VERSION }}
package-manager-cache: false
- name: Install Dependencies
run: npm install --no-fund --no-audit
- name: Run test
env:
TEST_BUNDLED_ONLY: true
run: npm run "test:v$SCHEMA_VERSION"
lint-schemas:
name: Lint Bundled Schemas
needs:
- bundle-schemas
if: ${{ needs.bundle-schemas.outputs.has_changes == 'true' }}
runs-on: ubuntu-latest
timeout-minutes: 10
env:
REPORT_FILE: tools/src/main/js/linter/reports/bundled.json
steps:
- name: Checkout repository
# see https://github.com/actions/checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Download modified
# see https://github.com/actions/download-artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: modified
path: ${{ env.SCHEMA_DIR }}
- name: Setup Node.js
# see https://github.com/actions/setup-node
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: ${{ env.NODE_VERSION }}
package-manager-cache: false
- name: Install Dependencies
run: npm ci --no-fund --no-audit
working-directory: tools/src/main/js/linter
- name: Lint schemas
run: |
set -eu
mkdir -p "$(dirname "$REPORT_FILE")"
node tools/src/main/js/linter/cli.js \
--config ".config/cyclonedx-${SCHEMA_VERSION}-bundled.cdxlintrc.json" \
--format json \
"$BUNDLED_FILE" "$MINIFIED_FILE" \
> "$REPORT_FILE"
- name: Make report relative
if: ${{ !cancelled() }}
run: sed -i "s|${GITHUB_WORKSPACE}/||g" "$REPORT_FILE"
- name: Print report
if: ${{ !cancelled() }}
run: cat "$REPORT_FILE"
- name: Artifact report
if: ${{ !cancelled() }}
# https://github.com/actions/upload-artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: report_${{ env.SCHEMA_VERSION }}-bundled
path: ${{ env.REPORT_FILE }}
if-no-files-found: error
push-schemas:
name: Push Bundled Schemas
needs:
- bundle-schemas
- test-schemas
- lint-schemas
if: ${{ needs.bundle-schemas.outputs.has_changes == 'true' }}
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: write # Required to push changes
steps:
- name: Checkout repository
# see https://github.com/actions/checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Download modified
# see https://github.com/actions/download-artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: modified
path: ${{ env.SCHEMA_DIR }}
- name: Check for changes and commit
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -eu

# Add both files (works for both new and modified files)
git add "$BUNDLED_FILE" "$MINIFIED_FILE"

# Check if there are staged changes
if git diff --staged --quiet
then
echo "No changes to bundled schemas"
else
echo "Committing bundled schema changes"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit -m "chore: update bundled schemas [skip ci]"
git push "https://x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
fi
echo "Committing bundled schema changes"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit -sm "chore: update bundled schemas"
echo "Pushing to ${GITHUB_REF_NAME}"
git push \
"https://x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" \
"HEAD:refs/heads/${GITHUB_REF_NAME}"
7 changes: 5 additions & 2 deletions .github/workflows/bundler-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ on:
- 'main'
- '2.0-dev'
paths:
- '.github/workflows/test_bundler.yml' # self
- '.github/workflows/bundler-test.yml' # self
- 'tools/src/main/js/bundler/**'
pull_request:
paths:
- '.github/workflows/test_bundler.yml' # self
- '.github/workflows/bundler-test.yml' # self
- 'tools/src/main/js/bundler/**'
workflow_dispatch: # Allows manual trigger

Expand Down Expand Up @@ -43,7 +43,10 @@ jobs:
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: '24.x'
package-manager-cache: false
- name: Install dependencies
run: npm ci --no-fund --no-audit
- name: Run tests
env:
UPDATE_SNAPSHOTS: 0
run: npm test
13 changes: 1 addition & 12 deletions .github/workflows/lint_2.x_schemas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,6 @@ jobs:
if-no-files-found: error
retention-days: 1
lint-bundled:
if: >-
${{ github.ref == 'refs/heads/master'
|| github.ref == 'refs/heads/main'
|| github.ref == 'refs/heads/2.0-dev'
|| ( github.event_name == 'pull_request'
&& github.base_ref == 'master'
)
}}
needs:
- discover-schema
timeout-minutes: 10
Expand Down Expand Up @@ -175,10 +167,7 @@ jobs:
mkdir -p "$(dirname "$REPORT_FILE")"
# only run checks not carried over from source files
node tools/src/main/js/linter/cli.js \
--include schema-draft \
--include schema-id-pattern \
--include schema-id-filepath \
--include schema-comment \
--config ".config/cyclonedx-${SCHEMA_VERSION}-bundled.cdxlintrc.json" \
--format json \
"${schemas[@]}" \
> "$REPORT_FILE"
Expand Down
52 changes: 44 additions & 8 deletions .github/workflows/test_2.x_js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ on:
branches: ['master', 'main']
pull_request:
workflow_dispatch:
inputs:
test_bundled:
description: 'Also test the committed bundled schema files'
type: boolean
default: false

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -26,9 +31,39 @@ env:
jobs:
discover-schema:
uses: $/.github/workflows/discover_2.x_schema.yml
detect-bundled-changes:
# Bundled schemas are generated and tested by `bundle_2.0_schemas.yml`.
# Here they are only re-tested when a PR actually touches them.
name: Detect bundled schema changes
if: ${{ github.event_name == 'pull_request' }}
timeout-minutes: 5
runs-on: ubuntu-latest
outputs:
changed: ${{ steps.detect.outputs.changed }}
steps:
- name: Checkout
# see https://github.com/actions/checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
# PR checkout is the merge commit; depth 2 brings in both parents,
# so `HEAD^1` is the base branch tip.
fetch-depth: 2
- name: Detect changes
id: detect
working-directory: ${{ github.workspace }}
run: |
if git diff --quiet HEAD^1 HEAD -- 'schema/*/*-bundled*.schema.json'; then
echo 'changed=false' >> "$GITHUB_OUTPUT"
else
echo 'changed=true' >> "$GITHUB_OUTPUT"
fi
test_js:
needs:
- discover-schema
- detect-bundled-changes
# `detect-bundled-changes` is skipped for push/workflow_dispatch - still run the tests then
if: ${{ !cancelled() && !failure() }}
timeout-minutes: 30
runs-on: ubuntu-latest
strategy:
Expand All @@ -52,13 +87,14 @@ jobs:
run: npm install --no-fund --no-audit
- name: Run test
env:
VALIDATE_BUNDLED: >-
${{ github.ref == 'refs/heads/master'
|| github.ref == 'refs/heads/main'
|| github.ref == 'refs/heads/2.0-dev'
|| ( github.event_name == 'pull_request'
&& github.base_ref == 'master'
)
}}
SCHEMA_VERSION: ${{ matrix.schema_version }}
# dispatch: honor the input
# pull_request: only if bundled files changed
# push to master/main: always (rare, and that is where published bundles live)
TEST_BUNDLED: >-
${{ inputs.test_bundled == true
|| needs.detect-bundled-changes.outputs.changed == 'true'
|| github.event_name == 'push'
}}
TEST_BUNDLED_ONLY: false
run: npm run "test:v$SCHEMA_VERSION"
2 changes: 1 addition & 1 deletion schema/2.0/cyclonedx-2.0-bundled.min.schema.json

Large diffs are not rendered by default.

Loading
Loading