From fb4cf67ed2c1d900f154cd307159743c33d212e7 Mon Sep 17 00:00:00 2001 From: Tiago Vaz Date: Thu, 9 Oct 2025 16:53:45 -0300 Subject: [PATCH 01/27] test: trigger failure in check-version-bump.yml --- .github/workflows/check-version-bump.yml | 53 ++++++++++++++++++++++++ .github/workflows/patch-release-main.yml | 7 ---- .github/workflows/patch-release.yml | 21 ++++++++++ .github/workflows/test-and-release.yml | 34 +++++++++++++++ 4 files changed, 108 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/check-version-bump.yml create mode 100644 .github/workflows/patch-release.yml create mode 100644 .github/workflows/test-and-release.yml diff --git a/.github/workflows/check-version-bump.yml b/.github/workflows/check-version-bump.yml new file mode 100644 index 00000000..714842fc --- /dev/null +++ b/.github/workflows/check-version-bump.yml @@ -0,0 +1,53 @@ +name: Check Version Bump + +on: + pull_request: + branches: + - main + +jobs: + check-version: + runs-on: ubuntu-latest + steps: + - name: Checkout PR branch + uses: actions/checkout@v3 + with: + fetch-depth: 0 + ref: ${{ github.head_ref }} + + - name: Get Lerna version from PR branch + id: pr + run: echo "version=$(jq -r .version lerna.json)" >> $GITHUB_OUTPUT + + - name: Checkout main branch + uses: actions/checkout@v3 + with: + fetch-depth: 0 + ref: main + + - name: Get Lerna version from main + id: main + run: echo "version=$(jq -r .version lerna.json)" >> $GITHUB_OUTPUT + + - name: Compare versions and comment if invalid + if: steps.pr.outputs.version <= steps.main.outputs.version + uses: actions/github-script@v6 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const number = context.payload.pull_request.number; + const prVersion = steps.pr.outputs.version; + const mainVersion = steps.main.outputs.version; + const body = `⚠️ A versão do lerna.json no PR (${prVersion}) não é válida.\n\nEla deve ser **maior** que a versão atual da main (${mainVersion}).\n\nPor favor, atualize sua branch com a main e rode o seguinte comando para corrigir:\n\n\`yarn version:patch\``; + await github.rest.issues.createComment({ + issue_number: number, + owner: context.repo.owner, + repo: context.repo.repo, + body + }); + + - name: Fail if version not bumped + if: steps.pr.outputs.version <= steps.main.outputs.version + run: | + echo "A versão do lerna.json no PR não é válida. Atualize sua branch com a main e rode o comando 'yarn version:patch'." + exit 1 diff --git a/.github/workflows/patch-release-main.yml b/.github/workflows/patch-release-main.yml index 9ee800cc..cce63584 100644 --- a/.github/workflows/patch-release-main.yml +++ b/.github/workflows/patch-release-main.yml @@ -40,13 +40,6 @@ jobs: run: yarn install --frozen-lockfile - name: Build libs run: yarn build:libs - - name: Patch version & publish - id: patch - run: | - yarn publish:patch - VERSION=$(node -p 'require("./lerna.json").version') - echo "CURRENT_VERSION=$VERSION" >> $GITHUB_ENV - echo "PREVIOUS_TAG=$(git describe --tags --abbrev=0 --exclude $VERSION 2>/dev/null || echo '')" >> $GITHUB_ENV - name: PR Comment uses: actions/github-script@v6 with: diff --git a/.github/workflows/patch-release.yml b/.github/workflows/patch-release.yml new file mode 100644 index 00000000..614def1a --- /dev/null +++ b/.github/workflows/patch-release.yml @@ -0,0 +1,21 @@ +name: Patch Release + +on: + workflow_run: + workflows: + - test-and-release + types: + - completed + +jobs: + patch-release: + if: ${{ github.event.workflow_run.conclusion == 'success' }} + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Perform patch release + run: | + echo "Performing patch release..." + # Add your patch release commands here diff --git a/.github/workflows/test-and-release.yml b/.github/workflows/test-and-release.yml new file mode 100644 index 00000000..2f55494e --- /dev/null +++ b/.github/workflows/test-and-release.yml @@ -0,0 +1,34 @@ +name: Test and Release + +on: + workflow_run: + workflows: + - check-version-bump.yml + types: + - completed + +jobs: + run-tests: + if: ${{ github.event.workflow_run.conclusion == 'success' }} + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Run tests + run: | + echo "Running tests..." + # Add your test commands here + + release: + if: ${{ github.event.workflow_run.conclusion == 'success' }} + needs: run-tests + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Release + run: | + echo "Releasing..." + # Add your release commands here From 244b9d29cc93008b68e1589802d731168ac857fc Mon Sep 17 00:00:00 2001 From: Tiago Vaz Date: Thu, 9 Oct 2025 17:17:48 -0300 Subject: [PATCH 02/27] fix: adjust workflow dependencies and triggers --- .github/workflows/canary-main.yml | 12 +++++---- .github/workflows/check-version-bump.yml | 16 +++++++---- .github/workflows/patch-release.yml | 21 --------------- .github/workflows/prerelease.yml | 20 -------------- .github/workflows/release.yml | 20 -------------- .github/workflows/test-and-release.yml | 34 ------------------------ 6 files changed, 18 insertions(+), 105 deletions(-) delete mode 100644 .github/workflows/patch-release.yml delete mode 100644 .github/workflows/prerelease.yml delete mode 100644 .github/workflows/release.yml delete mode 100644 .github/workflows/test-and-release.yml diff --git a/.github/workflows/canary-main.yml b/.github/workflows/canary-main.yml index 30d5a77b..77f61ea6 100644 --- a/.github/workflows/canary-main.yml +++ b/.github/workflows/canary-main.yml @@ -1,10 +1,11 @@ name: Canary on: - pull_request: - branches: [main, latest] - types: [opened, synchronize, reopened, ready_for_review] - workflow_dispatch: {} + workflow_run: + workflows: + - Check Version Bump + types: + - completed permissions: contents: write @@ -12,11 +13,12 @@ permissions: packages: write concurrency: - group: canary-pr-${{ github.event.pull_request.number }} + group: canary-${{ github.run_id }} cancel-in-progress: true jobs: canary: + if: ${{ github.event.workflow_run.conclusion == 'success' }} name: Canary publish (tests + publish next) runs-on: ubuntu-latest steps: diff --git a/.github/workflows/check-version-bump.yml b/.github/workflows/check-version-bump.yml index 714842fc..e480496b 100644 --- a/.github/workflows/check-version-bump.yml +++ b/.github/workflows/check-version-bump.yml @@ -1,12 +1,15 @@ name: Check Version Bump on: - pull_request: - branches: - - main + workflow_run: + workflows: + - Packages tests (vitest) + types: + - completed jobs: check-version: + if: ${{ github.event.workflow_run.conclusion == 'success' }} runs-on: ubuntu-latest steps: - name: Checkout PR branch @@ -36,8 +39,8 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} script: | const number = context.payload.pull_request.number; - const prVersion = steps.pr.outputs.version; - const mainVersion = steps.main.outputs.version; + const prVersion = process.env.PR_VERSION; + const mainVersion = process.env.MAIN_VERSION; const body = `⚠️ A versão do lerna.json no PR (${prVersion}) não é válida.\n\nEla deve ser **maior** que a versão atual da main (${mainVersion}).\n\nPor favor, atualize sua branch com a main e rode o seguinte comando para corrigir:\n\n\`yarn version:patch\``; await github.rest.issues.createComment({ issue_number: number, @@ -45,6 +48,9 @@ jobs: repo: context.repo.repo, body }); + env: + PR_VERSION: ${{ steps.pr.outputs.version }} + MAIN_VERSION: ${{ steps.main.outputs.version }} - name: Fail if version not bumped if: steps.pr.outputs.version <= steps.main.outputs.version diff --git a/.github/workflows/patch-release.yml b/.github/workflows/patch-release.yml deleted file mode 100644 index 614def1a..00000000 --- a/.github/workflows/patch-release.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Patch Release - -on: - workflow_run: - workflows: - - test-and-release - types: - - completed - -jobs: - patch-release: - if: ${{ github.event.workflow_run.conclusion == 'success' }} - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Perform patch release - run: | - echo "Performing patch release..." - # Add your patch release commands here diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml deleted file mode 100644 index a9b9c8b7..00000000 --- a/.github/workflows/prerelease.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Pre-release - -on: - pull_request: - types: [closed] - branches: - - main - workflow_dispatch: {} - -permissions: - contents: write # for checkout and tag - pull-requests: write # for comments - packages: write # for publish - -jobs: - disabled: - runs-on: ubuntu-latest - if: false - steps: - - run: echo "Workflow legacy desativado. Use canary-main.yml / patch-release-main.yml / minor-release-latest.yml" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 3cb3f1e5..00000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: release prod -on: - # When Release Pull Request is merged - pull_request: - branches: - - latest - types: [closed] - workflow_dispatch: {} - -permissions: - contents: write # for checkout and tag - pull-requests: write # for comments - packages: write # for publish - -jobs: - disabled: - runs-on: ubuntu-latest - if: false - steps: - - run: echo "Workflow legacy desativado. Use minor-release-latest.yml" diff --git a/.github/workflows/test-and-release.yml b/.github/workflows/test-and-release.yml deleted file mode 100644 index 2f55494e..00000000 --- a/.github/workflows/test-and-release.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Test and Release - -on: - workflow_run: - workflows: - - check-version-bump.yml - types: - - completed - -jobs: - run-tests: - if: ${{ github.event.workflow_run.conclusion == 'success' }} - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Run tests - run: | - echo "Running tests..." - # Add your test commands here - - release: - if: ${{ github.event.workflow_run.conclusion == 'success' }} - needs: run-tests - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Release - run: | - echo "Releasing..." - # Add your release commands here From a661aacd8a1920b0ae59c4a8b4bb65a73161bcfe Mon Sep 17 00:00:00 2001 From: Tiago Vaz Date: Thu, 9 Oct 2025 17:44:36 -0300 Subject: [PATCH 03/27] fix: adjust workflow to validate version bump on PR open --- .github/workflows/check-version-bump.yml | 50 +++++++++++------------- 1 file changed, 22 insertions(+), 28 deletions(-) diff --git a/.github/workflows/check-version-bump.yml b/.github/workflows/check-version-bump.yml index e480496b..3d63c5c3 100644 --- a/.github/workflows/check-version-bump.yml +++ b/.github/workflows/check-version-bump.yml @@ -1,15 +1,14 @@ name: Check Version Bump on: - workflow_run: - workflows: - - Packages tests (vitest) + pull_request: types: - - completed + - opened + - synchronize + - reopened jobs: check-version: - if: ${{ github.event.workflow_run.conclusion == 'success' }} runs-on: ubuntu-latest steps: - name: Checkout PR branch @@ -20,7 +19,10 @@ jobs: - name: Get Lerna version from PR branch id: pr - run: echo "version=$(jq -r .version lerna.json)" >> $GITHUB_OUTPUT + run: | + version=$(jq -r .version lerna.json) + echo "version=$version" >> $GITHUB_OUTPUT + echo "PR_VERSION=$version" >> $GITHUB_ENV - name: Checkout main branch uses: actions/checkout@v3 @@ -30,30 +32,22 @@ jobs: - name: Get Lerna version from main id: main - run: echo "version=$(jq -r .version lerna.json)" >> $GITHUB_OUTPUT + run: | + version=$(jq -r .version lerna.json) + echo "version=$version" >> $GITHUB_OUTPUT + echo "MAIN_VERSION=$version" >> $GITHUB_ENV - name: Compare versions and comment if invalid - if: steps.pr.outputs.version <= steps.main.outputs.version - uses: actions/github-script@v6 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const number = context.payload.pull_request.number; - const prVersion = process.env.PR_VERSION; - const mainVersion = process.env.MAIN_VERSION; - const body = `⚠️ A versão do lerna.json no PR (${prVersion}) não é válida.\n\nEla deve ser **maior** que a versão atual da main (${mainVersion}).\n\nPor favor, atualize sua branch com a main e rode o seguinte comando para corrigir:\n\n\`yarn version:patch\``; - await github.rest.issues.createComment({ - issue_number: number, - owner: context.repo.owner, - repo: context.repo.repo, - body - }); - env: - PR_VERSION: ${{ steps.pr.outputs.version }} - MAIN_VERSION: ${{ steps.main.outputs.version }} + run: | + if [ "$PR_VERSION" -le "$MAIN_VERSION" ]; then + echo "⚠️ A versão do lerna.json no PR ($PR_VERSION) não é válida.\n\nEla deve ser **maior** que a versão atual da main ($MAIN_VERSION).\n\nPor favor, atualize sua branch com a main e rode o seguinte comando para corrigir:\n\n\`yarn version:patch\`" > comment.txt + gh issue comment ${{ github.event.pull_request.number }} --body-file comment.txt + exit 1 + fi - name: Fail if version not bumped - if: steps.pr.outputs.version <= steps.main.outputs.version run: | - echo "A versão do lerna.json no PR não é válida. Atualize sua branch com a main e rode o comando 'yarn version:patch'." - exit 1 + if [ "$PR_VERSION" -le "$MAIN_VERSION" ]; then + echo "A versão do lerna.json no PR não é válida. Atualize sua branch com a main e rode o comando 'yarn version:patch'." + exit 1 + fi From c161e913e8e86baad786bc60bdf45f4316c97064 Mon Sep 17 00:00:00 2001 From: Tiago Vaz Date: Thu, 9 Oct 2025 17:48:25 -0300 Subject: [PATCH 04/27] fix: use sort -V for version comparison in workflows --- .github/workflows/check-version-bump.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check-version-bump.yml b/.github/workflows/check-version-bump.yml index 3d63c5c3..458c7542 100644 --- a/.github/workflows/check-version-bump.yml +++ b/.github/workflows/check-version-bump.yml @@ -39,7 +39,7 @@ jobs: - name: Compare versions and comment if invalid run: | - if [ "$PR_VERSION" -le "$MAIN_VERSION" ]; then + if printf "%s\n%s" "$MAIN_VERSION" "$PR_VERSION" | sort -V | head -n1 | grep -q "$PR_VERSION"; then echo "⚠️ A versão do lerna.json no PR ($PR_VERSION) não é válida.\n\nEla deve ser **maior** que a versão atual da main ($MAIN_VERSION).\n\nPor favor, atualize sua branch com a main e rode o seguinte comando para corrigir:\n\n\`yarn version:patch\`" > comment.txt gh issue comment ${{ github.event.pull_request.number }} --body-file comment.txt exit 1 @@ -47,7 +47,7 @@ jobs: - name: Fail if version not bumped run: | - if [ "$PR_VERSION" -le "$MAIN_VERSION" ]; then + if printf "%s\n%s" "$MAIN_VERSION" "$PR_VERSION" | sort -V | head -n1 | grep -q "$PR_VERSION"; then echo "A versão do lerna.json no PR não é válida. Atualize sua branch com a main e rode o comando 'yarn version:patch'." exit 1 fi From 757169e08443e9ea3a7afe10b4ccb16347da16a9 Mon Sep 17 00:00:00 2001 From: Tiago Vaz Date: Thu, 9 Oct 2025 17:50:12 -0300 Subject: [PATCH 05/27] fix: add GH_TOKEN for GitHub CLI authentication --- .github/workflows/check-version-bump.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/check-version-bump.yml b/.github/workflows/check-version-bump.yml index 458c7542..6906c4e0 100644 --- a/.github/workflows/check-version-bump.yml +++ b/.github/workflows/check-version-bump.yml @@ -44,6 +44,8 @@ jobs: gh issue comment ${{ github.event.pull_request.number }} --body-file comment.txt exit 1 fi + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Fail if version not bumped run: | From ca73001d6e80f4f357d622b66925b7b137491c46 Mon Sep 17 00:00:00 2001 From: Tiago Vaz Date: Thu, 9 Oct 2025 17:58:22 -0300 Subject: [PATCH 06/27] fix: adjust line breaks in GitHub comment --- .github/workflows/check-version-bump.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-version-bump.yml b/.github/workflows/check-version-bump.yml index 6906c4e0..e569ec2d 100644 --- a/.github/workflows/check-version-bump.yml +++ b/.github/workflows/check-version-bump.yml @@ -40,7 +40,7 @@ jobs: - name: Compare versions and comment if invalid run: | if printf "%s\n%s" "$MAIN_VERSION" "$PR_VERSION" | sort -V | head -n1 | grep -q "$PR_VERSION"; then - echo "⚠️ A versão do lerna.json no PR ($PR_VERSION) não é válida.\n\nEla deve ser **maior** que a versão atual da main ($MAIN_VERSION).\n\nPor favor, atualize sua branch com a main e rode o seguinte comando para corrigir:\n\n\`yarn version:patch\`" > comment.txt + echo -e "⚠️ A versão do lerna.json no PR ($PR_VERSION) não é válida.\n\nEla deve ser **MAIOR** que a versão atual da main ($MAIN_VERSION).\n\nPor favor, atualize sua branch com a main e rode o seguinte comando para corrigir:\n\nyarn version:patch" > comment.txt gh issue comment ${{ github.event.pull_request.number }} --body-file comment.txt exit 1 fi From a51d4872340fd54893a6cea143582465a5be8ad7 Mon Sep 17 00:00:00 2001 From: Tiago Vaz Date: Thu, 9 Oct 2025 18:00:01 -0300 Subject: [PATCH 07/27] chore(release): publish v0.9.7 --- lerna.json | 2 +- packages/atlas-theme/package.json | 2 +- packages/aurora-theme/package.json | 2 +- packages/blueberry/package.json | 4 ++-- packages/br-addons/package.json | 2 +- packages/client-core/package.json | 2 +- packages/client/package.json | 8 ++++---- packages/entities/package.json | 2 +- packages/json-schema/package.json | 2 +- packages/lab/package.json | 10 +++++----- packages/material-theme/package.json | 2 +- packages/validators/package.json | 2 +- 12 files changed, 20 insertions(+), 20 deletions(-) diff --git a/lerna.json b/lerna.json index 93e3ce7b..0c1801cc 100644 --- a/lerna.json +++ b/lerna.json @@ -2,7 +2,7 @@ "packages": [ "packages/*" ], - "version": "0.9.6", + "version": "0.9.7", "npmClient": "yarn", "command": { "publish": { diff --git a/packages/atlas-theme/package.json b/packages/atlas-theme/package.json index 2c583eaa..5c5081f6 100644 --- a/packages/atlas-theme/package.json +++ b/packages/atlas-theme/package.json @@ -1,6 +1,6 @@ { "name": "@iq-firebolt/atlas-theme", - "version": "0.9.6", + "version": "0.9.7", "description": "> ATLAS Theme", "author": "iq team", "homepage": "https://github.com/IQ-tech/firebolt#readme", diff --git a/packages/aurora-theme/package.json b/packages/aurora-theme/package.json index efd9fb1a..4d44ba32 100644 --- a/packages/aurora-theme/package.json +++ b/packages/aurora-theme/package.json @@ -1,6 +1,6 @@ { "name": "@iq-firebolt/aurora-theme", - "version": "0.9.6", + "version": "0.9.7", "description": "> AURORA Theme", "author": "iq team", "homepage": "https://github.com/IQ-tech/firebolt#readme", diff --git a/packages/blueberry/package.json b/packages/blueberry/package.json index 335b6e6e..311b52c8 100644 --- a/packages/blueberry/package.json +++ b/packages/blueberry/package.json @@ -1,6 +1,6 @@ { "name": "@iq-firebolt/blueberry-theme", - "version": "0.9.6", + "version": "0.9.7", "description": "> TODO: description", "author": "iq team", "homepage": "https://github.com/IQ-tech/firebolt#readme", @@ -24,7 +24,7 @@ "iq-blueberry": "^0.0.88" }, "devDependencies": { - "@iq-firebolt/validators": "0.9.6", + "@iq-firebolt/validators": "0.9.7", "react": "18.2.0", "react-dom": "18.2.0" }, diff --git a/packages/br-addons/package.json b/packages/br-addons/package.json index 4fb1b36e..a28cea87 100644 --- a/packages/br-addons/package.json +++ b/packages/br-addons/package.json @@ -1,6 +1,6 @@ { "name": "@iq-firebolt/br-addons", - "version": "0.9.6", + "version": "0.9.7", "description": "> TODO: description", "author": "iq team", "homepage": "https://github.com/IQ-tech/firebolt#readme", diff --git a/packages/client-core/package.json b/packages/client-core/package.json index 043df002..f5f0cc86 100644 --- a/packages/client-core/package.json +++ b/packages/client-core/package.json @@ -1,6 +1,6 @@ { "name": "@iq-firebolt/client-core", - "version": "0.9.6", + "version": "0.9.7", "description": "> TODO: description", "author": "iq team", "homepage": "https://github.com/IQ-tech/firebolt#readme", diff --git a/packages/client/package.json b/packages/client/package.json index e30d3d94..20d59376 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@iq-firebolt/client", - "version": "0.9.6", + "version": "0.9.7", "description": "> TODO: description", "author": "iq team", "homepage": "https://github.com/IQ-tech/firebolt#readme", @@ -36,8 +36,8 @@ }, "dependencies": { "@babel/runtime": "^7.16.3", - "@iq-firebolt/client-core": "0.9.6", - "@iq-firebolt/validators": "0.9.6", + "@iq-firebolt/client-core": "0.9.7", + "@iq-firebolt/validators": "0.9.7", "classnames": "^2.3.1", "fast-levenshtein": "^3.0.0", "regex-parser": "^2.2.11", @@ -49,7 +49,7 @@ "@babel/plugin-transform-runtime": "^7.16.0", "@babel/preset-env": "^7.15.6", "@babel/preset-react": "^7.14.5", - "@iq-firebolt/material-theme": "0.9.6", + "@iq-firebolt/material-theme": "0.9.7", "@rollup/plugin-node-resolve": "^16.0.1", "@testing-library/react-hooks": "^7.0.2", "autoprefixer": "^10.4.2", diff --git a/packages/entities/package.json b/packages/entities/package.json index c650bbbe..d7afe557 100644 --- a/packages/entities/package.json +++ b/packages/entities/package.json @@ -1,6 +1,6 @@ { "name": "@iq-firebolt/entities", - "version": "0.9.6", + "version": "0.9.7", "description": "> TODO: description", "author": "iq team", "private": true, diff --git a/packages/json-schema/package.json b/packages/json-schema/package.json index b3043e2c..0db5cec1 100644 --- a/packages/json-schema/package.json +++ b/packages/json-schema/package.json @@ -1,6 +1,6 @@ { "name": "@iq-firebolt/json-schema", - "version": "0.9.6", + "version": "0.9.7", "description": "json schema lib", "author": "iq team", "homepage": "https://github.com/IQ-tech/firebolt#readme", diff --git a/packages/lab/package.json b/packages/lab/package.json index 0d3e2863..244884ab 100644 --- a/packages/lab/package.json +++ b/packages/lab/package.json @@ -1,14 +1,14 @@ { "name": "@iq-firebolt/lab", - "version": "0.9.6", + "version": "0.9.7", "private": true, "license": "Apache-2.0", "dependencies": { - "@iq-firebolt/blueberry-theme": "0.9.6", + "@iq-firebolt/blueberry-theme": "0.9.7", "@iq-firebolt/br-addons": "0.8.3-next.148", - "@iq-firebolt/client": "0.9.6", - "@iq-firebolt/client-core": "0.9.6", - "@iq-firebolt/material-theme": "0.9.6", + "@iq-firebolt/client": "0.9.7", + "@iq-firebolt/client-core": "0.9.7", + "@iq-firebolt/material-theme": "0.9.7", "iq-blueberry": "^0.0.88", "react": "18.2.0", "react-dom": "18.2.0", diff --git a/packages/material-theme/package.json b/packages/material-theme/package.json index d863bbe4..0cffa43e 100644 --- a/packages/material-theme/package.json +++ b/packages/material-theme/package.json @@ -1,6 +1,6 @@ { "name": "@iq-firebolt/material-theme", - "version": "0.9.6", + "version": "0.9.7", "description": "> TODO: description", "author": "iq team", "homepage": "https://github.com/IQ-tech/firebolt#readme", diff --git a/packages/validators/package.json b/packages/validators/package.json index 44dab336..2de54ace 100644 --- a/packages/validators/package.json +++ b/packages/validators/package.json @@ -1,6 +1,6 @@ { "name": "@iq-firebolt/validators", - "version": "0.9.6", + "version": "0.9.7", "description": "> TODO: description", "author": "iq team", "homepage": "https://github.com/IQ-tech/firebolt#readme", From 531104767f40f4604be84da2f8391e4220a27c06 Mon Sep 17 00:00:00 2001 From: Tiago Vaz Date: Thu, 9 Oct 2025 18:03:49 -0300 Subject: [PATCH 08/27] fix: trigger Canary workflow on PR open --- .github/workflows/canary-main.yml | 15 ++++----------- .github/workflows/check-version-bump.yml | 2 +- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/.github/workflows/canary-main.yml b/.github/workflows/canary-main.yml index 77f61ea6..44350823 100644 --- a/.github/workflows/canary-main.yml +++ b/.github/workflows/canary-main.yml @@ -1,11 +1,11 @@ name: Canary on: - workflow_run: - workflows: - - Check Version Bump + pull_request: types: - - completed + - opened + - synchronize + - reopened permissions: contents: write @@ -18,7 +18,6 @@ concurrency: jobs: canary: - if: ${{ github.event.workflow_run.conclusion == 'success' }} name: Canary publish (tests + publish next) runs-on: ubuntu-latest steps: @@ -166,9 +165,3 @@ jobs: script: | const number = context.payload.pull_request.number; const body = 'Canary não publicado: testes falharam. Verifique os logs do workflow.'; - await github.rest.issues.createComment({ - issue_number: number, - owner: context.repo.owner, - repo: context.repo.repo, - body - }); diff --git a/.github/workflows/check-version-bump.yml b/.github/workflows/check-version-bump.yml index e569ec2d..3878ed3d 100644 --- a/.github/workflows/check-version-bump.yml +++ b/.github/workflows/check-version-bump.yml @@ -40,7 +40,7 @@ jobs: - name: Compare versions and comment if invalid run: | if printf "%s\n%s" "$MAIN_VERSION" "$PR_VERSION" | sort -V | head -n1 | grep -q "$PR_VERSION"; then - echo -e "⚠️ A versão do lerna.json no PR ($PR_VERSION) não é válida.\n\nEla deve ser **MAIOR** que a versão atual da main ($MAIN_VERSION).\n\nPor favor, atualize sua branch com a main e rode o seguinte comando para corrigir:\n\nyarn version:patch" > comment.txt + echo -e "⚠️ A versão do lerna.json no PR ($PR_VERSION) não é válida.\n\nEla deve ser **MAIOR** que a versão atual da main ($MAIN_VERSION).\n\nPor favor, atualize sua branch com a main e rode o seguinte comando para corrigir:\n\n`yarn version:patch`" > comment.txt gh issue comment ${{ github.event.pull_request.number }} --body-file comment.txt exit 1 fi From 41381238b6dcc1f5ce8b9bd203fcfc043014de39 Mon Sep 17 00:00:00 2001 From: Tiago Vaz Date: Fri, 10 Oct 2025 11:10:02 -0300 Subject: [PATCH 09/27] chore: disable triggers in check-version-bump workflow --- .github/workflows/canary-main.yml | 27 +++++++++++++++++------- .github/workflows/check-version-bump.yml | 6 +----- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/.github/workflows/canary-main.yml b/.github/workflows/canary-main.yml index 44350823..c27a4172 100644 --- a/.github/workflows/canary-main.yml +++ b/.github/workflows/canary-main.yml @@ -41,6 +41,19 @@ jobs: run: yarn install --frozen-lockfile - name: Build libs run: yarn build:libs + - name: Validate Lerna version + run: | + version=$(jq -r .version lerna.json) + echo "PR_VERSION=$version" >> $GITHUB_ENV + + git fetch origin main + main_version=$(git show origin/main:lerna.json | jq -r .version) + echo "MAIN_VERSION=$main_version" >> $GITHUB_ENV + + if printf "%s\n%s" "$MAIN_VERSION" "$PR_VERSION" | sort -V | head -n1 | grep -q "$PR_VERSION"; then + echo "⚠️ A versão do lerna.json no PR ($PR_VERSION) não é válida.\nEla deve ser maior que a versão atual da main ($MAIN_VERSION).\nPor favor, atualize sua branch com a main e rode o seguinte comando para corrigir:\n\nyarn version:patch" + exit 1 + fi - name: Test client-core (aggregate) run: | set +e @@ -93,15 +106,13 @@ jobs: else echo "Todos os testes passaram em todos os pacotes"; fi - - name: Compute ephemeral canary version - if: success() - id: version + - name: Set canary version run: | - BASE_VERSION=$(node -p 'require("./lerna.json").version') - SHORT_SHA=$(git rev-parse --short HEAD) - EPHEMERAL_VERSION="${BASE_VERSION}-next.${SHORT_SHA}.${GITHUB_RUN_ATTEMPT}" - echo "EPHEMERAL_VERSION=$EPHEMERAL_VERSION" >> $GITHUB_ENV - echo "EPHEMERAL_VERSION=$EPHEMERAL_VERSION" >> $GITHUB_OUTPUT + version=$(jq -r .version lerna.json) + hash=$(git rev-parse --short HEAD) + canary_version="$version-next.$hash" + echo "CANARY_VERSION=$canary_version" >> $GITHUB_ENV + echo "Canary version set to $canary_version" - name: Inject ephemeral version in packages if: success() run: | diff --git a/.github/workflows/check-version-bump.yml b/.github/workflows/check-version-bump.yml index 3878ed3d..090259cf 100644 --- a/.github/workflows/check-version-bump.yml +++ b/.github/workflows/check-version-bump.yml @@ -1,11 +1,7 @@ name: Check Version Bump on: - pull_request: - types: - - opened - - synchronize - - reopened + workflow_dispatch: jobs: check-version: From bd6051d47d0225e867e0cde4cb4b169c6878a50f Mon Sep 17 00:00:00 2001 From: Tiago Vaz Date: Fri, 10 Oct 2025 11:21:18 -0300 Subject: [PATCH 10/27] fix: integrate version validation logic from check-version-bump into canary workflow --- .github/workflows/canary-main.yml | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/.github/workflows/canary-main.yml b/.github/workflows/canary-main.yml index c27a4172..50032e70 100644 --- a/.github/workflows/canary-main.yml +++ b/.github/workflows/canary-main.yml @@ -43,15 +43,26 @@ jobs: run: yarn build:libs - name: Validate Lerna version run: | - version=$(jq -r .version lerna.json) - echo "PR_VERSION=$version" >> $GITHUB_ENV + # Checkout PR branch + git fetch origin ${{ github.head_ref }} + git checkout ${{ github.head_ref }} + + # Get Lerna version from PR branch + pr_version=$(jq -r .version lerna.json) + echo "PR_VERSION=$pr_version" >> $GITHUB_ENV + # Checkout main branch git fetch origin main - main_version=$(git show origin/main:lerna.json | jq -r .version) + git checkout main + + # Get Lerna version from main branch + main_version=$(jq -r .version lerna.json) echo "MAIN_VERSION=$main_version" >> $GITHUB_ENV - if printf "%s\n%s" "$MAIN_VERSION" "$PR_VERSION" | sort -V | head -n1 | grep -q "$PR_VERSION"; then - echo "⚠️ A versão do lerna.json no PR ($PR_VERSION) não é válida.\nEla deve ser maior que a versão atual da main ($MAIN_VERSION).\nPor favor, atualize sua branch com a main e rode o seguinte comando para corrigir:\n\nyarn version:patch" + # Compare versions + if printf "%s\n%s" "$main_version" "$pr_version" | sort -V | head -n1 | grep -q "$pr_version"; then + echo -e "⚠️ A versão do lerna.json no PR ($pr_version) não é válida.\n\nEla deve ser **MAIOR** que a versão atual da main ($main_version).\n\nPor favor, atualize sua branch com a main e rode o seguinte comando para corrigir:\n\n`yarn version:patch`" > comment.txt + gh issue comment ${{ github.event.pull_request.number }} --body-file comment.txt exit 1 fi - name: Test client-core (aggregate) From d5fca75cc410aca76cf0373fe935d5ae9c3c5698 Mon Sep 17 00:00:00 2001 From: Tiago Vaz Date: Fri, 10 Oct 2025 11:53:13 -0300 Subject: [PATCH 11/27] fix: improve canary workflow success message and handle no publication scenario --- .github/workflows/canary-main.yml | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/.github/workflows/canary-main.yml b/.github/workflows/canary-main.yml index 50032e70..225f84b6 100644 --- a/.github/workflows/canary-main.yml +++ b/.github/workflows/canary-main.yml @@ -37,10 +37,6 @@ jobs: npm whoami || true env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - - name: Install deps - run: yarn install --frozen-lockfile - - name: Build libs - run: yarn build:libs - name: Validate Lerna version run: | # Checkout PR branch @@ -59,12 +55,20 @@ jobs: main_version=$(jq -r .version lerna.json) echo "MAIN_VERSION=$main_version" >> $GITHUB_ENV + # Display versions being compared + echo "VERSION MAIN: $main_version" + echo "VERSION PR: $pr_version" + # Compare versions if printf "%s\n%s" "$main_version" "$pr_version" | sort -V | head -n1 | grep -q "$pr_version"; then echo -e "⚠️ A versão do lerna.json no PR ($pr_version) não é válida.\n\nEla deve ser **MAIOR** que a versão atual da main ($main_version).\n\nPor favor, atualize sua branch com a main e rode o seguinte comando para corrigir:\n\n`yarn version:patch`" > comment.txt gh issue comment ${{ github.event.pull_request.number }} --body-file comment.txt exit 1 fi + - name: Install deps + run: yarn install --frozen-lockfile + - name: Build libs + run: yarn build:libs - name: Test client-core (aggregate) run: | set +e @@ -154,8 +158,12 @@ jobs: env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} run: | + echo "Publicando versão canary..." npx lerna publish from-package --dist-tag next --yes --no-verify-access || echo "Nenhum pacote alterado para publicar (ok)" - echo "CURRENT_VERSION=$EPHEMERAL_VERSION" >> $GITHUB_ENV + if [ -n "$CANARY_VERSION" ]; then + echo "CURRENT_VERSION=$CANARY_VERSION" >> $GITHUB_ENV + else + echo "Nenhuma versão publicada." - name: Revert ephemeral commit (keep tree clean for PR) if: success() @@ -172,7 +180,12 @@ jobs: script: | const curr = process.env.CURRENT_VERSION; const number = context.payload.pull_request.number; - const body = `Canary publicado: v${curr}`; + let body; + if (curr) { + body = `Canary publicado: v${curr}`; + } else { + body = 'Nenhuma versão publicada: nenhum pacote foi alterado.'; + } await github.rest.issues.createComment({ issue_number: number, owner: context.repo.owner, From c46caa1db955ae20b72071b86c41564f7ca142ec Mon Sep 17 00:00:00 2001 From: Tiago Vaz Date: Fri, 10 Oct 2025 12:01:34 -0300 Subject: [PATCH 12/27] fix: add debug step to Publish canary for lerna.json validation --- .github/workflows/canary-main.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/canary-main.yml b/.github/workflows/canary-main.yml index 225f84b6..c3d6697c 100644 --- a/.github/workflows/canary-main.yml +++ b/.github/workflows/canary-main.yml @@ -159,6 +159,10 @@ jobs: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} run: | echo "Publicando versão canary..." + echo "Conteúdo do lerna.json:" + cat lerna.json + echo "Versão extraída:" + jq -r .version lerna.json || echo "Erro ao acessar a versão no lerna.json" npx lerna publish from-package --dist-tag next --yes --no-verify-access || echo "Nenhum pacote alterado para publicar (ok)" if [ -n "$CANARY_VERSION" ]; then echo "CURRENT_VERSION=$CANARY_VERSION" >> $GITHUB_ENV From 1d1abdeff16ef387e10a48c81ba200d9e890f5ac Mon Sep 17 00:00:00 2001 From: Tiago Vaz Date: Fri, 10 Oct 2025 12:09:06 -0300 Subject: [PATCH 13/27] refactor: remove ephemeral commit and base canary version on PR version --- .github/workflows/canary-main.yml | 37 +++---------------------------- 1 file changed, 3 insertions(+), 34 deletions(-) diff --git a/.github/workflows/canary-main.yml b/.github/workflows/canary-main.yml index c3d6697c..15f84a30 100644 --- a/.github/workflows/canary-main.yml +++ b/.github/workflows/canary-main.yml @@ -123,36 +123,12 @@ jobs: fi - name: Set canary version run: | - version=$(jq -r .version lerna.json) + pr_version=$(jq -r .version lerna.json) hash=$(git rev-parse --short HEAD) - canary_version="$version-next.$hash" + canary_version="$pr_version-next.$hash" echo "CANARY_VERSION=$canary_version" >> $GITHUB_ENV echo "Canary version set to $canary_version" - - name: Inject ephemeral version in packages - if: success() - run: | - EPV="$EPHEMERAL_VERSION" - echo "Aplicando versão efêmera $EPV nos package.json (sem commit)" - jq --arg v "$EPV" '.version = $v' lerna.json > lerna.tmp && mv lerna.tmp lerna.json - for PKG in packages/*/package.json; do - jq --arg v "$EPV" '.version = $v' "$PKG" > "$PKG.tmp" && mv "$PKG.tmp" "$PKG" || exit 1 - done - - name: Git identity for ephemeral commit - if: success() - run: | - git config --global user.name 'github-actions[bot]' - git config --global user.email 'github-actions[bot]@users.noreply.github.com' - - name: Ephemeral commit (local, not pushed) - if: success() - run: | - echo "HEAD_ORIG=$(git rev-parse HEAD)" >> $GITHUB_ENV - git add lerna.json packages/*/package.json || true - if git diff --cached --quiet; then - echo "Sem mudanças para commit (rerun?)" - else - git commit -m "chore(ci): ephemeral canary version $EPHEMERAL_VERSION" || true - fi - git status --short + - name: Publish canary (no commit/tag) if: success() env: @@ -169,13 +145,6 @@ jobs: else echo "Nenhuma versão publicada." - - name: Revert ephemeral commit (keep tree clean for PR) - if: success() - run: | - if [ -n "$HEAD_ORIG" ]; then - git reset --hard "$HEAD_ORIG" || true - git status --short - fi - name: PR Success Comment if: success() uses: actions/github-script@v6 From 0ca830cad8fe50a456cde7eb9c1f1cd73a65e16a Mon Sep 17 00:00:00 2001 From: Tiago Vaz Date: Fri, 10 Oct 2025 12:18:57 -0300 Subject: [PATCH 14/27] fix: ensure canary version includes '-next' suffix --- .github/workflows/canary-main.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/canary-main.yml b/.github/workflows/canary-main.yml index 15f84a30..cca6a308 100644 --- a/.github/workflows/canary-main.yml +++ b/.github/workflows/canary-main.yml @@ -124,8 +124,11 @@ jobs: - name: Set canary version run: | pr_version=$(jq -r .version lerna.json) + if [[ ! $pr_version == *-next* ]]; then + pr_version="$pr_version-next" + fi hash=$(git rev-parse --short HEAD) - canary_version="$pr_version-next.$hash" + canary_version="$pr_version.$hash" echo "CANARY_VERSION=$canary_version" >> $GITHUB_ENV echo "Canary version set to $canary_version" From 9b9db86dfd93eadf38371a214b4cdb565319d928 Mon Sep 17 00:00:00 2001 From: Tiago Vaz Date: Fri, 10 Oct 2025 12:32:54 -0300 Subject: [PATCH 15/27] fix: ensure branch validation and return to PR branch after main checkout --- .github/workflows/canary-main.yml | 34 ++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/.github/workflows/canary-main.yml b/.github/workflows/canary-main.yml index cca6a308..8e8e334b 100644 --- a/.github/workflows/canary-main.yml +++ b/.github/workflows/canary-main.yml @@ -51,10 +51,17 @@ jobs: git fetch origin main git checkout main + # Log active branch after switching to main + echo "Branch ativa após checkout para main: $(git rev-parse --abbrev-ref HEAD)" + # Get Lerna version from main branch main_version=$(jq -r .version lerna.json) echo "MAIN_VERSION=$main_version" >> $GITHUB_ENV + # Return to PR branch + git checkout ${{ github.head_ref }} + echo "Branch ativa após retornar para PR: $(git rev-parse --abbrev-ref HEAD)" + # Display versions being compared echo "VERSION MAIN: $main_version" echo "VERSION PR: $pr_version" @@ -121,16 +128,36 @@ jobs: else echo "Todos os testes passaram em todos os pacotes"; fi - - name: Set canary version + - name: Confirm branch for tests run: | + echo "Branch atual para execução dos testes: $(git rev-parse --abbrev-ref HEAD)" + + - name: Ensure PR branch is checked out + run: | + git fetch origin ${{ github.head_ref }} + git checkout ${{ github.head_ref }} + echo "Branch do PR garantida: $(git rev-parse --abbrev-ref HEAD)" + - name: Validate and set canary version + run: | + # Ensure we are on the PR branch + echo "Branch atual: $(git rev-parse --abbrev-ref HEAD)" + + # Extract version from lerna.json pr_version=$(jq -r .version lerna.json) + echo "Versão extraída do lerna.json: $pr_version" + + # Ensure the version includes the '-next' suffix if [[ ! $pr_version == *-next* ]]; then pr_version="$pr_version-next" fi + + # Append commit hash to create the canary version hash=$(git rev-parse --short HEAD) canary_version="$pr_version.$hash" + + # Export the canary version echo "CANARY_VERSION=$canary_version" >> $GITHUB_ENV - echo "Canary version set to $canary_version" + echo "Canary version set to: $canary_version" - name: Publish canary (no commit/tag) if: success() @@ -142,11 +169,12 @@ jobs: cat lerna.json echo "Versão extraída:" jq -r .version lerna.json || echo "Erro ao acessar a versão no lerna.json" - npx lerna publish from-package --dist-tag next --yes --no-verify-access || echo "Nenhum pacote alterado para publicar (ok)" if [ -n "$CANARY_VERSION" ]; then + npx lerna publish from-package --dist-tag next --yes --no-verify-access || echo "Nenhum pacote alterado para publicar (ok)" echo "CURRENT_VERSION=$CANARY_VERSION" >> $GITHUB_ENV else echo "Nenhuma versão publicada." + fi - name: PR Success Comment if: success() From a7867c7e43f8c9bd7f142f3c3a8e7a5290b013a7 Mon Sep 17 00:00:00 2001 From: Tiago Vaz Date: Fri, 10 Oct 2025 12:40:35 -0300 Subject: [PATCH 16/27] chore: remove redundant branch validation steps --- .github/workflows/canary-main.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/canary-main.yml b/.github/workflows/canary-main.yml index 8e8e334b..c27f7846 100644 --- a/.github/workflows/canary-main.yml +++ b/.github/workflows/canary-main.yml @@ -128,15 +128,6 @@ jobs: else echo "Todos os testes passaram em todos os pacotes"; fi - - name: Confirm branch for tests - run: | - echo "Branch atual para execução dos testes: $(git rev-parse --abbrev-ref HEAD)" - - - name: Ensure PR branch is checked out - run: | - git fetch origin ${{ github.head_ref }} - git checkout ${{ github.head_ref }} - echo "Branch do PR garantida: $(git rev-parse --abbrev-ref HEAD)" - name: Validate and set canary version run: | # Ensure we are on the PR branch From 5df55cf867d5fba8ed8f46ec635c1433f4cf76dd Mon Sep 17 00:00:00 2001 From: Tiago Vaz Date: Fri, 10 Oct 2025 13:04:13 -0300 Subject: [PATCH 17/27] chore: comment out NPM publish step for error scenario testing --- .github/workflows/canary-main.yml | 34 ++++++++++++++----------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/.github/workflows/canary-main.yml b/.github/workflows/canary-main.yml index c27f7846..8ef7ab70 100644 --- a/.github/workflows/canary-main.yml +++ b/.github/workflows/canary-main.yml @@ -51,9 +51,6 @@ jobs: git fetch origin main git checkout main - # Log active branch after switching to main - echo "Branch ativa após checkout para main: $(git rev-parse --abbrev-ref HEAD)" - # Get Lerna version from main branch main_version=$(jq -r .version lerna.json) echo "MAIN_VERSION=$main_version" >> $GITHUB_ENV @@ -150,22 +147,21 @@ jobs: echo "CANARY_VERSION=$canary_version" >> $GITHUB_ENV echo "Canary version set to: $canary_version" - - name: Publish canary (no commit/tag) - if: success() - env: - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - run: | - echo "Publicando versão canary..." - echo "Conteúdo do lerna.json:" - cat lerna.json - echo "Versão extraída:" - jq -r .version lerna.json || echo "Erro ao acessar a versão no lerna.json" - if [ -n "$CANARY_VERSION" ]; then - npx lerna publish from-package --dist-tag next --yes --no-verify-access || echo "Nenhum pacote alterado para publicar (ok)" - echo "CURRENT_VERSION=$CANARY_VERSION" >> $GITHUB_ENV - else - echo "Nenhuma versão publicada." - fi + # - name: Publish canary (no commit/tag) + # if: success() + # env: + # NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + # run: | + # echo "Publicando versão canary..." + # echo "Conteúdo do lerna.json:" + # cat lerna.json + # echo "Versão extraída:" + # jq -r .version lerna.json || echo "Erro ao acessar a versão no lerna.json" + # if [ -n "$CANARY_VERSION" ]; then + # npx lerna publish from-package --dist-tag next --yes --no-verify-access || echo "Nenhum pacote alterado para publicar (ok)" + # echo "CURRENT_VERSION=$CANARY_VERSION" >> $GITHUB_ENV + # else + # echo "Nenhuma versão publicada." - name: PR Success Comment if: success() From 1c69d00ea2dedba37e8c51dd6b300b2d76379120 Mon Sep 17 00:00:00 2001 From: Tiago Vaz Date: Fri, 10 Oct 2025 14:35:49 -0300 Subject: [PATCH 18/27] test: introduce deliberate versioning error for validation --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index 0c1801cc..93e3ce7b 100644 --- a/lerna.json +++ b/lerna.json @@ -2,7 +2,7 @@ "packages": [ "packages/*" ], - "version": "0.9.7", + "version": "0.9.6", "npmClient": "yarn", "command": { "publish": { From ead33e8974b6e58ff5fe1b5ac7b7168c010321d2 Mon Sep 17 00:00:00 2001 From: Tiago Vaz Date: Fri, 10 Oct 2025 15:10:50 -0300 Subject: [PATCH 19/27] fix: restore workflow order and adjust versioning logic --- .github/workflows/canary-main.yml | 97 +++++++++++++++---------------- lerna.json | 6 +- 2 files changed, 49 insertions(+), 54 deletions(-) diff --git a/.github/workflows/canary-main.yml b/.github/workflows/canary-main.yml index 8ef7ab70..ce4bdae9 100644 --- a/.github/workflows/canary-main.yml +++ b/.github/workflows/canary-main.yml @@ -37,6 +37,12 @@ jobs: npm whoami || true env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: Configure Git identity + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + - name: Set GitHub CLI token + run: echo "GH_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV - name: Validate Lerna version run: | # Checkout PR branch @@ -125,44 +131,48 @@ jobs: else echo "Todos os testes passaram em todos os pacotes"; fi - - name: Validate and set canary version + - name: Compute ephemeral canary version + if: success() + id: version run: | - # Ensure we are on the PR branch - echo "Branch atual: $(git rev-parse --abbrev-ref HEAD)" - - # Extract version from lerna.json - pr_version=$(jq -r .version lerna.json) - echo "Versão extraída do lerna.json: $pr_version" - - # Ensure the version includes the '-next' suffix - if [[ ! $pr_version == *-next* ]]; then - pr_version="$pr_version-next" + BASE_VERSION=$(jq -r .version lerna.json) + CANARY_VERSION="${BASE_VERSION}-next.$(git rev-parse --short HEAD)" + echo "CANARY_VERSION=$CANARY_VERSION" >> $GITHUB_ENV + echo "CANARY_VERSION=$CANARY_VERSION" >> $GITHUB_OUTPUT + - name: Inject ephemeral version in packages + if: success() + run: | + EPV="$CANARY_VERSION" + echo "Aplicando versão efêmera $EPV nos package.json (sem commit)" + jq --arg v "$EPV" '.version = $v' lerna.json > lerna.tmp && mv lerna.tmp lerna.json + for PKG in packages/*/package.json; do + jq --arg v "$EPV" '.version = $v' "$PKG" > "$PKG.tmp" && mv "$PKG.tmp" "$PKG" || exit 1 + done + - name: Ephemeral commit (local, not pushed) + if: success() + run: | + echo "HEAD_ORIG=$(git rev-parse HEAD)" >> $GITHUB_ENV + git add lerna.json packages/*/package.json || true + if git diff --cached --quiet; then + echo "Sem mudanças para commit (rerun?)" + else + git commit -m "chore(ci): ephemeral canary version $CANARY_VERSION" || true + fi + git status --short + - name: Publish canary (no commit/tag) + if: success() + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + run: | + npx lerna publish from-package --dist-tag next --yes --no-verify-access || echo "Nenhum pacote alterado para publicar (ok)" + echo "CURRENT_VERSION=$CANARY_VERSION" >> $GITHUB_ENV + - name: Revert ephemeral commit (keep tree clean for PR) + if: success() + run: | + if [ -n "$HEAD_ORIG" ]; then + git reset --hard "$HEAD_ORIG" || true + git status --short fi - - # Append commit hash to create the canary version - hash=$(git rev-parse --short HEAD) - canary_version="$pr_version.$hash" - - # Export the canary version - echo "CANARY_VERSION=$canary_version" >> $GITHUB_ENV - echo "Canary version set to: $canary_version" - - # - name: Publish canary (no commit/tag) - # if: success() - # env: - # NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - # run: | - # echo "Publicando versão canary..." - # echo "Conteúdo do lerna.json:" - # cat lerna.json - # echo "Versão extraída:" - # jq -r .version lerna.json || echo "Erro ao acessar a versão no lerna.json" - # if [ -n "$CANARY_VERSION" ]; then - # npx lerna publish from-package --dist-tag next --yes --no-verify-access || echo "Nenhum pacote alterado para publicar (ok)" - # echo "CURRENT_VERSION=$CANARY_VERSION" >> $GITHUB_ENV - # else - # echo "Nenhuma versão publicada." - - name: PR Success Comment if: success() uses: actions/github-script@v6 @@ -171,23 +181,10 @@ jobs: script: | const curr = process.env.CURRENT_VERSION; const number = context.payload.pull_request.number; - let body; - if (curr) { - body = `Canary publicado: v${curr}`; - } else { - body = 'Nenhuma versão publicada: nenhum pacote foi alterado.'; - } + const body = `Canary publicado: v${curr}`; await github.rest.issues.createComment({ issue_number: number, owner: context.repo.owner, repo: context.repo.repo, body }); - - name: PR Failure Comment - if: failure() - uses: actions/github-script@v6 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const number = context.payload.pull_request.number; - const body = 'Canary não publicado: testes falharam. Verifique os logs do workflow.'; diff --git a/lerna.json b/lerna.json index 93e3ce7b..b3421534 100644 --- a/lerna.json +++ b/lerna.json @@ -1,7 +1,5 @@ { - "packages": [ - "packages/*" - ], + "packages": ["packages/*"], "version": "0.9.6", "npmClient": "yarn", "command": { @@ -19,4 +17,4 @@ "message": "chore(release): publish %s" } } -} \ No newline at end of file +} From 78964ec43f261bd0f1989cc8e757f5b8b34db71e Mon Sep 17 00:00:00 2001 From: Tiago Vaz Date: Fri, 10 Oct 2025 15:18:22 -0300 Subject: [PATCH 20/27] test: adjust workflow for version validation --- .github/workflows/canary-main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/canary-main.yml b/.github/workflows/canary-main.yml index ce4bdae9..29c3ad0b 100644 --- a/.github/workflows/canary-main.yml +++ b/.github/workflows/canary-main.yml @@ -71,7 +71,7 @@ jobs: # Compare versions if printf "%s\n%s" "$main_version" "$pr_version" | sort -V | head -n1 | grep -q "$pr_version"; then - echo -e "⚠️ A versão do lerna.json no PR ($pr_version) não é válida.\n\nEla deve ser **MAIOR** que a versão atual da main ($main_version).\n\nPor favor, atualize sua branch com a main e rode o seguinte comando para corrigir:\n\n`yarn version:patch`" > comment.txt + echo -e "⚠️ A versão do lerna.json no PR ($pr_version) não é válida.\n\nEla deve ser **MAIOR** que a versão atual da main ($main_version).\n\nPor favor, atualize sua branch com a main e rode o seguinte script para corrigir:\n\n`version:patch`" > comment.txt gh issue comment ${{ github.event.pull_request.number }} --body-file comment.txt exit 1 fi From 545167befc36860f9516cac5e4aaf90f375d2812 Mon Sep 17 00:00:00 2001 From: Tiago Vaz Date: Fri, 10 Oct 2025 15:22:11 -0300 Subject: [PATCH 21/27] test: update version to 0.9.7 for scenario testing --- .github/workflows/canary-main.yml | 2 +- lerna.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/canary-main.yml b/.github/workflows/canary-main.yml index 29c3ad0b..ee1a70a9 100644 --- a/.github/workflows/canary-main.yml +++ b/.github/workflows/canary-main.yml @@ -71,7 +71,7 @@ jobs: # Compare versions if printf "%s\n%s" "$main_version" "$pr_version" | sort -V | head -n1 | grep -q "$pr_version"; then - echo -e "⚠️ A versão do lerna.json no PR ($pr_version) não é válida.\n\nEla deve ser **MAIOR** que a versão atual da main ($main_version).\n\nPor favor, atualize sua branch com a main e rode o seguinte script para corrigir:\n\n`version:patch`" > comment.txt + echo -e "⚠️ A versão do lerna.json no PR ($pr_version) não é válida.\n\nEla deve ser **MAIOR** que a versão atual da main ($main_version).\n\nPor favor, atualize sua branch com a main e rode o seguinte script para corrigir: version:patch" > comment.txt gh issue comment ${{ github.event.pull_request.number }} --body-file comment.txt exit 1 fi diff --git a/lerna.json b/lerna.json index b3421534..f5df3b29 100644 --- a/lerna.json +++ b/lerna.json @@ -1,6 +1,6 @@ { "packages": ["packages/*"], - "version": "0.9.6", + "version": "0.9.7", "npmClient": "yarn", "command": { "publish": { From c5201a1291ac38c4947d9e13e027397bd07a271a Mon Sep 17 00:00:00 2001 From: Tiago Vaz Date: Fri, 10 Oct 2025 15:26:21 -0300 Subject: [PATCH 22/27] test: introduce intentional failure in client package --- packages/client/src/Main.test.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/client/src/Main.test.tsx b/packages/client/src/Main.test.tsx index a2d65dcf..9d78ec3d 100644 --- a/packages/client/src/Main.test.tsx +++ b/packages/client/src/Main.test.tsx @@ -81,3 +81,9 @@ describe("testing props-presets render", () => { ).toBeInTheDocument() }) }) + +describe("Force failure", () => { + it("should fail intentionally", () => { + expect(true).toBe(false) + }) +}) From 45f59e289108e412dc378cf5f39d3cfc71a52879 Mon Sep 17 00:00:00 2001 From: Tiago Vaz Date: Fri, 10 Oct 2025 15:41:28 -0300 Subject: [PATCH 23/27] fix: add json-summary reporter to vitest coverage configuration --- vitest.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vitest.config.ts b/vitest.config.ts index a6c6153c..70036776 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -38,7 +38,7 @@ export default defineConfig({ // Coverage configuration coverage: { provider: "v8", - reporter: ["text", "json", "html", "lcov"], + reporter: ["text", "json", "json-summary", "html", "lcov"], // Added json-summary // Only include files that have corresponding tests all: false, include: [ From 6ab7de7588b853bac563445f2e1e5fcd483e842e Mon Sep 17 00:00:00 2001 From: Tiago Vaz Date: Fri, 10 Oct 2025 15:47:30 -0300 Subject: [PATCH 24/27] fix: remove intentional failing test --- packages/client/src/Main.test.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/client/src/Main.test.tsx b/packages/client/src/Main.test.tsx index 9d78ec3d..613b4050 100644 --- a/packages/client/src/Main.test.tsx +++ b/packages/client/src/Main.test.tsx @@ -83,7 +83,7 @@ describe("testing props-presets render", () => { }) describe("Force failure", () => { - it("should fail intentionally", () => { - expect(true).toBe(false) + it("should pass intentionally", () => { + expect(true).toBe(true) }) }) From c9f37ead64cccc30b9bba4a7fd4fb5bf5b98889e Mon Sep 17 00:00:00 2001 From: Tiago Vaz Date: Fri, 10 Oct 2025 16:21:36 -0300 Subject: [PATCH 25/27] chore: bump versions to 0.9.8 for all packages --- lerna.json | 2 +- packages/atlas-theme/package.json | 2 +- packages/aurora-theme/package.json | 2 +- packages/blueberry/package.json | 4 ++-- packages/br-addons/package.json | 2 +- packages/client-core/package.json | 2 +- packages/client/package.json | 8 ++++---- packages/entities/package.json | 2 +- packages/json-schema/package.json | 2 +- packages/lab/package.json | 12 ++++++------ packages/material-theme/package.json | 2 +- packages/validators/package.json | 2 +- 12 files changed, 21 insertions(+), 21 deletions(-) diff --git a/lerna.json b/lerna.json index f5df3b29..c0029a32 100644 --- a/lerna.json +++ b/lerna.json @@ -1,6 +1,6 @@ { "packages": ["packages/*"], - "version": "0.9.7", + "version": "0.9.8", "npmClient": "yarn", "command": { "publish": { diff --git a/packages/atlas-theme/package.json b/packages/atlas-theme/package.json index 5c5081f6..c2fd1a7d 100644 --- a/packages/atlas-theme/package.json +++ b/packages/atlas-theme/package.json @@ -1,6 +1,6 @@ { "name": "@iq-firebolt/atlas-theme", - "version": "0.9.7", + "version": "0.9.8", "description": "> ATLAS Theme", "author": "iq team", "homepage": "https://github.com/IQ-tech/firebolt#readme", diff --git a/packages/aurora-theme/package.json b/packages/aurora-theme/package.json index 4d44ba32..c0a4341e 100644 --- a/packages/aurora-theme/package.json +++ b/packages/aurora-theme/package.json @@ -1,6 +1,6 @@ { "name": "@iq-firebolt/aurora-theme", - "version": "0.9.7", + "version": "0.9.8", "description": "> AURORA Theme", "author": "iq team", "homepage": "https://github.com/IQ-tech/firebolt#readme", diff --git a/packages/blueberry/package.json b/packages/blueberry/package.json index 311b52c8..6f9a9a2c 100644 --- a/packages/blueberry/package.json +++ b/packages/blueberry/package.json @@ -1,6 +1,6 @@ { "name": "@iq-firebolt/blueberry-theme", - "version": "0.9.7", + "version": "0.9.8", "description": "> TODO: description", "author": "iq team", "homepage": "https://github.com/IQ-tech/firebolt#readme", @@ -24,7 +24,7 @@ "iq-blueberry": "^0.0.88" }, "devDependencies": { - "@iq-firebolt/validators": "0.9.7", + "@iq-firebolt/validators": "0.9.8", "react": "18.2.0", "react-dom": "18.2.0" }, diff --git a/packages/br-addons/package.json b/packages/br-addons/package.json index a28cea87..26062c72 100644 --- a/packages/br-addons/package.json +++ b/packages/br-addons/package.json @@ -1,6 +1,6 @@ { "name": "@iq-firebolt/br-addons", - "version": "0.9.7", + "version": "0.9.8", "description": "> TODO: description", "author": "iq team", "homepage": "https://github.com/IQ-tech/firebolt#readme", diff --git a/packages/client-core/package.json b/packages/client-core/package.json index f5f0cc86..5d94d5a5 100644 --- a/packages/client-core/package.json +++ b/packages/client-core/package.json @@ -1,6 +1,6 @@ { "name": "@iq-firebolt/client-core", - "version": "0.9.7", + "version": "0.9.8", "description": "> TODO: description", "author": "iq team", "homepage": "https://github.com/IQ-tech/firebolt#readme", diff --git a/packages/client/package.json b/packages/client/package.json index 20d59376..4239c0b3 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@iq-firebolt/client", - "version": "0.9.7", + "version": "0.9.8", "description": "> TODO: description", "author": "iq team", "homepage": "https://github.com/IQ-tech/firebolt#readme", @@ -36,8 +36,8 @@ }, "dependencies": { "@babel/runtime": "^7.16.3", - "@iq-firebolt/client-core": "0.9.7", - "@iq-firebolt/validators": "0.9.7", + "@iq-firebolt/client-core": "0.9.8", + "@iq-firebolt/validators": "0.9.8", "classnames": "^2.3.1", "fast-levenshtein": "^3.0.0", "regex-parser": "^2.2.11", @@ -49,7 +49,7 @@ "@babel/plugin-transform-runtime": "^7.16.0", "@babel/preset-env": "^7.15.6", "@babel/preset-react": "^7.14.5", - "@iq-firebolt/material-theme": "0.9.7", + "@iq-firebolt/material-theme": "0.9.8", "@rollup/plugin-node-resolve": "^16.0.1", "@testing-library/react-hooks": "^7.0.2", "autoprefixer": "^10.4.2", diff --git a/packages/entities/package.json b/packages/entities/package.json index d7afe557..ac8637a3 100644 --- a/packages/entities/package.json +++ b/packages/entities/package.json @@ -1,6 +1,6 @@ { "name": "@iq-firebolt/entities", - "version": "0.9.7", + "version": "0.9.8", "description": "> TODO: description", "author": "iq team", "private": true, diff --git a/packages/json-schema/package.json b/packages/json-schema/package.json index 0db5cec1..9a6d2649 100644 --- a/packages/json-schema/package.json +++ b/packages/json-schema/package.json @@ -1,6 +1,6 @@ { "name": "@iq-firebolt/json-schema", - "version": "0.9.7", + "version": "0.9.8", "description": "json schema lib", "author": "iq team", "homepage": "https://github.com/IQ-tech/firebolt#readme", diff --git a/packages/lab/package.json b/packages/lab/package.json index 244884ab..c4178667 100644 --- a/packages/lab/package.json +++ b/packages/lab/package.json @@ -1,14 +1,14 @@ { "name": "@iq-firebolt/lab", - "version": "0.9.7", + "version": "0.9.8", "private": true, "license": "Apache-2.0", "dependencies": { - "@iq-firebolt/blueberry-theme": "0.9.7", - "@iq-firebolt/br-addons": "0.8.3-next.148", - "@iq-firebolt/client": "0.9.7", - "@iq-firebolt/client-core": "0.9.7", - "@iq-firebolt/material-theme": "0.9.7", + "@iq-firebolt/blueberry-theme": "0.9.8", + "@iq-firebolt/br-addons": "0.9.8", + "@iq-firebolt/client": "0.9.8", + "@iq-firebolt/client-core": "0.9.8", + "@iq-firebolt/material-theme": "0.9.8", "iq-blueberry": "^0.0.88", "react": "18.2.0", "react-dom": "18.2.0", diff --git a/packages/material-theme/package.json b/packages/material-theme/package.json index 0cffa43e..86040da2 100644 --- a/packages/material-theme/package.json +++ b/packages/material-theme/package.json @@ -1,6 +1,6 @@ { "name": "@iq-firebolt/material-theme", - "version": "0.9.7", + "version": "0.9.8", "description": "> TODO: description", "author": "iq team", "homepage": "https://github.com/IQ-tech/firebolt#readme", diff --git a/packages/validators/package.json b/packages/validators/package.json index 2de54ace..2c01d7e4 100644 --- a/packages/validators/package.json +++ b/packages/validators/package.json @@ -1,6 +1,6 @@ { "name": "@iq-firebolt/validators", - "version": "0.9.7", + "version": "0.9.8", "description": "> TODO: description", "author": "iq team", "homepage": "https://github.com/IQ-tech/firebolt#readme", From 15f2ec9f8ea42807789565c75774a0a57e4024d9 Mon Sep 17 00:00:00 2001 From: Tiago Vaz Date: Fri, 10 Oct 2025 16:27:53 -0300 Subject: [PATCH 26/27] fix: update patch-release workflow to publish directly to NPM --- .github/workflows/check-version-bump.yml | 51 ------------------------ .github/workflows/patch-release-main.yml | 4 ++ 2 files changed, 4 insertions(+), 51 deletions(-) delete mode 100644 .github/workflows/check-version-bump.yml diff --git a/.github/workflows/check-version-bump.yml b/.github/workflows/check-version-bump.yml deleted file mode 100644 index 090259cf..00000000 --- a/.github/workflows/check-version-bump.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: Check Version Bump - -on: - workflow_dispatch: - -jobs: - check-version: - runs-on: ubuntu-latest - steps: - - name: Checkout PR branch - uses: actions/checkout@v3 - with: - fetch-depth: 0 - ref: ${{ github.head_ref }} - - - name: Get Lerna version from PR branch - id: pr - run: | - version=$(jq -r .version lerna.json) - echo "version=$version" >> $GITHUB_OUTPUT - echo "PR_VERSION=$version" >> $GITHUB_ENV - - - name: Checkout main branch - uses: actions/checkout@v3 - with: - fetch-depth: 0 - ref: main - - - name: Get Lerna version from main - id: main - run: | - version=$(jq -r .version lerna.json) - echo "version=$version" >> $GITHUB_OUTPUT - echo "MAIN_VERSION=$version" >> $GITHUB_ENV - - - name: Compare versions and comment if invalid - run: | - if printf "%s\n%s" "$MAIN_VERSION" "$PR_VERSION" | sort -V | head -n1 | grep -q "$PR_VERSION"; then - echo -e "⚠️ A versão do lerna.json no PR ($PR_VERSION) não é válida.\n\nEla deve ser **MAIOR** que a versão atual da main ($MAIN_VERSION).\n\nPor favor, atualize sua branch com a main e rode o seguinte comando para corrigir:\n\n`yarn version:patch`" > comment.txt - gh issue comment ${{ github.event.pull_request.number }} --body-file comment.txt - exit 1 - fi - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Fail if version not bumped - run: | - if printf "%s\n%s" "$MAIN_VERSION" "$PR_VERSION" | sort -V | head -n1 | grep -q "$PR_VERSION"; then - echo "A versão do lerna.json no PR não é válida. Atualize sua branch com a main e rode o comando 'yarn version:patch'." - exit 1 - fi diff --git a/.github/workflows/patch-release-main.yml b/.github/workflows/patch-release-main.yml index cce63584..a0649bd8 100644 --- a/.github/workflows/patch-release-main.yml +++ b/.github/workflows/patch-release-main.yml @@ -40,6 +40,10 @@ jobs: run: yarn install --frozen-lockfile - name: Build libs run: yarn build:libs + - name: Publish to NPM + run: lerna publish from-package --yes --no-verify-access + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - name: PR Comment uses: actions/github-script@v6 with: From ae2fc24502ed017a1d6d35043ed913998a40bc36 Mon Sep 17 00:00:00 2001 From: Tiago Vaz Date: Fri, 10 Oct 2025 16:33:27 -0300 Subject: [PATCH 27/27] fix: restrict canary workflow to PRs targeting main branch --- .github/workflows/canary-main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/canary-main.yml b/.github/workflows/canary-main.yml index ee1a70a9..1282ef9c 100644 --- a/.github/workflows/canary-main.yml +++ b/.github/workflows/canary-main.yml @@ -6,6 +6,8 @@ on: - opened - synchronize - reopened + branches: + - main permissions: contents: write