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

fixup tagGrepQuery #3725

Merged
merged 1 commit into from
Nov 7, 2023
Merged

fixup tagGrepQuery #3725

merged 1 commit into from
Nov 7, 2023

Conversation

oleksandr-didyk
Copy link
Contributor

Resolves issue found by https://dev.azure.com/dnceng/internal/_git/dotnet-release/pullRequest/35064#1699280994

During porting the changes introduced by #3716 to internal project discovered a small issue with the tagGrepQuery regex, specifically an un-escaped symbol.

Fix tested in internal project - https://dev.azure.com/dnceng/internal/_git/dotnet-release/pullrequest/35064

@oleksandr-didyk oleksandr-didyk merged commit 8d7d957 into main Nov 7, 2023
1 check passed
@@ -160,7 +160,7 @@ stages:
# 083b8b9fe09d04205e87bca0b378e4a3ad74a239 refs/tags/v8.0.0-rc.1.23419.4
# 113d797bc90104bb4f1cc51e1a462cf3d4ef18fc refs/tags/v8.0.0-rc.1.23419.4^{}
# We want to match on both.
tagGrepQuery="refs/tags/$tag_name\(^{}\)\?$"
tagGrepQuery="refs/tags/$tag_name\(\^{}\)\?$"

echo "git ls-remote --tags destination | grep -q $tagGrepQuery"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the random drive by comment: if you ever see SIGPIPE or broken pipe errors, these grep -q calls might be the culprit. grep -q closes the input pipe as soon as it finds a match, so if the first command (git) is still trying to send some input, it will exit with that broken pipe error.

Copy link
Contributor Author

@oleksandr-didyk oleksandr-didyk Nov 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the pointer! Our validation builds caught this issue almost instantly and your comment saved us a good chunk of time investigating it.

Tried to fix it in #3731

@mthalman mthalman deleted the fixup-tag-grep-query branch November 7, 2023 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants