sadpandajoe commented on code in PR #45584:
URL: https://github.com/apache/superset/pull/45584#discussion_r4341822612


##########
.github/workflows/sync-translation-catalogs.yml:
##########
@@ -0,0 +1,79 @@
+name: Sync Translation Catalogs
+
+# superset/translations/messages.pot is kept in sync with source by
+# check_pot_drift.py on every PR, but individual locale .po catalogs can
+# drift behind it: a PR that adds a translatable string is only required to
+# regenerate messages.pot, not to propagate the new entries into every
+# language file via `pybabel update`. Nothing else catches that gap -
+# check_translation_regression.py only compares relative counts between a
+# base ref and a PR, so pre-existing drift cancels out on both sides. This
+# job runs the catch-up on a schedule and opens a PR when there's drift to
+# commit, instead of letting it silently accumulate between manual passes.
+on:
+  schedule:
+    - cron: "0 6 * * 1" # Mondays at 06:00 UTC
+  workflow_dispatch: {}
+
+permissions:
+  contents: read
+
+concurrency:
+  group: sync-translation-catalogs
+  cancel-in-progress: false
+
+jobs:
+  sync-translation-catalogs:
+    runs-on: ubuntu-26.04
+    permissions:
+      contents: write
+      pull-requests: write
+    steps:
+      - name: "Checkout master"
+        uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # 
v7.0.1
+        with:
+          ref: master
+          persist-credentials: true
+
+      - name: Setup Python
+        uses: $/.github/actions/setup-backend/
+
+      - name: Install gettext tools
+        uses: 
awalsh128/cache-apt-pkgs-action@553a35bb8ebd9fcabcb1c9451aa4c98e1b4ca8a9 # 
v1.6.3
+        with:
+          packages: gettext
+          version: 1.0
+
+      - name: Run babel_update
+        run: ./scripts/translations/babel_update.sh
+
+      - name: Check for drift
+        id: diff
+        run: |
+          if git diff --quiet -- superset/translations; then

Review Comment:
   `babel_update.sh` re-extracts `messages.pot` and `pybabel update` rewrites 
every catalog header, including `POT-Creation-Date` (e.g. 
`de/LC_MESSAGES/messages.po` carries one today), so this raw `git diff --quiet` 
will report changes on every run even when no string or translation changed. 
After the first catch-up merges, each Monday would then force-push the branch 
and open a PR containing only timestamp churn. Should the check ignore header 
timestamps, for example by comparing after normalizing `POT-Creation-Date` or 
restoring files whose only diff is that line?



##########
.github/workflows/sync-translation-catalogs.yml:
##########
@@ -0,0 +1,79 @@
+name: Sync Translation Catalogs
+
+# superset/translations/messages.pot is kept in sync with source by
+# check_pot_drift.py on every PR, but individual locale .po catalogs can
+# drift behind it: a PR that adds a translatable string is only required to
+# regenerate messages.pot, not to propagate the new entries into every
+# language file via `pybabel update`. Nothing else catches that gap -
+# check_translation_regression.py only compares relative counts between a
+# base ref and a PR, so pre-existing drift cancels out on both sides. This
+# job runs the catch-up on a schedule and opens a PR when there's drift to
+# commit, instead of letting it silently accumulate between manual passes.
+on:
+  schedule:
+    - cron: "0 6 * * 1" # Mondays at 06:00 UTC
+  workflow_dispatch: {}
+
+permissions:
+  contents: read
+
+concurrency:
+  group: sync-translation-catalogs
+  cancel-in-progress: false
+
+jobs:
+  sync-translation-catalogs:
+    runs-on: ubuntu-26.04
+    permissions:
+      contents: write
+      pull-requests: write
+    steps:
+      - name: "Checkout master"
+        uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # 
v7.0.1
+        with:
+          ref: master
+          persist-credentials: true
+
+      - name: Setup Python
+        uses: $/.github/actions/setup-backend/
+
+      - name: Install gettext tools
+        uses: 
awalsh128/cache-apt-pkgs-action@553a35bb8ebd9fcabcb1c9451aa4c98e1b4ca8a9 # 
v1.6.3
+        with:
+          packages: gettext
+          version: 1.0
+
+      - name: Run babel_update
+        run: ./scripts/translations/babel_update.sh
+
+      - name: Check for drift
+        id: diff
+        run: |
+          if git diff --quiet -- superset/translations; then
+            echo "has_changes=false" >> "$GITHUB_OUTPUT"
+          else
+            echo "has_changes=true" >> "$GITHUB_OUTPUT"
+          fi
+
+      - name: Open or update sync PR
+        if: steps.diff.outputs.has_changes == 'true'
+        env:
+          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Review Comment:
   Agreed—a PR opened with the default `GITHUB_TOKEN` does not fire 
`pull_request` workflows, so the required checks on the sync PR never run and 
it cannot be merged normally. Is the plan to push with a PAT/app token, or to 
have the job dispatch the checks explicitly?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to