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

bitbucket_branch_restriction users must not use username as it is deprecated and not obtainable #173

Open
ChristianAnke opened this issue Aug 23, 2023 · 3 comments

Comments

@ChristianAnke
Copy link

Terraform Version

v1.5.5

Affected Resource(s)

  • bitbucket_branch_restriction

Terraform Configuration Files

resource "bitbucket_branch_restriction" "push" {
  branch_match_kind = "glob"
  branch_type       = null
  kind              = "push"
  owner             = "me"
  pattern           = "main"
  repository        = "repo-name"
  users             = [ "user_name" ]
  value             = 0
}

Expected Behavior

Instead of user_name the UUID or Atlassian ID schould be used

Actual Behavior

The users username can not be obtained other than the user itself. There is no API endpoint providing this information anymore.

Steps to Reproduce

  1. terraform apply

References

https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-changes-gdpr/#removal-of-usernames-from-user-referencing-apis

@TizianoPerrucci
Copy link

Due to this issue there is no other way to configure the allowed user on the branch restriction rather then just hardcode the username. Could we get some attention to this ?

@Nkmol
Copy link

Nkmol commented May 1, 2024

The API does not seem to support account_id (Atlassian ID) as this is not part of the API account schema, which is weird considering the reference posted. To support this, it would be best to communicate this with Atlassian.

uuid is supported through the API. I am only not sure how to represent this in HCL.

@Nkmol
Copy link

Nkmol commented May 18, 2024

A small update, contacted Atlassian about this matter:

  1. username is now officially deprecated from this endpoint, and has been removed from the OpenAPI definition (see https://community.atlassian.com/t5/Bitbucket-questions/Feat-Swagger-V3-Update-account-schema/qaq-p/2694518#U2702105)
  2. A request has been filled to support account_id (Atlassian ID) for this endpoint https://jira.atlassian.com/browse/BCLOUD-23240 (see https://community.atlassian.com/t5/Bitbucket-questions/Feat-REST-allow-Account-ID-to-be-used-to-update-users-in-branch/qaq-p/2694527#U2702107). It will help to vote for the issue if this is something you'd want.

To keep this backwards compatible, and as the API still support post requests with username, I want to try to support both these syntaxes. But strongly advise using the uuid as remote changes cannot be checked with username.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants