Skip to content

Conversation

tcrespog
Copy link
Collaborator

@tcrespog tcrespog commented Aug 12, 2025

Description

In #6209, it turns out I mixed up Bitbucket access tokens with Bitbucket API tokens. API tokens are the chosen replacement for app passwords, which cannot longer be created starting from 2025-09-09 and will stop working as a whole starting from 2026-06-09 (source).

This PR adds actual support for API tokens instead of access tokens. Using access tokens, operations such as contacting the REST API were working correctly, but others such as cloning a repository weren't.

Guidelines for testing

  • In bitbucket.org, create a private Nextflow pipeline repository.
  • Create an API token ("Atlassian Account settings > Security tab > Create and manage API Tokens") and an app password ("Personal Bitbucket settings > App passwords > Create app password").
  • In your local computer, create a SCM config file (scm_token.config) with the following contents for API token authentication:
providers {
    bitbucket {
        user = '<email>'
        token = '<API token>'
    }
}
  • Run the pipeline; the repository is cloned correctly:
export NXF_SCM_FILE="$HOME/scm_token.config"
nextflow run https://bitbucket.org/<workspace>/<repo>
  • In your local computer, create a SCM config file (scm_pass.config) with the following contents for app password authentication:
providers {
    bitbucket {
        user = '<username>'
        password = '<app password>'
    }
}
  • Run the pipeline, the app password method keeps working correctly:
rm -rf ~/.nextflow/assets # Remove directory to make sure the repo is not fetched from local assets
export NXF_SCM_FILE="$HOME/scm_pass.config"
nextflow run https://bitbucket.org/<workspace>/<repo>

@tcrespog tcrespog requested a review from pditommaso August 12, 2025 07:58
Copy link

netlify bot commented Aug 12, 2025

Deploy Preview for nextflow-docs-staging ready!

Name Link
🔨 Latest commit a4e4754
🔍 Latest deploy log https://app.netlify.com/projects/nextflow-docs-staging/deploys/689e39ca46dadd00086525ea
😎 Deploy Preview https://deploy-preview-6337--nextflow-docs-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

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.

It would be preferable to keep support for user/password as a fallback even it deprecated.

https://www.nextflow.io/docs/latest/git.html#bitbucket-server

Consider also updating the corresponding docs

@tcrespog
Copy link
Collaborator Author

tcrespog commented Aug 13, 2025

It would be preferable to keep support for user/password as a fallback even it deprecated.

https://www.nextflow.io/docs/latest/git.html#bitbucket-server

App passwords are still supported.

Screenshot 2025-08-13 at 12 21 49

Consider also updating the corresponding docs

Docs to be updated in a separate PR.

@pditommaso
Copy link
Member

Ok, now I see it.

https://github.com/nextflow-io/nextflow/pull/6337/files#diff-43a99b83c3e3d088e0e301144d9095d16c89f1c6025b49ed28408ec019fe3f06R51

Would not be better to give priority to the token over the pwd?

@tcrespog
Copy link
Collaborator Author

Would not be better to give priority to the token over the pwd?

Makes sense to me. I can change that.

@pditommaso
Copy link
Member

Can it be added one line mention in the docs about the new feature ?

@pditommaso pditommaso requested a review from a team as a code owner August 14, 2025 19:32
@pditommaso
Copy link
Member

Ok, I did. Please have a look when you have a chance

@pditommaso pditommaso merged commit 1d73b87 into master Aug 14, 2025
3 of 5 checks passed
@pditommaso pditommaso deleted the support-bitbucket-api-tokens-2 branch August 14, 2025 19:33
@tcrespog
Copy link
Collaborator Author

Ok, I did. Please have a look when you have a chance

Looks good to me. Thanks, Paolo.

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.

2 participants