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's repository URL didn't marked as verified after trusted publishing #16475

Closed
nE0sIghT opened this issue Aug 13, 2024 · 5 comments · Fixed by #16525
Closed

Gitlab's repository URL didn't marked as verified after trusted publishing #16475

nE0sIghT opened this issue Aug 13, 2024 · 5 comments · Fixed by #16525
Labels
bug 🐛 UX/UI design, user experience, user interface

Comments

@nE0sIghT
Copy link
Contributor

Describe the bug
I just tested URL verify (merged in the #16205) for Gitlab and found that repository git URL didn't became verified: https://pypi.org/project/apt-mirror/9a1/

Expected behavior
Gitlab URLs like https://gitlab.com/apt-mirror2/apt-mirror2.git are verified after trusted publishing.

@nE0sIghT nE0sIghT added bug 🐛 requires triaging maintainers need to do initial inspection of issue labels Aug 13, 2024
@woodruffw
Copy link
Member

woodruffw commented Aug 13, 2024

What happens if you change your GitLab URL to remove the .git suffix? As-is, I suspect it's not being marked as verified because it's failing this check:

elif user_uri.path and publisher_uri.path:
is_subpath = publisher_uri.path == user_uri.path or user_uri.path.startswith(
publisher_uri.path + "/"
)

(Tweaking this check is tricky, but not necessarily impossible -- we'd need to special case suffixes like .git when checking subpaths. But I think the majority of people use "bare" URLs for GitHub and GitLab, in practice.)

@di
Copy link
Member

di commented Aug 13, 2024

We should be safe to strip .git from the end of GitHub URLs if present:

image

Add I'm assuming the same is true with GitLab as well.

@nE0sIghT
Copy link
Contributor Author

What happens if you change your GitLab URL to remove the .git suffix?

Didn't tested it yet, but I believe it will be fine

I think the majority of people use "bare" URLs for GitHub and GitLab, in practice

Just a note here that the repository URL example in the "Writing your pyproject.toml" PyPA article have .git suffix:

image

(it's a place where I referenced while writing pyproject.toml for my initial pypi publishing)

@woodruffw
Copy link
Member

Gotcha! TIL that's recommended in the PyPA guide 🙂

(I was off in my estimation too -- it should be relatively easy for us to specialize the suffix check for GitHub and GitLab.)

@di di removed the requires triaging maintainers need to do initial inspection of issue label Aug 13, 2024
@facutuesca
Copy link
Contributor

We should be safe to strip .git from the end of GitHub URLs if present:

image Add I'm assuming the same is true with GitLab as well.

Documenting here that it's true for GitLab as well:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 UX/UI design, user experience, user interface
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants