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

Bad documentation of DEFAULT_PULL_MESSAGE #5618

Closed
surli opened this issue Mar 9, 2021 · 1 comment
Closed

Bad documentation of DEFAULT_PULL_MESSAGE #5618

surli opened this issue Mar 9, 2021 · 1 comment
Assignees
Labels
bug Something is broken.
Milestone

Comments

@surli
Copy link
Contributor

surli commented Mar 9, 2021

Describe the issue

We tried to change the default message for pull request by using the DEFAULT_PULL_MESSAGE settings as documented in https://docs.weblate.org/en/latest/admin/config.html?highlight=pull%20request#default-pull-message and we obtained the following stack:

Mar 09 16:57:17 l10n-prod weblate[3985]: ERROR Failure while executing task
                                         Traceback (most recent call last):
                                           File "/home/weblate/weblate-env/lib/python3.7/site-packages/celery/app/trace.py", line 412, in trace_task
                                             R = retval = fun(*args, **kwargs)
                                           File "/home/weblate/weblate-env/lib/python3.7/site-packages/celery/app/trace.py", line 704, in __protected_call__
                                             return self.run(*args, **kwargs)
                                           File "/home/weblate/weblate-env/lib/python3.7/site-packages/celery/app/autoretry.py", line 35, in run
                                             return task._orig_run(*args, **kwargs)
                                           File "/home/weblate/weblate-env/lib/python3.7/site-packages/weblate/trans/tasks.py", line 103, in perform_push
                                             component.do_push(*args, **kwargs)
                                           File "/home/weblate/weblate-env/lib/python3.7/site-packages/weblate/trans/models/component.py", line 158, in on_link_wrapper
                                             return func(self, *args, **kwargs)
                                           File "/home/weblate/weblate-env/lib/python3.7/site-packages/weblate/trans/models/component.py", line 1380, in do_push
                                             result = self.push_repo(request)
                                           File "/home/weblate/weblate-env/lib/python3.7/site-packages/weblate/trans/models/component.py", line 158, in on_link_wrapper
                                             return func(self, *args, **kwargs)
                                           File "/home/weblate/weblate-env/lib/python3.7/site-packages/weblate/trans/models/component.py", line 1318, in push_repo
                                             self.repository.push(self.push_branch)
                                           File "/home/weblate/weblate-env/lib/python3.7/site-packages/weblate/vcs/git.py", line 708, in push
                                             self.create_pull_request(credentials, self.branch, fork_remote, fork_branch)
                                           File "/home/weblate/weblate-env/lib/python3.7/site-packages/weblate/vcs/git.py", line 792, in create_pull_request
                                             title, description = self.get_merge_message()
                                         ValueError: not enough values to unpack (expected 2, got 1)

I already tried

It appears that the documentation is wrong here: https://docs.weblate.org/en/latest/admin/config.html?highlight=pull%20request#default-pull-message. According to the code this setting is used to provide both the title and the description of the PR by splitting on the first line, and AFAICS the default value is now:

"""Translations update from Weblate

Translations update from [Weblate]({{url}}) for {{ project_name }}/{{ component_name }}.

{% if component.linked_childs %}
It also includes following components:
{% for linked in component.linked_child %}
{{ component.project.name }}/{{ component.name }}
{% endfor %}
{% endif %}

Current translation status:

![Weblate translation status]({{widget_url}})
"""

To Reproduce the issue

Steps to reproduce the behavior:

  1. Edit the settings.py to put DEFAULT_PULL_MESSAGE="My PR title"
  2. Restart weblate and create a translation
  3. Commit and push the translation to create a PR
  4. See error

Expected behavior

Here the behaviour is ok, I think the doc should be just updated.

@nijel nijel added the bug Something is broken. label Mar 9, 2021
@nijel nijel added this to the 4.5.2 milestone Mar 9, 2021
@nijel nijel closed this as completed in 807c771 Mar 9, 2021
@nijel nijel self-assigned this Mar 9, 2021
@github-actions
Copy link

github-actions bot commented Mar 9, 2021

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

No branches or pull requests

2 participants