Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When Weblate tries to push changes to a Bitbucket Server repo while a pull request is still open, the translation component is locked #8969

Closed
2 tasks done
bebroll opened this issue Mar 22, 2023 · 3 comments · Fixed by #9047
Assignees
Labels
bug Something is broken.
Milestone

Comments

@bebroll
Copy link

bebroll commented Mar 22, 2023

Describe the issue

I have just been experimenting with the recent support for Bitbucket Server PRs. I was able to successfully create a translation component which uses "Bitbucket Server pull request" as its Version Control System type. When making modifications to the translation component and pushing these via the Repo Maintenance menu, a PR is successfully created.

Now assume that another modification is made in Weblate before the PR is merged. When using the Repo Maintenance menu again to push the changes, the translation component is locked with the alert message "Pull request failed: Only one pull request may be open for a given source and target branch".

Depending on whether "Repository push URL" and "Repository push branch" are specified or not (based on the table in the documentation https://docs.weblate.org/en/latest/admin/continuous.html#push-changes, this would be the difference between "request from fork" and "request from branch"), there is slightly different behavior:

  • When using "request from branch", the original repo is not pushed to and the PR state is not updated.
  • When using "request from fork", Weblate pushes the updated branch to the fork and the updated state of the fork's branch is correctly reflected in the PR.

From my understanding, if a PR is already open, the branch (either in the original repo or in the fork) should simply be pushed to. Weblate does not have to lock the translation component if creating the PR fails.

PS: I found only one related open issue on the matter (#2344). But this issue is the original request to add support for Bitbucket PRs which was used as the starting point for the recently implemented Bitbucket PR support.

I already tried

  • I've read and searched the documentation.
  • I've searched for similar issues in this repository.

Steps to reproduce the behavior

  1. Create a translation project
  2. Create a translation component with "Bitbucket Server pull request" Version Control System; leave "Repository push URL" and "Push branch" empty
  3. Make a change in the translation component and use Manage > Repository Maintenance > Push
  4. Observe that a PR is created based on a branch in a fork of the original repo
  5. Make another change in the translation component and use Manage > Repository Maintenance > Push
  6. Observe that the operation fails with the message "Pull request failed: Only one pull request may be open for a given source and target branch" and that the translation component is locked
  7. Observe that the PR created in step (3) now contains the changes that were made in (5)

Expected behavior

If a PR already exists in Bitbucket, the latest changes should be pushed and the translation component should not be locked.

Screenshots

No response

Exception traceback

No response

How do you run Weblate?

Docker container

Weblate versions

  • Weblate: 4.16.4
  • Django: 4.1.7
  • siphashc: 2.1
  • translate-toolkit: 3.8.6
  • lxml: 4.9.2
  • Pillow: 9.4.0
  • nh3: 0.2.8
  • python-dateutil: 2.8.2
  • social-auth-core: 4.4.0
  • social-auth-app-django: 5.1.0
  • django-crispy-forms: 2.0
  • oauthlib: 3.2.2
  • django-compressor: 4.3.1
  • djangorestframework: 3.14.0
  • django-filter: 22.1
  • django-appconf: 1.0.5
  • user-agents: 2.2.0
  • filelock: 3.10.0
  • rapidfuzz: 2.13.7
  • openpyxl: 3.1.2
  • celery: 5.2.7
  • django-celery-beat: 2.5.0
  • kombu: 5.2.4
  • translation-finder: 2.15
  • weblate-language-data: 2023.3
  • html2text: 2020.1.16
  • pycairo: 1.23.0
  • pygobject: 3.42.2
  • diff-match-patch: 20200713
  • requests: 2.28.2
  • django-redis: 5.2.0
  • hiredis: 2.2.2
  • sentry_sdk: 1.16.0
  • Cython: 0.29.33
  • misaka: 2.1.1
  • GitPython: 3.1.31
  • borgbackup: 1.2.3
  • pyparsing: 3.0.9
  • pyahocorasick: 2.0.0
  • python-redis-lock: 4.0.0
  • charset-normalizer: 3.1.0
  • Python: 3.11.2
  • Git: 2.30.2
  • psycopg2: 2.9.5
  • psycopg2-binary: 2.9.5
  • phply: 1.2.6
  • ruamel.yaml: 0.17.21
  • tesserocr: 2.6.0
  • boto3: 1.26.92
  • zeep: 4.2.1
  • aeidon: 1.12
  • iniparse: 0.5
  • mysqlclient: 2.1.1
  • Mercurial: 6.3.3
  • git-svn: 2.30.2
  • git-review: 2.3.1
  • Redis server: 6.2.7
  • PostgreSQL server: 14.5
  • Database backends: django.db.backends.postgresql
  • Cache backends: default:RedisCache, avatar:FileBasedCache
  • Email setup: django.core.mail.backends.smtp.EmailBackend: smtp.ionos.de
  • OS encoding: filesystem=utf-8, default=utf-8
  • Celery: redis://redis:6379/1, redis://redis:6379/1, regular
  • Platform: Linux 5.15.0-57-generic (x86_64)

Weblate deploy checks

Nothing related.

Additional context

No response

@nijel
Copy link
Member

nijel commented Mar 23, 2023

@afridlund85 maybe you want to take a look at this as an author of #8706? Thanks.

@nijel nijel added the bug Something is broken. label Mar 23, 2023
@afridlund85
Copy link
Contributor

I will try and look into this soon.

@github-actions
Copy link

github-actions bot commented Apr 6, 2023

Thank you for your report; the issue you have reported has just been fixed.

  • In case you see a problem with the fix, please comment on this issue.
  • In case you see a similar problem, please open a separate issue.
  • If you are happy with the outcome, don’t hesitate to support Weblate by making a donation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants