-
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
[JENKINS-54401] NPE when parsing scm git revision date on PR branches #152
Conversation
@Casz the fix is completed, I had try to cover all possible scenarios where commit informations are requested (postponing as possible the HTTP and only if needed). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, one minor improvement can be made
src/main/java/com/cloudbees/jenkins/plugins/bitbucket/client/BitbucketCloudApiClient.java
Outdated
Show resolved
Hide resolved
src/main/java/com/cloudbees/jenkins/plugins/bitbucket/client/branch/BitbucketCloudBranch.java
Show resolved
Hide resolved
...ain/java/com/cloudbees/jenkins/plugins/bitbucket/server/client/BitbucketServerAPIClient.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider adding checkstyle to jenkinsfile as well:
Seems like checkstyle is scanning generated files 😢 |
For this reason I have excluded resources (maybe could be setup only for properties files). |
@Casz any news? |
Haven't gotten around to it because of sickness 😢 Will see what I can muster! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine except for the use of slf4j logger 😢 if you want the code base to switch logger, it should be done in a single PR.
...java/com/cloudbees/jenkins/plugins/bitbucket/server/client/branch/BitbucketServerBranch.java
Outdated
Show resolved
Hide resolved
src/main/java/com/cloudbees/jenkins/plugins/bitbucket/client/branch/BitbucketCloudBranch.java
Outdated
Show resolved
Hide resolved
Fix the retrieve of the commit informations for a HEAD source of a pullrequest branch. Add closures to branch implementation objects to make HEAD commit informations available when needed. Add unit test for PR from forked repositories.
ok reverted |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your rebase allowed for missed checkstyle it seems 🤭
src/test/java/com/cloudbees/jenkins/plugins/bitbucket/BitbucketGitSCMRevisionTest.java
Show resolved
Hide resolved
- new line at end of file - import package order no grouping [a-z] and static import at bottom
@Casz I do not understand, checkstyle is configured to check java and test sources. The build pass and checkstyle is performed on jenkins build:
|
Well your latest commit corrects all that was wrong with the first at moment so all good 😅 |
ok so nothingelse to do |
Has 2.2.15 been published with this fix to https://updates.jenkins.io/ ? |
I uploaded it yesterday, I guess Jenkins CI is having trouble. |
@nickbroon https://repo.jenkins-ci.org/webapp/#/artifacts/browse/tree/General/releases/org/jenkins-ci/plugins/cloudbees-bitbucket-branch-source/2.2.15 would you mind creating a jenkins infra ticket? |
Where and how do I do that? |
Fix the retrieve of the commit informations for a HEAD source of a pullrequest branch.
This is a WIP because there are yet possible issues on commit informations when required by SCM traits.
The traits that decorate the source context with filters or prefilter are involved during the process of request before the revision factory is called. This means that no information will be available for a PR unless already present in the original response from bitbucket. Actually the client APIs need to be refactored to support callable that allow extra HTTP request in case some data are getted.
For example bitbucket for the pullrequests sends for both source and destination only the hash of head commit and the branch name. Actually BitbucketPullRequestValueDestination has the following fileds:
it's easier point to a null value everywhere in the code.
In my opinion, for the future, could be a good idea move the client API code in a separate plugin Bitbucket Client API so can be shared across jenkins plugins.