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

JENKINS-57583 Ignore merge commmit when comparing revisions #227

Merged
merged 3 commits into from May 23, 2019

Conversation

bitwiseman
Copy link
Contributor

@bitwiseman bitwiseman commented May 22, 2019

Depends on #226 (diff only the one commit to see the changes).

Other plugins assume that there are are only two revisions
involved in PR revision identity. Since the mergeHash is generated
based on the base and source hashes, it is not particularly
interesting to use it and can cause bad behavior if we do.

The only place where the mergeHash is interesting is when
getting Jenkinsfile or doing readTrusted. It is an optimization
that should have as few side effects as possible.

https://issues.jenkins-ci.org/browse/JENKINS-57583

We tried using strict merge commit handling to prevent cloning on master.
This resulted in some edge cases for some users where PRs would simply not build
and there was not viable workaround.

Change:
* Merge hash has been changed to best effort.  If it is missing or inconsistent,
Jenkins will gracefully revert to cloning on master.
* Most validity checking for merge hash has been moved to create time.
* Plugin tries harder than before to create a valid merge hash revision.
Other plugins assume that there are are only two revisions
involved in PR revision identity. Since the mergeHash is generated
based on the base and source hashes, it is not particularly
interesting to use it and can cause bad behavior if we do.

The only place where the mergeHash is interesting is when
getting Jenkinsfile or doing readTrusted. It is an optimization
that should have as few side effects as possible.
@bitwiseman
Copy link
Contributor Author

I've manually verified this works now.

@bitwiseman bitwiseman merged commit fdd3c0f into jenkinsci:master May 23, 2019
@bitwiseman bitwiseman deleted the JENKINS-57583 branch May 23, 2019 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants