[JENKINS-75854] Do not fetch tags in multibranch Pipeline if "Discover tags" is not enabled - #1776
Conversation
If the "Discover Tags" trait is not set, there is no need to fetch tags on branch indexing.
|
Tests failures in Windows. They are passing locally (and CI) in Linux. I don't have a Windows host to test this. @MarkEWaite maybe you can help me out here? |
car-roll
left a comment
There was a problem hiding this comment.
LGTM. I dug through the indexing code in branch-api just to make sure but I didn't see anything else there would cause this issue,
|
@olamy can you trigger a new build here to check if the Windows test failure was just a flake? I've tried by closing/reopening but that didn't work. |
The refs/tags namespace should not have been retrieved previously when tag discovery was not enabled.
|
One of the failing tests was testing a condition that is no longer expected to exist. It was testing for The assertion did not fail on Linux for me, just as it did not fail on Linux for @amuniz . Will need more investigation to understand why that assertion does not fail on Linux. |
|
I've noticed in logs that the windows build is using a more recent |
Nop. |
|
It's passing in some other PRs (ie. https://ci.jenkins.io/job/Plugins/job/git-plugin/job/PR-1758/4/testReport/jenkins.plugins.git/AbstractGitSCMSourceTest/windows_17___Build__windows_17____refLockEncounteredIfPruneTraitNotPresentOnNotFoundRetrieval/), however by that time the I've created an empty PR to check whether this reproduces or not: #1782 |
|
Alright, unsetting @MarkEWaite this is ready for final review/merge/release |
Test the heads that are returned in combinations of traits. Use Before and After methods to register the MockGitClient so that we can avoid a try / finally block in the test.
Users may find that the bug fix has a negative impact on their environment and may not be able to immediately adjust their multibranch Pipeline definitions. Accept a system property that restores the buggy behavior.
Tests the impact of GitSCMSource.IGNORE_TAG_DISCOVERY_TRAIT on the behavior.
MarkEWaite
left a comment
There was a problem hiding this comment.
The change looks very good to me, though I'm worried about users that may depend on the old (buggy) behavior and not be able to adapt their multibranch Pipeline definitions when the buggy behavior is fixed.
I've used your changes as a base and extended it by adding a "retain bug compatibility" property. @amuniz and @olamy could you review my changes at:
amuniz/git-plugin@no-tags...MarkEWaite:git-plugin:no-tags
I moved the new test into a separate file so that I could use the Before and After annotation to simplify the tests.
I split the single test into multiple tests so that I could see the assertions more readily.
I added assertions for the return value of source.fetch() and added comments when the return value was not what I expected.
|
Your proposed changes look good to me @MarkEWaite, feel free to incorporate them to this PR. Thanks! |
|
@amuniz I have delayed merging this because I'm seeing two failures in my test controller when running on Linux. The same tests pass on ci.jenkins.io, but I need to resolve those failures before merging. The failing tests are:
I'll continue exploring to understand the issue. I assume it is purely a test issue and may somehow be related to the AbstractGitTestCase that is the basis of those two test classes and its |
MarkEWaite
left a comment
There was a problem hiding this comment.
Thanks! Once merged to the master branch, I'll start the interactive testing.
Docker Java API update from 3.5.2 to 3.5.3 from pull request: * jenkinsci/docker-java-api-plugin#138 Bumps the netty version dependency inside the API plugin from 4.1.119 to 4.2.2 but the Jenkins netty plugin is 4.1.118. Need to confirm that does not cause issues in plugin BOM tests. Git plugin update from 5.7.0 to 5.8.0 includes pull request: * jenkinsci/git-plugin#1776 That fixes https://issues.jenkins.io/browse/JENKINS-75854 and adjusts the git plugin multibranch Pipeline scan to only request tags if the Discover Tags trait is associated with the scan. Git client plugin update from 6.2.0 to 6.3.0 increases the minimum Jenkins version from 2.479.3 to 2.504.1. Other changes are dependency updates. Testing done: PLUGINS=git,git-client,docker-plugin LINE=weekly bash ./local-test.sh
Includes: * jenkinsci/git-plugin#1776 Do not fetch tags unless "Discover tags" is enabled * jenkinsci/git-plugin#1789 Replace Commons Lang 2
See JENKINS-75854
If the "Discover Tags" trait is not set, there is no need to fetch tags on branch indexing.
Testing done
--tagsmodifier--tagsmodifierSubmitter checklist