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

Cannot add project-wide Add-on 'Squash Git commits' #11469

Closed
2 tasks done
fkressmann opened this issue Apr 23, 2024 · 2 comments
Closed
2 tasks done

Cannot add project-wide Add-on 'Squash Git commits' #11469

fkressmann opened this issue Apr 23, 2024 · 2 comments
Assignees
Labels
bug Something is broken.
Milestone

Comments

@fkressmann
Copy link

Describe the issue

When migrating my Add-Ons to use the new project-level feature introduced in Weblate 5.5 ( #10051 ), I encountered an issue with the 'Squash Git commits' Add-on on project level, trace attached.
I installed other Add-ons on project level ('Add missing languages', 'Automatic translation', 'Cleanup translation files', 'Customize JSON output') and all those worked fine.

The (to me visible) difference to 'Squash Git commits' is the repo scope of this Add-on. On component level, this Add-On works fine. Coming from
https://github.com/WeblateOrg/weblate/blame/b625d4021805fac0297906ddc8365c001d2d4a53/weblate/addons/models.py#L103-L104
This seems to be a fair assumption. I'm just not sure what self.component.linked_component refers to as this seems to be unexpectedly None (maybe cause there is no component yet?)

Running Weblate on OpenShift as a single Container (this setup is running like this for quite some time now, it's not a fresh install)

Finally, this is an awesome project and I'd like to contribute a fix (though not being a Python expert). Happy to receive some guidance, I will have another look at it later this week :)

Thanks,
/Felix

I already tried

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

Steps to reproduce the behavior

Prerequisite: Project with multiple components is setup

  1. Go to the projects 'Add-ons' page {base_url}/addons/project-name/
  2. Select the Add-On 'Squash Git commits'
  3. Configuration of the Add-on does not seem to matter
  4. Save the Add-on

Expected behavior

The Add-on gets added successfully like when it's done on component-level

Screenshots

image

Exception traceback

gunicorn stderr | [2024-04-23 14:20:03,240: ERROR/461] Internal Server Error: /addons/component_name/
gunicorn stderr | Traceback (most recent call last):
gunicorn stderr |   File "/app/venv/lib/python3.12/site-packages/django/core/handlers/exception.py", line 55, in inner
gunicorn stderr |     response = get_response(request)
gunicorn stderr |                ^^^^^^^^^^^^^^^^^^^^^
gunicorn stderr |   File "/app/venv/lib/python3.12/site-packages/django/core/handlers/base.py", line 197, in _get_response
gunicorn stderr |     response = wrapped_callback(request, *callback_args, **callback_kwargs)
gunicorn stderr |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gunicorn stderr |   File "/app/venv/lib/python3.12/site-packages/django/views/generic/base.py", line 104, in view
gunicorn stderr |     return self.dispatch(request, *args, **kwargs)
gunicorn stderr |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gunicorn stderr |   File "/app/venv/lib/python3.12/site-packages/django/views/generic/base.py", line 143, in dispatch
gunicorn stderr |     return handler(request, *args, **kwargs)
gunicorn stderr |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gunicorn stderr |   File "/app/venv/lib/python3.12/site-packages/weblate/addons/views.py", line 108, in post
gunicorn stderr |     instance = form.save()
gunicorn stderr |                ^^^^^^^^^^^
gunicorn stderr |   File "/app/venv/lib/python3.12/site-packages/weblate/addons/forms.py", line 34, in save
gunicorn stderr |     self._addon.configure(self.serialize_form())
gunicorn stderr |   File "/app/venv/lib/python3.12/site-packages/weblate/addons/base.py", line 151, in configure
gunicorn stderr |     self.instance.save()
gunicorn stderr |   File "/app/venv/lib/python3.12/site-packages/weblate/addons/models.py", line 104, in save
gunicorn stderr |     if self.repo_scope and self.component.linked_component:
gunicorn stderr |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gunicorn stderr | AttributeError: 'NoneType' object has no attribute 'linked_component'

How do you run Weblate?

Docker container

Weblate versions

  • Weblate: 5.5
  • Django: 5.0.4
  • siphashc: 2.4.1
  • translate-toolkit: 3.12.2
  • lxml: 5.2.1
  • pillow: 10.3.0
  • nh3: 0.2.17
  • python-dateutil: 2.9.0.post0
  • social-auth-core: 4.5.3
  • social-auth-app-django: 5.4.0
  • django-crispy-forms: 2.1
  • oauthlib: 3.2.2
  • django-compressor: 4.4
  • djangorestframework: 3.15.1
  • django-filter: 24.2
  • django-appconf: 1.0.6
  • user-agents: 2.2.0
  • filelock: 3.13.4
  • rapidfuzz: 3.8.1
  • openpyxl: 3.1.2
  • celery: 5.4.0
  • django-celery-beat: 2.6.0
  • kombu: 5.3.7
  • translation-finder: 2.16
  • weblate-language-data: 2024.3
  • html2text: 2024.2.26
  • pycairo: 1.26.0
  • PyGObject: 3.48.2
  • diff-match-patch: 20230430
  • requests: 2.31.0
  • django-redis: 5.4.0
  • hiredis: 2.3.2
  • sentry-sdk: 1.45.0
  • Cython: 3.0.10
  • misaka: 2.1.1
  • GitPython: 3.1.43
  • borgbackup: 1.2.8
  • pyparsing: 3.1.2
  • ahocorasick_rs: 0.22.0
  • python-redis-lock: 4.0.0
  • charset-normalizer: 3.3.2
  • Python: 3.12.3
  • Git: 2.39.2
  • psycopg: 3.1.18
  • psycopg-binary: 3.1.18
  • phply: 1.2.6
  • ruamel.yaml: 0.18.6
  • tesserocr: 2.6.3
  • boto3: 1.34.88
  • zeep: 4.2.1
  • aeidon: 1.14.1
  • iniparse: 0.5
  • mysqlclient: 2.2.4
  • Mercurial: 6.7.2
  • git-svn: 2.39.2
  • git-review: 2.4.0
  • PostgreSQL server: 15.5
  • Database backends: django.db.backends.postgresql
  • PostgreSQL implementation: psycopg3 (binary)
  • Cache backends: default:RedisCache, avatar:FileBasedCache
  • Email setup: django.core.mail.backends.smtp.EmailBackend: email-smtp.eu-west-1.amazonaws.com
  • OS encoding: filesystem=utf-8, default=utf-8
  • Celery: redis://:ARdsfGs5gsA6GdgRs3gmddds5g63FAWRG63tg@tool-weblate-cache:6379/1, redis://:ARdsfGs5gsA6GdgRs3gmddds5g63FAWRG63tg@tool-weblate-cache:6379/1, regular
  • Platform: Linux 5.14.0-284.50.1.el9_2.x86_64 (x86_64)

Weblate deploy checks

System check identified some issues:

INFOS:
?: (weblate.I021) Error collection is not set up, it is highly recommended for production use
	HINT: https://docs.weblate.org/en/weblate-5.5/admin/install.html#collecting-errors

System check identified 1 issue (1 silenced).

Additional context

No response

@nijel nijel added the bug Something is broken. label Apr 23, 2024
@nijel nijel added this to the 5.5.1 milestone Apr 23, 2024
@nijel nijel self-assigned this Apr 24, 2024
@nijel
Copy link
Member

nijel commented Apr 24, 2024

@ParthS007 we missed this code path. I will fix it.

@nijel nijel closed this as completed in 3196dd5 Apr 24, 2024
Copy link

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