codeant-ai-for-open-source[bot] commented on code in PR #45584:
URL: https://github.com/apache/superset/pull/45584#discussion_r4341213691


##########
.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 }}
+          BRANCH: chore/sync-translation-catalogs-automated
+        run: |
+          git config user.name "GitHub Action"
+          git config user.email "[email protected]"
+          git checkout -b "$BRANCH"
+          git add superset/translations
+          git commit -m "chore(i18n): sync translation catalogs with 
messages.pot" \
+            -m "Automated catch-up: propagates pending messages.pot entries 
into every locale catalog via babel_update.sh. All new entries land 
untranslated (--no-fuzzy-matching); no existing translation is touched."
+          git push --force origin "$BRANCH"

Review Comment:
   **Suggestion:** Each run starts from `master` and force-pushes this fixed 
branch, so manual corrections committed to an open sync PR are discarded on the 
next scheduled run.
   
   **Assessment:** ๐ŸŸ  `Major` ยท ๐Ÿ” `Occurrence: Rarely` ยท ๐Ÿท๏ธ `Logic error`
   
   [![Use CodeAnt 
Skill](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/use-codeant-skill-flat-v2.svg)](https://docs.codeant.ai/cli/resolve-pr-comments-skill)
 [![Fix in 
Cursor](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-cursor-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=b9c632f0f0ee42b8b38cc83615a4c4fc&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
 [![Fix in VSCode 
Claude](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-vscode-claude-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=b9c632f0f0ee42b8b38cc83615a4c4fc&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
   <details>
   <summary><b>Prompt for AI Agent ๐Ÿค– </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** .github/workflows/sync-translation-catalogs.yml
   **Line:** 70:70
   **Comment:**
        *Logic Error: Each run starts from `master` and force-pushes this fixed 
branch, so manual corrections committed to an open sync PR are discarded on the 
next scheduled run.
   
   Validate the correctness of the flagged issue. If correct, How can I resolve 
this? If you propose a fix, implement it and please make it concise.
   Once fix is implemented, also check other comments on the same PR, and ask 
user if the user wants to fix the rest of the comments as well. if said yes, 
then fetch all the comments validate the correctness and implement a minimal fix
   ```
   </details>
   <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F45584&comment_hash=9e90e2a62a106fa30e7c9b5351b3662a6cc4cdf098a057e1c3c0a0907787b212&reaction=like'>๐Ÿ‘</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F45584&comment_hash=9e90e2a62a106fa30e7c9b5351b3662a6cc4cdf098a057e1c3c0a0907787b212&reaction=dislike'>๐Ÿ‘Ž</a>



##########
.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:
   **Suggestion:** Because `GITHUB_TOKEN` creates the PR, GitHub suppresses its 
`pull_request` workflows; required checks such as `babel-extract` never run, 
leaving the generated PR unable to merge.
   
   **Assessment:** ๐ŸŸ  `Major` ยท ๐Ÿ” `Occurrence: Sometimes` ยท ๐Ÿท๏ธ `Api mismatch`
   
   [![Use CodeAnt 
Skill](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/use-codeant-skill-flat-v2.svg)](https://docs.codeant.ai/cli/resolve-pr-comments-skill)
 [![Fix in 
Cursor](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-cursor-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=a9a6457c47144ec49b60654e08e77b51&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
 [![Fix in VSCode 
Claude](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-vscode-claude-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=a9a6457c47144ec49b60654e08e77b51&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
   <details>
   <summary><b>Prompt for AI Agent ๐Ÿค– </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** .github/workflows/sync-translation-catalogs.yml
   **Line:** 61:61
   **Comment:**
        *Api Mismatch: Because `GITHUB_TOKEN` creates the PR, GitHub suppresses 
its `pull_request` workflows; required checks such as `babel-extract` never 
run, leaving the generated PR unable to merge.
   
   Validate the correctness of the flagged issue. If correct, How can I resolve 
this? If you propose a fix, implement it and please make it concise.
   Once fix is implemented, also check other comments on the same PR, and ask 
user if the user wants to fix the rest of the comments as well. if said yes, 
then fetch all the comments validate the correctness and implement a minimal fix
   ```
   </details>
   <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F45584&comment_hash=8482797bc7d85b9f5cd35dde013b62e79815f26ae241462319ae26433f44cca4&reaction=like'>๐Ÿ‘</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F45584&comment_hash=8482797bc7d85b9f5cd35dde013b62e79815f26ae241462319ae26433f44cca4&reaction=dislike'>๐Ÿ‘Ž</a>



-- 
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