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

[SDTEST-126] add different fallbacks for unshallowing remotes #218

Merged
merged 1 commit into from
Aug 16, 2024

Conversation

anmarchenko
Copy link
Member

What does this PR do?
Our current git unshallowing command is optimised, but it might fail under a different circumstances.

For example git rev-parse HEAD fails if the local HEAD is a commit that has not been pushed to the remote.

We will add the following fallbacks:

  • $(git rev-parse --abbrev-ref --symbolic-full-name @{upstream}) - we try this first, but it might fail too if the CI is working on a detached HEAD or maybe branch tracking hasn’t been set up
  • provide no remote as a last resort

Motivation
Improve git unshallowing resilience

How to test the change?
Unit test is provided

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.91%. Comparing base (d56ec05) to head (c5ac583).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #218      +/-   ##
==========================================
+ Coverage   98.89%   98.91%   +0.02%     
==========================================
  Files         261      261              
  Lines       12291    12310      +19     
  Branches      557      558       +1     
==========================================
+ Hits        12155    12177      +22     
+ Misses        136      133       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@anmarchenko anmarchenko merged commit 1e85028 into main Aug 16, 2024
28 checks passed
@anmarchenko anmarchenko deleted the anmarchenko/git_unshallowing_fallbacks branch August 16, 2024 11:14
@github-actions github-actions bot added this to the 1.4.0 milestone Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants