Skip to content

Conversation

@jorgee
Copy link
Contributor

@jorgee jorgee commented Nov 21, 2025

close #6441

This pull request improves the handling of branch and revision names in repository provider classes by ensuring that all revision and path parameters in URLs are properly URL-encoded. This prevents issues when branch names contain special characters. The changes are applied across Azure, Bitbucket Server, Gitea, Github, and Gitlab providers, and corresponding tests are added to verify correct behavior.

  • All repository provider classes (AzureRepositoryProvider, BitbucketServerRepositoryProvider, GiteaRepositoryProvider, GithubRepositoryProvider, and GitlabRepositoryProvider) now encode revision and path parameters using URLEncoder.encode with StandardCharsets.UTF_8 to ensure proper URL formatting and avoid errors with special characters in branch names.

  • Additional encoding is applied in methods that resolve revisions to commit SHAs and list directory contents, ensuring consistency throughout all API requests.

  • New test cases are added for each provider to verify that URLs are correctly generated when branch names include special characters, such as slashes, plus signs, and ampersands.

Signed-off-by: jorgee <jorge.ejarque@seqera.io>
@netlify
Copy link

netlify bot commented Nov 21, 2025

Deploy Preview for nextflow-docs-staging canceled.

Name Link
🔨 Latest commit ebb7339
🔍 Latest deploy log https://app.netlify.com/projects/nextflow-docs-staging/deploys/692022dd0540150008779ecb

@jorgee jorgee changed the title Fix pull repo with URL characters in revision name Add URL encoding when revision name is used as HTTP query parameter Nov 21, 2025
Copy link
Member

@pditommaso pditommaso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good initiative, however we need to a real integration test to validate this for each modified provider (there's already a test repo for each of them)

@pditommaso
Copy link
Member

I've created a branch test/branch+with&special-chars for testing purposes both for azure, bitbucket, gitea and gitlab repos

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.

Special characters in repository revision not encoded in request to remote repository

4 participants