-
Notifications
You must be signed in to change notification settings - Fork 393
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
Adapt remote branch listing test to CLI git 2.48.0 #1242
Merged
MarkEWaite
merged 4 commits into
jenkinsci:master
from
MarkEWaite:better-assertion-failure-message
Jan 15, 2025
Merged
Adapt remote branch listing test to CLI git 2.48.0 #1242
MarkEWaite
merged 4 commits into
jenkinsci:master
from
MarkEWaite:better-assertion-failure-message
Jan 15, 2025
Conversation
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
When the assertion fails, show the details of the set of branches so that the test failure has more information about the failure conditions. Preparation for a future time when a failure like this recurs: * jenkinsci/bom#4193 Thanks to @darinpope for the question that prompted the improvement
Command line git 2.48.0 and later are now able to update the HEAD ref that is kept locally to represent the condition of the default branch on the remote repository. That update was read by the getRemoteBranches() method as though it were a distinct remote branch rather than a symbolic reference to the default branch. Adapt the getRemoteBranches() method to not return a remote branch "HEAD" if that remote branch is also a symbolic reference. https://github.blog/open-source/git/highlights-from-git-2-48/ says: With Git 2.48, if the remote has a default branch but refs/remotes/origin/HEAD is missing locally, then a fetch will update it. Testing done: * Confirmed that command line git 2.48.0 fails testListRemoteBranches without this change and passes with this change * Confirmed that command line git 2.43.0 passes testListRemoteBranches without this change and passes with this change
MarkEWaite
changed the title
Show name and sha1 of detected branches on failure
Adapt git client remote branch listing to CLI git 2.48.0
Jan 14, 2025
MarkEWaite
changed the title
Adapt git client remote branch listing to CLI git 2.48.0
Adapt remote branch listing to CLI git 2.48.0
Jan 14, 2025
MarkEWaite
added
bug
Incorrect or flawed behavior
and removed
test
Automated test addition or improvement
tests
Automated test addition or improvement
labels
Jan 14, 2025
Fetch from CLI git 2.48.0 and later return origin/HEAD https://github.blog/open-source/git/highlights-from-git-2-48/ says: With Git 2.48, if the remote has a default branch but refs/remotes/origin/HEAD is missing locally, then a fetch will update it. This test was unintentionally testing the behavior of CLI git before 2.48.0. Other tests in GitClientFetchTest were testing that origin/HEAD was reported as a branch.
MarkEWaite
changed the title
Adapt remote branch listing to CLI git 2.48.0
Adapt remote branch listing test to CLI git 2.48.0
Jan 14, 2025
MarkEWaite
added a commit
that referenced
this pull request
Jan 15, 2025
* Adapt GitAPITest for CLI git 2.48.0 Fetch from CLI git 2.48.0 and later return origin/HEAD https://github.blog/open-source/git/highlights-from-git-2-48/ says: > With Git 2.48, if the remote has a default branch but refs/remotes/origin/HEAD > is missing locally, then a fetch will update it. This test was unintentionally testing the behavior of CLI git before 2.48.0. Other tests in GitClientFetchTest were testing that origin/HEAD was reported as a branch. * Show names/sha1 of detected branches on failure When the assertion fails, show the details of the set of branches so that the test failure has more information about the failure conditions. Thanks to @darinpope for the question that prompted the improvement * Remove unused cliGitCommand from GitAPITest
MarkEWaite
added a commit
that referenced
this pull request
Jan 15, 2025
* Adapt GitAPITest for CLI git 2.48.0 Fetch from CLI git 2.48.0 and later return origin/HEAD https://github.blog/open-source/git/highlights-from-git-2-48/ says: > With Git 2.48, if the remote has a default branch but refs/remotes/origin/HEAD > is missing locally, then a fetch will update it. This test was unintentionally testing the behavior of CLI git before 2.48.0. Other tests in GitClientFetchTest were testing that origin/HEAD was reported as a branch. * Show names/sha1 of detected branches on failure When the assertion fails, show the details of the set of branches so that the test failure has more information about the failure conditions. Thanks to @darinpope for the question that prompted the improvement * Remove unused cliGitCommand from GitAPITest
MarkEWaite
added a commit
to MarkEWaite/bom
that referenced
this pull request
Jan 17, 2025
Add more comments that explain the reason for the test exclusion. * jenkinsci/git-client-plugin#1242
6 tasks
MarkEWaite
added a commit
to jenkinsci/bom
that referenced
this pull request
Jan 17, 2025
Add more comments that explain the reason for the test exclusion. * jenkinsci/git-client-plugin#1242
MarkEWaite
added a commit
that referenced
this pull request
Jan 17, 2025
* Adapt GitAPITest for CLI git 2.48.0 Fetch from CLI git 2.48.0 and later return origin/HEAD https://github.blog/open-source/git/highlights-from-git-2-48/ says: > With Git 2.48, if the remote has a default branch but refs/remotes/origin/HEAD > is missing locally, then a fetch will update it. This test was unintentionally testing the behavior of CLI git before 2.48.0. Other tests in GitClientFetchTest were testing that origin/HEAD was reported as a branch. * Show names/sha1 of detected branches on failure When the assertion fails, show the details of the set of branches so that the test failure has more information about the failure conditions. Thanks to @darinpope for the question that prompted the improvement * Remove unused cliGitCommand from GitAPITest (cherry picked from commit 8d5f9c3)
MarkEWaite
added a commit
to MarkEWaite/bom
that referenced
this pull request
Jan 18, 2025
The git client 5.0.0 automated tests unintentionally tested a command line git behavior that changed in command line git 2.48.0. The test is fixed in git client plugin 5.0.2 and git client plugin 6.1.1. More details are available in: * jenkinsci/git-client-plugin#1242 Resolves the test failure in the plugin BOM that required the addition of a test exclusion in: * jenkinsci#4232 * jenkinsci#4233 Testing done: * Confirmed that the test fails before this change with: PLUGINS=git-client LINE=2.462.x TEST=GitAPITest bash ./local-test.sh * Confirmed that the test passes after this change with: PLUGINS=git-client LINE=2.462.x TEST=GitAPITest bash ./local-test.sh
6 tasks
darinpope
pushed a commit
to jenkinsci/bom
that referenced
this pull request
Jan 18, 2025
The git client 5.0.0 automated tests unintentionally tested a command line git behavior that changed in command line git 2.48.0. The test is fixed in git client plugin 5.0.2 and git client plugin 6.1.1. More details are available in: * jenkinsci/git-client-plugin#1242 Resolves the test failure in the plugin BOM that required the addition of a test exclusion in: * #4232 * #4233 Testing done: * Confirmed that the test fails before this change with: PLUGINS=git-client LINE=2.462.x TEST=GitAPITest bash ./local-test.sh * Confirmed that the test passes after this change with: PLUGINS=git-client LINE=2.462.x TEST=GitAPITest bash ./local-test.sh
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adapt remote branch listing test to CLI git 2.48.0
This test was unintentionally testing the behavior of CLI git before 2.48.0. Other tests in GitClientFetchTest were testing that origin/HEAD was reported as a branch.
The GitHub blog post for git 2.48.0 says:
Testing done
Submitter checklist