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

Issue #290: Implement compatibility with new Bitbucket rest api #361

Conversation

BUGinator86
Copy link

and fix missing "parent" property in JSON for required builds.

This fixes Issue #290 without breaking compatibility with older versions of BitBucket/Stash.
We support the old deprecated REST API and the new REST API.

Testing done

The test was done in our test environment with BitBucket 7.21 that supports both versions of the API, because we needed a slim plugin for our required builds.
After both versions successfully worked in our test environment we now use it for about 3 Weeks in production without any problems.

Submitter checklist

Preview Give feedback

@BUGinator86 BUGinator86 requested a review from a team as a code owner October 3, 2023 19:08
Copy link
Member

@gruetter gruetter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR looks good to me and is rather relevant for users of this plugin. I suggest to add one more test case (see my comments below).

@scaytrase and @sghill: My Java skills have become somewhat rusty (no pun intended) in the past years. I would appreciate either one of you give the code a looksee, as well, before merge.

uri = String.join("/", tidyBase, "rest/build-status/1.0/commits", commit);
}
else {
uri = String.join("/", tidyBase, "rest/api/latest/projects", projectKey, "repos", slug, "commits", commit, "builds");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implementation looks fine to me. However, the tests currently cover the legacy API calls (w/o project key and repo slug), only. I suggest you add another test for the new API, as well.

@sghill
Copy link
Contributor

sghill commented Mar 16, 2024

Seconding @gruetter's request for more test coverage.

I think we should also consider whether this makes sense to add as a separate notifier rather than modifying the existing one. There is support within the plugin for changing the notifier by system property, which would mean any issues with the new notifier could be easily worked around. Would love to hear more feedback about this idea.

@BUGinator86 BUGinator86 force-pushed the enhancement/restapi-update branch from e814699 to 1b33f18 Compare May 30, 2024 19:40
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

Successfully merging this pull request may close these issues.

3 participants