Skip to content

fix(crowdin_validator): skip validation on crowdin_sync's own PRs - #12

Merged
anthonyraj merged 1 commit into
mainfrom
fix/crowdin-validator-skip-sync-branch
Jul 28, 2026
Merged

fix(crowdin_validator): skip validation on crowdin_sync's own PRs#12
anthonyraj merged 1 commit into
mainfrom
fix/crowdin-validator-skip-sync-branch

Conversation

@anthonyraj

Copy link
Copy Markdown
Collaborator

Bug

`crowdin_pull`'s own self-heal PRs (rolling branch `chore/crowdin-sync`) mirror whatever Crowdin currently has -- including legitimate deletions/edits made via the Crowdin UI/API. That's exactly what `crowdin_validator` otherwise exists to block for hand-edited PRs, so without this fix, `crowdin_pull`'s own PRs get blocked by the very validator meant to protect Crowdin as the source of truth, any time something is removed/changed on Crowdin's side.

Caught live

  1. Deleted a test string directly via the Crowdin API (not hand-editing anything in the repo).
  2. `crowdin_pull` correctly opened chore(l10n): sync strings from Crowdin #11 reflecting the removal.
  3. `crowdin_validator` failed chore(l10n): sync strings from Crowdin #11 with `ERROR: existing string(s) deleted outside the Crowdin UI: hackathon2026CrowdinPullTest` -- even though the deletion genuinely was via the Crowdin UI/API, just reflected through `crowdin_pull` rather than hand-edited in the PR.

Fix

Detect the PR's head branch (via `BITRISE_GIT_BRANCH` -- Bitrise checks PRs out as a detached merge ref, so plain git can't tell) and skip validation entirely when it matches `crowdin_sync.py`'s rolling branch name (`chore/crowdin-sync`, or `CROWDIN_SYNC_BRANCH` if overridden).

Next step after merge

Re-trigger/rebuild #11's `crowdin_validator` check -- it should pass once this fix is on `main`, since PR checks use the merge-ref against current `main`.

crowdin_pull's self-heal PRs (rolling branch chore/crowdin-sync) mirror
whatever Crowdin currently has, including legitimate deletions/edits
made via the Crowdin UI/API -- exactly what this validator otherwise
exists to block for hand-edited PRs. Without this, crowdin_pull's own
PRs get blocked by the very validator meant to protect Crowdin as the
source of truth, whenever Crowdin-side content is removed or changed.

Caught live: deleted a test string via the Crowdin API, crowdin_pull
correctly opened a PR reflecting the removal (#11), but crowdin_validator
failed it with "existing string(s) deleted outside the Crowdin UI" --
even though the deletion *was* via the Crowdin UI/API, just reflected
through crowdin_pull rather than hand-edited.

Detect the PR's head branch via BITRISE_GIT_BRANCH (Bitrise checks PRs
out as a detached merge ref, so git itself can't tell) and skip
entirely when it matches crowdin_sync.py's rolling branch name.
@anthonyraj anthonyraj self-assigned this Jul 28, 2026
@anthonyraj
anthonyraj merged commit 83abe66 into main Jul 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant