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

Ensure BitBucket (Cloud) Support #1047

Closed
2 of 3 tasks
6543 opened this issue Jul 26, 2022 · 11 comments
Closed
2 of 3 tasks

Ensure BitBucket (Cloud) Support #1047

6543 opened this issue Jul 26, 2022 · 11 comments
Assignees
Labels
forge/bitbucket bitbucket forge related

Comments

@6543
Copy link
Member

6543 commented Jul 26, 2022

Summary

@6543 6543 self-assigned this Jul 26, 2022
@6543 6543 added forge/bitbucket bitbucket forge related and removed pending:feature labels Jul 26, 2022
@6543 6543 added this to the 1.0.0 milestone Jul 26, 2022
@qwerty287
Copy link
Contributor

We have to look at forges that are not Github, Gitlab and Gitea in general a bit more...

@MartinHerren
Copy link
Contributor

Hej,

had time to try to investigate bitbucket cloud a little more. Managed to build my own Woodpecker server so i could add some logging to identify where it fails (i'm not fluent in go but it is on my roadmap to learn it).

The current behavior i have:
I can connect Woodpecker to bitbucket and log in. No error visible on woodpecker's UI. But i cannot get a list of repositories.

Checks through cli:
❯ go run ./cmd/cli info
12:59PM ??? cli/common/zerologger.go:18 > LogLevel = debug
User: xxxxx
Email:
❯ go run ./cmd/cli user info
12:59PM ??? cli/common/zerologger.go:18 > LogLevel = debug
12:59PM FTL cmd/cli/main.go:27 > error running cli error="Missing or invalid user login"
exit status 1

It seems i'm basically logged in but it can not retrieve my user info. Also i cannot get a repository list: It fails when accessing the https://api.bitbucket.org/2.0/teams/?pagelen=100&role=member endpoint.

So it seems that what's currently broken in bitbucket is most or all related to some apis that have been deprecated and removed last year: https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-teams-deprecation/

I don't know how i can help more on the issue for now. The best solution is probably to go through the go-bitbucket module instead of re-implementing the whole api.

@MartinHerren
Copy link
Contributor

Have a first hack to be able to retrieve the list of repositories of al workspaces a user has access:
master...MartinHerren:woodpecker:bitbucket_get_repo_fix

Still need to cleanup the commit and align the tests to pass again.

User info/email still doesn't work but i managed to run my first 'hello world pipeline' with Woodpecker connected to bitbucket cloud.

@6543
Copy link
Member Author

6543 commented Sep 1, 2022

@MartinHerren if you like just open a pull and allow maintainers to edit stuff, so we can help out ;)

PS: you will also then get official images with the pull as tag ;)

@MartinHerren
Copy link
Contributor

Yes, just a last cleanup and a rebase and i'll open a PR asap

@MartinHerren
Copy link
Contributor

Rebased to master and opened a WIP PR. Still need to align the tests. But already managed to run successfully a simple 'hello world' pipeline connected to bitbucket.org. User management still needs fixing (like retrieving user email for example).

@6543
Copy link
Member Author

6543 commented Sep 28, 2022

It would be nice If somebody could provide up to date webhook examples for:

  • tagging
  • pull-request creating/updating/closing/merging

to update https://github.com/woodpecker-ci/woodpecker/blob/master/server/remote/bitbucket/fixtures/hooks.go

@MartinHerren
Copy link
Contributor

It would be nice If somebody could provide up to date webhook examples for:

* tagging

* pull-request creating/updating/closing/merging

to update https://github.com/woodpecker-ci/woodpecker/blob/master/server/remote/bitbucket/fixtures/hooks.go

Will take care of that.

Haven't seen a trigger for 'Tagging', there is only one for 'Repository Updated'. To test if it triggers on tag.

For Pull requests, there are triggers among others for

  • Created
  • Updated
  • Merged
  • Declined (might match the 'closing' need) ?

@6543
Copy link
Member Author

6543 commented Sep 28, 2022

well would be interesting to see if they differ ... and how

and Tagging = if you create a git tag and push it

@6543 6543 modified the milestones: 1.0.0, 1.1.0 Jun 3, 2023
@pat-s pat-s modified the milestones: 2.0.0, 2.x.x Oct 13, 2023
@segux
Copy link
Contributor

segux commented Jan 23, 2024

Hi, are you working on this one? Thanks

@6543
Copy link
Member Author

6543 commented Jan 27, 2024

Bitbucket should now mostly just work ...

... all other thibgs should be reported as normal bugs :)

@6543 6543 closed this as completed Jan 27, 2024
@qwerty287 qwerty287 removed this from the 3.x.x milestone Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
forge/bitbucket bitbucket forge related
Projects
None yet
Development

No branches or pull requests

5 participants