-
-
Notifications
You must be signed in to change notification settings - Fork 354
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] Use workspaces instead of deprecated/removed teams path #1166
[Bitbucket] Use workspaces instead of deprecated/removed teams path #1166
Conversation
what whould help, is if you can post raw json webhook data ... so we can adjust webhook parsing :) |
@6543 I'm not sure i understand exactly what you need |
ad09cca
to
0cf6e9f
Compare
Please dont force-push, pulls get squash-merged anyway. Just merge master into it and push |
With webhook request body, i mean the raw data bitbucket send via http(s) to woodpecker-server on events happening on bitbucket It's data encoded as json in plain text in an http(s)-request in the so called body |
Gitea/github/gitlab lets you obtain it in the repo-settings if webhooks are enabled and already got send by cliking on an webhook entry to see details |
Signed-off-by: Martin Herren <martin.herren@gmail.com>
0cf6e9f
to
34c93f1
Compare
Rebased on master and fixed the build of the tests. Now there are still 2 tests not passing. |
@MartinHerren please dont rebase :/ |
pull title and description will be used on merge for the final commit |
Sorry i'm used to rebase my wip branches to keep all my branches and my history clean... automatic reflex. Will try not to rebase. |
Ok, think i found a way to activate history logging of webhooks. Just need to create a dummy project on my test account to generate the webhook data. |
This comment was marked as resolved.
This comment was marked as resolved.
+1 to this PR. My golang skills are limited at the moment, I'd love to contribute. |
Yes, time to finish this PR ! Will attack the testing part again. |
Signed-off-by: Martin Herren <martin.herren@gmail.com>
So a step closer to working BB :) |
Yeah, thanks ! The next bigger step i see is probably the user management.
Thanks ! |
in my company, we are migrating to woodpecker thanks to this PR. |
ok let's chat at #1047 ... |
Crude fix to allow to correctly list workspaces for bitbucket cloud (https://bitbucket.org) and so run a pipeline.
Last year they removed a bunch of deprecated APIs and replaced them with new ones.
User management is still broken (maybe even more with this PR), it doesn't retrieve correct user info like email for example.
Unit tests are not yet aligned with my changes. Will try to fix that.
Got a server running locally connected to bitbucket.org, can privately provide the url if someone needs testing.
Discovered a 'feature' of bitbucket: oauth2 tokens are created at 'workspace' level but are not scoped to a specific workspace, so anyone with a bitbucket.org account can login into woodpecker. This makes it important not to allow user registration, if not possible use filters to allow only the desired workspaces in order to prevent anyone to abuse your server and runners to build their own pipelines.
I also renamed a few functions containing 'Team' to 'Workspace'. I don't know the convention here, if inside a forge you prefer to keep the 'woodpecker terminology' or the 'server specific terminology'. There is no notion of 'Team' in bitbucket cloud. Only workspaces and projects. From what i understood a repo is part of a workspace and can be part of a project. A project only serves to apply some global git settings (like merge strategies) to a group of repos. User management is done at workspace and repo level. Also the git url only contains the workspace and repo.
I'm not a Go developer yet so still learning...
Signed-off-by: Martin Herren martin.herren@gmail.com