Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Honor token field in BitbucketServerRepositoryProvider#7120

Merged
pditommaso merged 6 commits into
masterfrom
fix/nf-400-bbserver-token
May 15, 2026
Merged

Honor token field in BitbucketServerRepositoryProvider#7120
pditommaso merged 6 commits into
masterfrom
fix/nf-400-bbserver-token

Conversation

@jorgee

@jorgee jorgee commented May 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • BitbucketServerRepositoryProvider previously inherited the default RepositoryProvider auth, which only reads user/password and ignored token. Configs supplying an HTTP access token hit BBS without an Authorization header (or with null Git credentials), producing 401 "Not authorized" at clone/branch lookup.
  • Override hasCredentials, getAuth, and getGitCredentials so a token yields Authorization: Bearer <token> for REST and is used as the password for Git over HTTPS. user+password still works via Basic auth; when both token and password are set, the token wins (matches BitbucketRepositoryProvider).
  • Add unit tests covering the three auth branches and an change a test using NXF_BITBUCKET_SERVER_ACCESS_TOKEN to use the setToken() instead of setAuth()

Test plan

  • ./gradlew :nextflow:test --tests "nextflow.scm.BitbucketServerRepositoryProviderTest" (23 tests, 0 failures, 3 skipped — env-gated integration tests)

  • Verify end-to-end pipeline launch from Seqera Platform against a BBS repository configured with token-only credentials.

🤖 Generated with Claude Code

@netlify

netlify Bot commented May 8, 2026

Copy link
Copy Markdown

Deploy Preview for nextflow-docs-staging canceled.

Name Link
🔨 Latest commit 2ab08ec
🔍 Latest deploy log https://app.netlify.com/projects/nextflow-docs-staging/deploys/6a073160f65a7400088f3f1c

@jorgee jorgee marked this pull request as ready for review May 11, 2026 08:50
@pditommaso

Copy link
Copy Markdown
Member

A few notes from a self-review pass:

Important — bug in 'should list branches' test

modules/nextflow/src/test/groovy/nextflow/scm/BitbucketServerRepositoryProviderTest.groovy:113

def items = token.tokenize(':')
def config = items > 1
    ? new ProviderConfig(...).setUser(items[0]).setToken(items[1])
    : new ProviderConfig(...).setToken(token)

items is a List<String>, so items > 1 compares a List to an Integer — it should be items.size() > 1. The test is @Ignored so CI doesn't catch it, but anyone unignoring it to validate the fix against a real BBS endpoint (the deferred manual-test checkbox in the PR description) will hit a ClassCastException or silently take the wrong branch.

Minor

  1. Repeated getToken() calls in BitbucketServerRepositoryProvider.getAuth() and getGitCredentials(). Stylistic only — caching to a local would read a bit cleaner:

    final tkn = getToken()
    if( tkn ) return new String[] { "Authorization", "Bearer " + tkn }
  2. Pre-existing typo platform:'bitbucketsever' (missing r) at test lines 114, 115, 130. Not introduced by this PR — flagging in case you want to clean it up while in the area.

@jorgee jorgee requested a review from pditommaso May 13, 2026 14:08
@pditommaso

Copy link
Copy Markdown
Member

Umm, new azure tests?! 😕

@jorgee

jorgee commented May 13, 2026

Copy link
Copy Markdown
Contributor Author

I haven't changed anything on azure in thia PR. @bentsherman, have you updated rnaseq-nf?

@pditommaso pditommaso merged commit 6bf6e8d into master May 15, 2026
12 checks passed
@pditommaso pditommaso deleted the fix/nf-400-bbserver-token branch May 15, 2026 15:49
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