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

gitlab webhooks don't works with ssh://-sheme repositories #10478

Closed
2 tasks done
makovkindenis opened this issue Nov 24, 2023 · 8 comments
Closed
2 tasks done

gitlab webhooks don't works with ssh://-sheme repositories #10478

makovkindenis opened this issue Nov 24, 2023 · 8 comments
Labels
question This is more a question for the support than an issue.

Comments

@makovkindenis
Copy link

Describe the issue

Hello, i've issue just like #8977
but it seems don't work in weblate 5.2.1

So, selfhosted https://gitlab.mydomain.com and https://weblate.mydomain.com
In weblate there is component with remote repository "ssh://[email protected]:6022/gorup/project.git"
All works fine from weblate - push and pulls.

In gitlab for repo gorup/project.git i've created webhook https://weblate.dikidi.tech/hooks/gitlab/

Weblate response for this hook:
{"status": "failure", "message": "No matching repositories found!", "match_status": {"repository_matches": 1, "branch_matches": 0, "enabled_hook_matches": 0}}

Weblate logs:
gunicorn stderr | [2023-11-24 11:35:19,606: INFO/429] received GitLab notification on repository //[email protected]:6022/group/project, URL https://gitlab.mydomain.com/group/project, branch develop, 0 matching components, 0 to process, 0 linked
It seems like weblate lost 'ssh' and can't assign this hook to repo.

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. Setup component with ssh repo
  2. Setup gitlab webhook for this repo
  3. Try to send webhook

Expected behavior

Weblate got webhook and update repo

Screenshots

No response

Exception traceback

No response

How do you run Weblate?

Docker container

Weblate versions

  • Weblate: 5.2.1
  • Django: 4.2.7
  • siphashc: 2.3
  • translate-toolkit: 3.11.1
  • lxml: 4.9.3
  • Pillow: 10.1.0
  • nh3: 0.2.14
  • python-dateutil: 2.8.2
  • social-auth-core: 4.5.0
  • social-auth-app-django: 5.4.0
  • django-crispy-forms: 2.1
  • oauthlib: 3.2.2
  • django-compressor: 4.4
  • djangorestframework: 3.14.0
  • django-filter: 23.4
  • django-appconf: 1.0.6
  • user-agents: 2.2.0
  • filelock: 3.13.1
  • rapidfuzz: 3.5.2
  • openpyxl: 3.1.2
  • celery: 5.3.6
  • django-celery-beat: 2.5.0
  • kombu: 5.3.4
  • translation-finder: 2.15
  • weblate-language-data: 2023.6
  • html2text: 2020.1.16
  • pycairo: 1.25.1
  • PyGObject: 3.46.0
  • diff-match-patch: 20230430
  • requests: 2.31.0
  • django-redis: 5.4.0
  • hiredis: 2.2.3
  • sentry-sdk: 1.36.0
  • Cython: 3.0.5
  • misaka: 2.1.1
  • GitPython: 3.1.40
  • borgbackup: 1.2.6
  • pyparsing: 3.1.1
  • ahocorasick_rs: 0.20.0
  • python-redis-lock: 4.0.0
  • charset-normalizer: 3.3.2
  • Python: 3.11.5
  • Git: 2.39.2
  • psycopg: 3.1.13
  • psycopg-binary: 3.1.13
  • phply: 1.2.6
  • ruamel.yaml: 0.18.5
  • tesserocr: 2.6.2
  • boto3: 1.29.5
  • zeep: 4.2.1
  • aeidon: 1.13
  • iniparse: 0.5
  • mysqlclient: 2.2.0
  • Mercurial: 6.6
  • git-svn: 2.39.2
  • git-review: 2.3.1
  • PostgreSQL server: 16.1
  • Database backends: django.db.backends.postgresql
  • PostgreSQL implementation: psycopg3 (binary)
  • Cache backends: default:RedisCache, avatar:FileBasedCache
  • Email setup: django.core.mail.backends.smtp.EmailBackend: mail.dikidi.tech
  • OS encoding: filesystem=utf-8, default=utf-8
  • Celery: redis://cache:6379/1, redis://cache:6379/1, regular
  • Platform: Linux 5.10.0-16-amd64 (x86_64)

Weblate deploy checks

No response

Additional context

No response

@nijel
Copy link
Member

nijel commented Nov 24, 2023

Isn't the ssh: part missing in GitLab configuration? Does it show correctly SSH URLs in the web UI and API?

@makovkindenis
Copy link
Author

makovkindenis commented Nov 24, 2023

Yes, gitlab settings are correct.
In webhook details i can see request:

skip...
"project": {
    "id": 5,
    "name": "project",
    "description": "",
    "web_url": "https://gitlab.mydomain.com/group/project",
    "avatar_url": null,
    "git_ssh_url": "ssh://[email protected]:6022/group/project.git",
    "git_http_url": "https://gitlab.mydomain.com/group/project.git",
skip...
"repository": {
    "name": "project",
    "url": "ssh://[email protected]:6022/group/project.git",
    "description": "",
    "homepage": "https://gitlab.mydomain.com/group/project",
    "git_http_url": "https://gitlab.mydomain.com/group/project.git",
    "git_ssh_url": "ssh://[email protected]:6022/group/project.git",
    "visibility_level": 0
  }

@nijel
Copy link
Member

nijel commented Nov 27, 2023

Looking again at the initial post:

Weblate response for this hook:
{"status": "failure", "message": "No matching repositories found!", "match_status": {"repository_matches": 1, "branch_matches": 0, "enabled_hook_matches": 0}}

The repository seems to have matched, but there is a different branch being updated than is configured in Weblate.

@nijel nijel added the question This is more a question for the support than an issue. label Nov 27, 2023
Copy link

This issue has been marked as a question by a Weblate team member. Why? Because it belongs more to the professional Weblate Care or community Discussions than here. We strive to answer these reasonably fast here, too, but purchasing the support subscription is more responsible and faster for your business. And it makes Weblate stronger as well. Thanks!

In case your question is already answered, making a donation is the right way to say thank you!

@makovkindenis
Copy link
Author

The repository seems to have matched, but there is a different branch being updated than is configured in Weblate.

Oh.. missed this ^) Strange, we have only one branch master in repository yet. Will check this one more time. Thanks

@nijel
Copy link
Member

nijel commented Nov 27, 2023

The webhook was triggered with branch develop...

@makovkindenis
Copy link
Author

makovkindenis commented Nov 27, 2023

The webhook was triggered with branch develop...

Oh, my bad ^( Excuse me for bother. All works fine
Thanks a lot

Copy link

The issue you have reported is now resolved. If you don’t feel it’s right, please follow its labels to get a clue for further steps.

  • 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
question This is more a question for the support than an issue.
Projects
None yet
Development

No branches or pull requests

2 participants