Skip to content

GitlabRepositoryProvider now handles leading slashes for content URLs#6284

Merged
pditommaso merged 2 commits intomasterfrom
gitlab-leading-slash-content-url
Jul 17, 2025
Merged

GitlabRepositoryProvider now handles leading slashes for content URLs#6284
pditommaso merged 2 commits intomasterfrom
gitlab-leading-slash-content-url

Conversation

@swingingsimian
Copy link
Collaborator

@swingingsimian swingingsimian commented Jul 17, 2025

A tiny change to handle leading slashes for GitLab content URLs. Leading forward slashes in relative content URLs are generally handles well by the repo providers, but GitLab does things a little differently. Instead of handling the entire URL path as an endpoint URL, it encodes the content URL as a single portion of the URL:

"${config.endpoint}/api/v4/projects/${getProjectName()}/repository/files/${encodedPath}?ref=${ref}"

Any leading slash in the encodedPath part results in a 400. This is currently uncaught by nextflow.scm.RepositoryProvider#checkResponse, and results in a null value being returned.

This PR simply strips leading slashes from content URLs for gitlab, resolving the problem.

@netlify
Copy link

netlify bot commented Jul 17, 2025

Deploy Preview for nextflow-docs-staging canceled.

Name Link
🔨 Latest commit 3d2af17
🔍 Latest deploy log https://app.netlify.com/projects/nextflow-docs-staging/deploys/6878ab82d638320008103756

…t URLs

Signed-off-by: Author Name <nathan.johnson@seqera.io>
@swingingsimian swingingsimian force-pushed the gitlab-leading-slash-content-url branch from 9dece2b to cbd7219 Compare July 17, 2025 07:27
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
@pditommaso pditommaso merged commit b7fa6f4 into master Jul 17, 2025
9 checks passed
@pditommaso pditommaso deleted the gitlab-leading-slash-content-url branch July 17, 2025 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants