Transifex-integration bot is immediately closing its unmerged pull requests

The transifex-integration bot is creating pull requests in our Github repository, but then immediately closing them.

Project: Beyond All Reason Transifex Github integration

Github Integration Settings:

Workflow:

  1. Changes to English source files committed to master branch
  2. Weekly Github action force rebases branch transifex-synchronization-source from master
  3. Transifex uses transifex-synchronization-source as source branch
  4. Translation work done
  5. Transifex creates pull request against transifex-synchronization-source
  6. Github action changes pull request merge target to master
  7. Pull request is merged to master

Issue: The Transifex bot is automatically closing the pull requests created in step 5.

Examples:

  1. PR #3286: PR opened, merge target changed, bot immediately closes PR and deletes branch
  2. PR #3287: PR opened, merge target changed, bot closes PR 32 minutes later, does not delete branch (also note the translation file in the description is not actually the one in the PR)
  3. PR #3288: PR opened and immediately closed, before the Github action even has a chance to change the merge target, does not delete branch
  4. [Counterexample] PR #3089: This is an older PR from a month earlier, everything worked properly, same language as the other PRs

Hypothesis:
The bot treats pull requests as stateless, so rather than tracking PR#12345 as the “true” PR, it only looks for a PR merging the translation files to the source branch transifex-synchronization-source. Thus it sees the PRs with a merge target of master as incorrect, and closes them.

This would explain it closing the pull requests, and why it is not grouping multiple files in the PR as per the project settings. However, in example #3 it closed the PR even though the merge target wasn’t changed, and in example #4 the exact same workflow was previously successful.

Update:
The bot is closing the pull requests when another resource has been fully reviewed, creating a new pull request instead of updating the existing one.

  1. Resource A fully reviewed
  2. Bot opens pull request A with resource A
  3. Github action changes merge target
  4. Resource B fully reviewed
  5. Bot closes pull request A
  6. Bot deletes branch from pull request A
  7. Bot creates pull request B with resource B

Example:
PR #3356: Pull request for Russian resource units.json
PR #3357: Pull request for Russian resource interface.json

Instead of appending interface.json to #3356, it creates #3357 as a separate PR, and for some reason closes #3356.

Thank you for your patience and for bringing this issue to our attention - I apologize for the delay in responding.

Our support team is currently looking into the unexpected behavior of the Transifex-integration bot closing pull requests.

We appreciate the details you’ve provided, and we’ll make sure that you’re updated as soon as we have a solution!

Hello,
I am Christos from Transifex support team.
I have made some tests in your original workflow.

  1. Changes to English source files committed to master branch
  2. Weekly Github action force rebases branch transifex-synchronization-source from master
  3. Transifex uses transifex-synchronization-source as source branch
  4. Translation work done
  5. Transifex creates pull request against transifex-synchronization-source
  6. Github action changes pull request merge target to master
  7. Pull request is merged to master

When I follow this specific workflow everything works as expected. Please see attached image.

Transifex bot never closed the PR that was opened due to the rebase action of the pull request.

I am trying to look into the second workflow you mentioned in your update.

Hi Christos,
Are there any updates on this issue?

Hello,

Yes, we followed the steps in your second example. We have reproduced the behavior you experienced.

Let me escalate this within our team, and I will update you.
Apologies this took a while, it has been a hectic couple of weeks.
I will update as soon as we have details.

Hello again,

Apologies this is taking long. We need some additional information from you please.
Could you please check your github files and see if there are any differences between your main branch and the transifex-synchronization branch, right after the first PR is created and it is rebased from the synch branch to the main.

If you could send us some screenshots from the diffs of the two branches and see this is why the system closes the PR.

Kind regards

There are almost always changes between the two branches.

Step 2 of the workflow force rebases transifex-synchronization-source from master once a week. There is a huge amount of activity on master, so one week’s worth of changes will be quite a lot.

However, I was able to test in the small window between the weekly force rebase when both branches were in sync.

  1. Manual Sync initiated from Transifex, resulting in Russian tips.json file being pushed (other files had no changes detected):

  2. Pull request opened by Transifex bot: PR #3619

  3. Pull request merged to master for a non-translation file: PR #3620

Result: Transifex pull request is not closed, so changes to non-translation files are not the cause.


After this, translation and reviewing was finished in Transifex for another Russian file, units.json.

Result: The bot then closed an deleted the first pull request (PR #3619), and created a new pull request: PR #3621

This is the same result as reported in the message from July 9, and in this case the two branches are completely in sync, other than the changes to the single file in the dummy commit.

Edit:
Subsequently, another Russian file was translated and reviewed, interface.json.

  1. Bot closes and deletes PR #3621 for units.json
  2. Bot opens PR #3622 for interface.json
  3. Bot closes and deletes PR #3622
  4. Bot opens PR #3623 for tips.json

GitHub integration activity log:

Hello! I just wanted to inform you that I have added the information from your last reply to the report created by Christos. Our development team is reviewing this situation.

Hello WatchTheFort,

Thank you for your patience as we investigated this issue. We have reviewed the details and consulted with our team to ensure we address your concerns thoroughly.

It appears that the behavior you’re encountering is a known aspect of the system. Specifically, changing the main branch before merging the updates in a pull request (PR) (switch the main branch in the middle of the process) can disrupt the connection between the PR and Transifex. Transifex is not aware of the updated branch you provide causing the PR to close automatically.We highly recommend the following approach instead:

  1. Begin by merging your changes into the base branch (the one configured in Transifex) as soon as the original PR is opened. This ensures that your PR remains linked and active.
  2. After the merge, proceed by merging your changes from the branch configured in Transifex into the desired main branch.

By following these steps, you can maintain a smoother integration process and avoid interruptions in your PR workflow. If you have any further questions or need additional assistance, please don’t hesitate to reach out.