From c4b7b87c81c6480486faf087c5649c50fbc74c9a Mon Sep 17 00:00:00 2001 From: Lovisa Berggren Date: Wed, 13 Aug 2025 15:39:50 +0100 Subject: [PATCH 1/5] ci(ipa): release new version 1.0.0 --- tools/spectral/ipa/CHANGELOG.md | 18 ++++++++++++++++++ tools/spectral/ipa/CONTRIBUTING.md | 2 +- tools/spectral/ipa/package.json | 2 +- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/tools/spectral/ipa/CHANGELOG.md b/tools/spectral/ipa/CHANGELOG.md index f12fcce303..af7af560b5 100644 --- a/tools/spectral/ipa/CHANGELOG.md +++ b/tools/spectral/ipa/CHANGELOG.md @@ -1,3 +1,21 @@ ### Changelog All notable changes to this project will be documented in this file. Dates are displayed in UTC. + +#### [1.0.0](https://github.com/mongodb/openapi/compare/ipa-validation-ruleset-v0.0.1...1.0.0) + +- ci(ipa): use release tags for IPA ruleset [`#889`](https://github.com/mongodb/openapi/pull/889) +- fix(ipa): Validate both inline and reusable enums [`#890`](https://github.com/mongodb/openapi/pull/890) +- feat(ipa): error on unneeded exceptions IPA 117-126 [`#881`](https://github.com/mongodb/openapi/pull/881) +- feat(ipa): error on unneeded exceptions IPA 108-114 [`#880`](https://github.com/mongodb/openapi/pull/880) +- feat(ipa): error on unneeded exceptions IPA 105-107 [`#878`](https://github.com/mongodb/openapi/pull/878) +- feat(ipa): error on unneeded exceptions IPA 005-104 [`#877`](https://github.com/mongodb/openapi/pull/877) +- docs(ipa): update ipa readme [`#876`](https://github.com/mongodb/openapi/pull/876) + + + +#### ipa-validation-ruleset-v0.0.1 + +> 8 August 2025 + +First release of IPA Validation Ruleset package. diff --git a/tools/spectral/ipa/CONTRIBUTING.md b/tools/spectral/ipa/CONTRIBUTING.md index c83db9bdcb..3c9c2df596 100644 --- a/tools/spectral/ipa/CONTRIBUTING.md +++ b/tools/spectral/ipa/CONTRIBUTING.md @@ -81,7 +81,7 @@ A new version of the IPA package will be released when the version in the packag - patch (0.0.X) - Backwards-compatible bug fixes - [ ] Update the version number in package.json - [ ] Run `npm run gen-ipa-changelog` and commit the changes. The changelog must be updated alongside a new release. -- [ ] Open a PR and ensure the title is conventional and scoped to IPA (ie: `ci(ipa): release new version`) +- [ ] Open a PR and ensure the title is conventional and scoped to IPA (ie: `ci(ipa): release new version x.x.x`) When your PR is approved and merged to main, the package will be automatically published to the NPM registry. diff --git a/tools/spectral/ipa/package.json b/tools/spectral/ipa/package.json index bbf8029a3b..dae0135a7b 100644 --- a/tools/spectral/ipa/package.json +++ b/tools/spectral/ipa/package.json @@ -1,6 +1,6 @@ { "name": "@mongodb-js/ipa-validation-ruleset", - "version": "0.0.1", + "version": "1.0.0", "description": "Custom validation rules for MongoDB API Standards (IPA).", "keywords": [ "mongodb", From 26e9836d1ad5294a8d1c01aa72d18bbb0b3add08 Mon Sep 17 00:00:00 2001 From: Lovisa Berggren Date: Wed, 13 Aug 2025 15:46:14 +0100 Subject: [PATCH 2/5] fix: test fix --- .github/workflows/ipa-release.yml | 88 ++++++++++++++++--------------- 1 file changed, 45 insertions(+), 43 deletions(-) diff --git a/.github/workflows/ipa-release.yml b/.github/workflows/ipa-release.yml index 1176f03057..43a3427efe 100644 --- a/.github/workflows/ipa-release.yml +++ b/.github/workflows/ipa-release.yml @@ -40,48 +40,50 @@ jobs: version_changed=$(./.github/scripts/ipa_version_check.sh) echo "Version changed? ${version_changed}" echo "version_changed=${version_changed}" >> "${GITHUB_OUTPUT}" - echo "current_version=${jq -r '.version' tools/spectral/ipa/package.json}" >> "${GITHUB_OUTPUT}" + current_version=${jq -r '.version' tools/spectral/ipa/package.json} + echo "Current version: ${current_version}" + echo "current_version=${current_version}" >> "${GITHUB_OUTPUT}" - create-tag: - runs-on: ubuntu-latest - needs: check-version - if: >- - !cancelled() - && inputs.use_existing_tag == 'false' - steps: - - name: Validation of version format - run: | - echo "${{ needs.check-version.outputs.current_version }}" | grep -P '^\d+\.\d+\.\d+$' - - name: Checkout - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - - name: Get the latest commit SHA - id: get-sha - run: echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT" - - name: Create release tag - uses: rickstaa/action-create-tag@a1c7777fcb2fee4f19b0f283ba888afa11678b72 - with: - tag: 'ipa-validation-ruleset-v${{ needs.check-version.outputs.current_version }}' - commit_sha: ${{ steps.get-sha.outputs.sha }} - gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} - gpg_passphrase: ${{ secrets.PASSPHRASE }} - - publish: - needs: check-version - runs-on: ubuntu-latest - permissions: - contents: read - id-token: write - if: ${{ needs.check-version.outputs.version_changed == 'true' || inputs.workflow_call }} - steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - - uses: actions/setup-node@v4 - with: - node-version: '20.x' - registry-url: 'https://registry.npmjs.org' - - run: npm ci - working-directory: tools/spectral/ipa - - run: npm publish --access public - working-directory: tools/spectral/ipa - env: - NODE_AUTH_TOKEN: ${{ secrets.IPA_VALIDATION_NPM_TOKEN }} +# create-tag: +# runs-on: ubuntu-latest +# needs: check-version +# if: >- +# !cancelled() +# && inputs.use_existing_tag == 'false' +# steps: +# - name: Validation of version format +# run: | +# echo "${{ needs.check-version.outputs.current_version }}" | grep -P '^\d+\.\d+\.\d+$' +# - name: Checkout +# uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 +# - name: Get the latest commit SHA +# id: get-sha +# run: echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT" +# - name: Create release tag +# uses: rickstaa/action-create-tag@a1c7777fcb2fee4f19b0f283ba888afa11678b72 +# with: +# tag: 'ipa-validation-ruleset-v${{ needs.check-version.outputs.current_version }}' +# commit_sha: ${{ steps.get-sha.outputs.sha }} +# gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} +# gpg_passphrase: ${{ secrets.PASSPHRASE }} +# +# publish: +# needs: check-version +# runs-on: ubuntu-latest +# permissions: +# contents: read +# id-token: write +# if: ${{ needs.check-version.outputs.version_changed == 'true' || inputs.workflow_call }} +# steps: +# - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 +# - uses: actions/setup-node@v4 +# with: +# node-version: '20.x' +# registry-url: 'https://registry.npmjs.org' +# - run: npm ci +# working-directory: tools/spectral/ipa +# - run: npm publish --access public +# working-directory: tools/spectral/ipa +# env: +# NODE_AUTH_TOKEN: ${{ secrets.IPA_VALIDATION_NPM_TOKEN }} \ No newline at end of file From 7e493e22827b5b5ce6d3d3af6f60fdb675d798fc Mon Sep 17 00:00:00 2001 From: Lovisa Berggren Date: Wed, 13 Aug 2025 15:49:55 +0100 Subject: [PATCH 3/5] fix: test fix --- .github/workflows/ipa-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ipa-release.yml b/.github/workflows/ipa-release.yml index 43a3427efe..b297d2b07a 100644 --- a/.github/workflows/ipa-release.yml +++ b/.github/workflows/ipa-release.yml @@ -40,7 +40,7 @@ jobs: version_changed=$(./.github/scripts/ipa_version_check.sh) echo "Version changed? ${version_changed}" echo "version_changed=${version_changed}" >> "${GITHUB_OUTPUT}" - current_version=${jq -r '.version' tools/spectral/ipa/package.json} + current_version=$(jq -r '.version' tools/spectral/ipa/package.json) echo "Current version: ${current_version}" echo "current_version=${current_version}" >> "${GITHUB_OUTPUT}" From d74883b28f30daa0547e43e4bd33b1f760b0cd6e Mon Sep 17 00:00:00 2001 From: Lovisa Berggren Date: Wed, 13 Aug 2025 15:52:08 +0100 Subject: [PATCH 4/5] fix: release workflow --- .github/workflows/ipa-release.yml | 84 +++++++++++++++---------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/.github/workflows/ipa-release.yml b/.github/workflows/ipa-release.yml index b297d2b07a..e3263827ed 100644 --- a/.github/workflows/ipa-release.yml +++ b/.github/workflows/ipa-release.yml @@ -44,46 +44,46 @@ jobs: echo "Current version: ${current_version}" echo "current_version=${current_version}" >> "${GITHUB_OUTPUT}" -# create-tag: -# runs-on: ubuntu-latest -# needs: check-version -# if: >- -# !cancelled() -# && inputs.use_existing_tag == 'false' -# steps: -# - name: Validation of version format -# run: | -# echo "${{ needs.check-version.outputs.current_version }}" | grep -P '^\d+\.\d+\.\d+$' -# - name: Checkout -# uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 -# - name: Get the latest commit SHA -# id: get-sha -# run: echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT" -# - name: Create release tag -# uses: rickstaa/action-create-tag@a1c7777fcb2fee4f19b0f283ba888afa11678b72 -# with: -# tag: 'ipa-validation-ruleset-v${{ needs.check-version.outputs.current_version }}' -# commit_sha: ${{ steps.get-sha.outputs.sha }} -# gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} -# gpg_passphrase: ${{ secrets.PASSPHRASE }} -# -# publish: -# needs: check-version -# runs-on: ubuntu-latest -# permissions: -# contents: read -# id-token: write -# if: ${{ needs.check-version.outputs.version_changed == 'true' || inputs.workflow_call }} -# steps: -# - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 -# - uses: actions/setup-node@v4 -# with: -# node-version: '20.x' -# registry-url: 'https://registry.npmjs.org' -# - run: npm ci -# working-directory: tools/spectral/ipa -# - run: npm publish --access public -# working-directory: tools/spectral/ipa -# env: -# NODE_AUTH_TOKEN: ${{ secrets.IPA_VALIDATION_NPM_TOKEN }} + create-tag: + runs-on: ubuntu-latest + needs: check-version + if: >- + !cancelled() + && inputs.use_existing_tag == 'false' + steps: + - name: Validation of version format + run: | + echo "${{ needs.check-version.outputs.current_version }}" | grep -P '^\d+\.\d+\.\d+$' + - name: Checkout + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 + - name: Get the latest commit SHA + id: get-sha + run: echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT" + - name: Create release tag + uses: rickstaa/action-create-tag@a1c7777fcb2fee4f19b0f283ba888afa11678b72 + with: + tag: 'ipa-validation-ruleset-v${{ needs.check-version.outputs.current_version }}' + commit_sha: ${{ steps.get-sha.outputs.sha }} + gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} + gpg_passphrase: ${{ secrets.PASSPHRASE }} + + publish: + needs: check-version + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + if: ${{ needs.check-version.outputs.version_changed == 'true' || inputs.workflow_call }} + steps: + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 + - uses: actions/setup-node@v4 + with: + node-version: '20.x' + registry-url: 'https://registry.npmjs.org' + - run: npm ci + working-directory: tools/spectral/ipa + - run: npm publish --access public + working-directory: tools/spectral/ipa + env: + NODE_AUTH_TOKEN: ${{ secrets.IPA_VALIDATION_NPM_TOKEN }} \ No newline at end of file From e47ad942b3213c44575e76db59af8a13f27f0069 Mon Sep 17 00:00:00 2001 From: Lovisa Berggren Date: Wed, 13 Aug 2025 16:10:08 +0100 Subject: [PATCH 5/5] fix: ignore ci commits --- tools/spectral/ipa/CHANGELOG.md | 1 - tools/spectral/ipa/package.json | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/spectral/ipa/CHANGELOG.md b/tools/spectral/ipa/CHANGELOG.md index af7af560b5..4641ccf51c 100644 --- a/tools/spectral/ipa/CHANGELOG.md +++ b/tools/spectral/ipa/CHANGELOG.md @@ -4,7 +4,6 @@ All notable changes to this project will be documented in this file. Dates are d #### [1.0.0](https://github.com/mongodb/openapi/compare/ipa-validation-ruleset-v0.0.1...1.0.0) -- ci(ipa): use release tags for IPA ruleset [`#889`](https://github.com/mongodb/openapi/pull/889) - fix(ipa): Validate both inline and reusable enums [`#890`](https://github.com/mongodb/openapi/pull/890) - feat(ipa): error on unneeded exceptions IPA 117-126 [`#881`](https://github.com/mongodb/openapi/pull/881) - feat(ipa): error on unneeded exceptions IPA 108-114 [`#880`](https://github.com/mongodb/openapi/pull/880) diff --git a/tools/spectral/ipa/package.json b/tools/spectral/ipa/package.json index dae0135a7b..9967158307 100644 --- a/tools/spectral/ipa/package.json +++ b/tools/spectral/ipa/package.json @@ -42,6 +42,7 @@ "hideCredit": true, "tagPattern": "ipa-validation-ruleset-v\\d+\\.\\d+\\.\\d+", "tagPrefix": "ipa-validation-ruleset-v", + "ignoreCommitPattern": "^ci.*$", "hideEmptyReleases" : true, "contributors": false }