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

fix(hooks): correct repository full_name extraction #13410

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Ron31
Copy link

@Ron31 Ron31 commented Dec 30, 2024

Proposed changes

Replaces manual parsing of the SSH URL with the provided path_with_namespace from the GitLab payload. This ensures accurate retrieval of the repository's full name.

Checklist

  • Lint and unit tests pass locally with my changes.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added documentation to describe my feature.
  • I have squashed my commits into logic units.
  • I have described the changes in the commit messages.

Other information

See https://docs.gitlab.com/ee/user/project/integrations/webhook_events.html for example payloads from GitLab

@Ron31 Ron31 force-pushed the gitlab-project-fullname branch from 0a8d37f to 02664bb Compare December 31, 2024 00:04
@nijel
Copy link
Member

nijel commented Jan 9, 2025

Do you know when GitLab has changed the payload? Is it safe to drop support for old version now?

@nijel nijel added this to the 5.10 milestone Jan 9, 2025
@Ron31
Copy link
Author

Ron31 commented Jan 9, 2025

At least since version 15.11 https://archives.docs.gitlab.com/15.11/ee/user/project/integrations/webhook_events.html#push-events
Maybe longer, but i don't find any information online or an online version of older archives at the moment.

Official Support for 15.11 ended 22 Jul 2023 (see https://endoflife.date/gitlab)

@nijel
Copy link
Member

nijel commented Jan 10, 2025

Great, then we don't need to support that. Can you please look into the test failure?

@Ron31 Ron31 force-pushed the gitlab-project-fullname branch 2 times, most recently from 0df34dc to 2b54480 Compare January 12, 2025 08:13
@nijel
Copy link
Member

nijel commented Jan 14, 2025

Hmm, seems like the abstract test class fails when using Django native testing...

@Ron31
Copy link
Author

Ron31 commented Jan 14, 2025

Otherwise the DeepSource test failed with "Unit test class with no tests PTC-W0046", which is why i tried to abstract it.

@nijel
Copy link
Member

nijel commented Jan 15, 2025

#13513 should address this, let's see if I didn't miss anything. Please rebase on top of that once it is merged.

@nijel
Copy link
Member

nijel commented Jan 16, 2025

@Ron31 Can you please rebase? Or allow maintainer edits so that I can rebase?

@Ron31 Ron31 force-pushed the gitlab-project-fullname branch from 9fd37cd to 538801d Compare January 16, 2025 13:31
Ron31 and others added 4 commits January 16, 2025 15:03
Replaces manual parsing of the SSH URL with the provided `path_with_namespace` from the GitLab payload. This ensures accurate retrieval of the repository's full name and avoids potential parsing errors.
Replaces manual parsing of the SSH URL with the provided `path_with_namespace` from the GitLab payload. This ensures accurate retrieval of the repository's full name and avoids potential parsing errors.
Converted `HookBackendTestCase` to an abstract class by adding the `ABC` base and `abstractmethod`. Standardized `test_git` method across test cases to enforce implementation in subclasses.
@Ron31 Ron31 force-pushed the gitlab-project-fullname branch from 538801d to a3c982b Compare January 16, 2025 14:03
@nijel nijel self-assigned this Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants