docs(faq): convert flask fab freeze question to a proper heading (#43… #104221
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Translations | |
| on: | |
| push: | |
| branches: | |
| - "master" | |
| - "[0-9].[0-9]*" | |
| pull_request: | |
| types: [synchronize, opened, reopened, ready_for_review] | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| # cancel previous workflow jobs for PRs | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| frontend-check-translations: | |
| runs-on: ubuntu-26.04 | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| steps: | |
| - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )" | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| submodules: recursive | |
| - name: Check for file changes | |
| id: check | |
| uses: ./.github/actions/change-detector/ | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Setup Node.js | |
| if: steps.check.outputs.frontend | |
| uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 | |
| with: | |
| node-version-file: "./superset-frontend/.nvmrc" | |
| cache: "npm" | |
| cache-dependency-path: "superset-frontend/package-lock.json" | |
| - name: Install dependencies | |
| if: steps.check.outputs.frontend | |
| uses: ./.github/actions/cached-dependencies | |
| with: | |
| run: npm-install | |
| - name: lint | |
| if: steps.check.outputs.frontend | |
| working-directory: ./superset-frontend | |
| run: | | |
| npm run build-translation | |
| babel-extract: | |
| runs-on: ubuntu-26.04 | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| steps: | |
| - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )" | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| submodules: recursive | |
| - name: Check for file changes | |
| id: check | |
| uses: ./.github/actions/change-detector/ | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Setup Python | |
| if: steps.check.outputs.python == 'true' || steps.check.outputs.frontend == 'true' | |
| uses: ./.github/actions/setup-backend/ | |
| - name: Install gettext tools | |
| if: steps.check.outputs.python == 'true' || steps.check.outputs.frontend == 'true' | |
| uses: awalsh128/cache-apt-pkgs-action@553a35bb8ebd9fcabcb1c9451aa4c98e1b4ca8a9 # v1.6.3 | |
| with: | |
| packages: gettext | |
| version: 1.0 | |
| # Fetch the base ref so we can compare PR-introduced regressions | |
| # against a fair baseline (also runs babel_update against the base | |
| # source) — this isolates the PR's contribution from any pre-existing | |
| # drift on the base branch. | |
| - name: Fetch base ref and create comparison worktree | |
| if: steps.check.outputs.python == 'true' || steps.check.outputs.frontend == 'true' | |
| env: | |
| PR_BASE_REF: ${{ github.event.pull_request.base.ref }} | |
| run: | | |
| # For PRs use the base branch; for direct pushes compare against the previous commit. | |
| BASE_REF="$PR_BASE_REF" | |
| if [ -n "$BASE_REF" ]; then | |
| git fetch --depth=1 origin "$BASE_REF" | |
| else | |
| git fetch --depth=2 origin "$GITHUB_REF" | |
| fi | |
| git worktree add /tmp/base-worktree FETCH_HEAD | |
| # Run babel_update against BASE source + BASE translations. Any drift | |
| # already present on the base branch (source strings that have changed | |
| # without .po updates) shows up here as fuzzies — and will also show | |
| # up in the PR run, so it cancels out in the comparison. | |
| - name: Baseline — run babel_update against BASE source | |
| if: steps.check.outputs.python == 'true' || steps.check.outputs.frontend == 'true' | |
| working-directory: /tmp/base-worktree | |
| run: ./scripts/translations/babel_update.sh | |
| - name: Record baseline translation counts | |
| if: steps.check.outputs.python == 'true' || steps.check.outputs.frontend == 'true' | |
| run: | | |
| python scripts/translations/check_translation_regression.py \ | |
| --count \ | |
| --translations-dir /tmp/base-worktree/superset/translations \ | |
| > /tmp/before.json | |
| # Run babel_update against the PR source and PR translations. This keeps | |
| # committed .po fixes in play while the base babel_update above still | |
| # cancels out translation drift already present on the base branch. | |
| - name: Run babel_update against PR source | |
| if: steps.check.outputs.python == 'true' || steps.check.outputs.frontend == 'true' | |
| run: ./scripts/translations/babel_update.sh | |
| - name: Check for translation regression | |
| id: regression | |
| if: steps.check.outputs.python == 'true' || steps.check.outputs.frontend == 'true' | |
| continue-on-error: true | |
| run: | | |
| python scripts/translations/check_translation_regression.py \ | |
| --compare /tmp/before.json \ | |
| --report /tmp/regression-report.md | |
| # Save the PR number so the comment workflow can post the report without | |
| # needing write permissions on this pull_request-triggered job. | |
| - name: Save PR number for comment workflow | |
| if: >- | |
| github.event_name == 'pull_request' && | |
| steps.regression.outcome == 'failure' | |
| run: echo "${{ github.event.pull_request.number }}" > /tmp/pr-number.txt | |
| - name: Upload regression artifact | |
| if: >- | |
| github.event_name == 'pull_request' && | |
| steps.regression.outcome == 'failure' | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 | |
| with: | |
| name: translation-regression | |
| path: | | |
| /tmp/regression-report.md | |
| /tmp/pr-number.txt | |
| - name: Fail if regression detected | |
| if: steps.regression.outcome == 'failure' | |
| run: exit 1 | |
| actions-timeline: | |
| needs: [frontend-check-translations, babel-extract] | |
| if: always() | |
| runs-on: ubuntu-26.04 | |
| permissions: | |
| actions: read | |
| steps: | |
| - uses: Kesin11/actions-timeline@57fc93f20c6da7fbc14063c6d24a2a5627c799ad # v3.2.0 | |
| with: | |
| expand-composite-actions: true |