-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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-49757] Remove redundant fetch #904
Merged
MarkEWaite
merged 36 commits into
jenkinsci:master
from
rishabhBudhouliya:CleanBeforeCheckout
Jul 2, 2020
Merged
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
8d58567
Add flag to avoid redundant fetch in GitSCM checkout
rishabhBudhouliya 23158ea
Automated test to check redundance fetch call: testRedundantFetchCall…
rishabhBudhouliya 9b25935
Added tests that confirm no data loss with avoiding second fetch
rishabhBudhouliya 2cf858e
Merge pull request #1 from jenkinsci/master
rishabhBudhouliya 11a87d4
Merge branch 'master' of https://github.com/jenkinsci/git-plugin
rishabhBudhouliya 5d94f2e
Merge branch 'master' into JENKINS-49757
MarkEWaite 1cfb539
Use equals rather than ==
MarkEWaite e6ac2ed
Use assertThat and is for better msgs
MarkEWaite eaded93
Clarify assertion
MarkEWaite 21ead1e
Simpler assertThat
MarkEWaite 67ced0e
Merge branch 'master' into JENKINS-49757
MarkEWaite 995d803
Fix compilation error
MarkEWaite ae036cc
Fix redundant fetch test failure
rishabhBudhouliya 82ffbbf
Enable CleanBeforeCheckout to be decorated in the CloneCommand
rishabhBudhouliya 3bc0059
Fix assertRedundantFetchIsTrue by reducing the scope of fetch argumen…
rishabhBudhouliya 57ab0d0
Merge branch 'master' into CleanBeforeCheckout
rishabhBudhouliya 05daa5e
Update assertion of git fetch arg from build logs with pattern matching
rishabhBudhouliya d3a1e22
Merge remote-tracking branch 'upstream/master'
rishabhBudhouliya 36e3e7d
Merge branch 'master' into CleanBeforeCheckout
rishabhBudhouliya deb1b78
Do not decorate clone command with a clean
rishabhBudhouliya c4c47cb
Fix testCleanBeforeCheckout assertions
rishabhBudhouliya e8d1bca
Determine if second fetch call is redundant
rishabhBudhouliya b54faeb
Do not aggregate GitSCMExtension imports
rishabhBudhouliya 79cf010
Merge branch 'master' of https://github.com/jenkinsci/git-plugin
rishabhBudhouliya a38f1e2
Merge branch 'master' into CleanBeforeCheckout
rishabhBudhouliya 1be3697
Correct spacing in foreach loop
rishabhBudhouliya 15e2f52
Remove unused imports
rishabhBudhouliya 7957017
Merge branch 'master' into CleanBeforeCheckout
MarkEWaite f2fecc8
Add missing import
MarkEWaite a7685db
Fix imports
MarkEWaite 1623253
Run the git command to configure test repo
MarkEWaite 09726f1
Use shallow clone randomly to improve coverage
MarkEWaite c7b7ec6
Place CloneOption import in its sorted location
MarkEWaite f7b77e6
Add test to check second fetch is used when needed
MarkEWaite 534818a
Mark the rc arg as NonNull, caller checks for null
MarkEWaite c2e097d
Non breaking change: simplification of if-else clause
rishabhBudhouliya File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I fail to understand, why would need a shallow clone to improve coverage when we already have a full normal clone?
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.
Good question. One branch was not being reached when a cloneOption extension is detected but does not have honor refspec enabled.
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.
Okay. I didn't consider other CloneOptions. If honor refspec is false, with avoiding the second fetch, we will also avoid other clone options like Shallow Clone, Disable tags, Reference a repo and timeout.
The good news is that the first fetch is capable to execute all of these options if we miss the second fetch. It should not make any difference to the user's expectation on git repository information after the checkout.