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

fix(remote): fallback to legacy snapcraft if under shallow git clone #4498

Merged
merged 6 commits into from
Dec 15, 2023

Conversation

syu-w
Copy link
Contributor

@syu-w syu-w commented Dec 14, 2023

Git shallow clone is not pushable by design. Fallback to legacy remote build which has workaround. This only support core20 and core22. Any other bases and devel will report error.

@codecov-commenter
Copy link

codecov-commenter commented Dec 14, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (a763c54) 89.18% compared to head (de74dec) 89.20%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4498      +/-   ##
==========================================
+ Coverage   89.18%   89.20%   +0.01%     
==========================================
  Files         321      321              
  Lines       21727    21755      +28     
==========================================
+ Hits        19378    19407      +29     
+ Misses       2349     2348       -1     

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

@syu-w syu-w requested review from mr-cal and lengau and removed request for mr-cal December 14, 2023 20:52
@syu-w syu-w force-pushed the work/CRAFT-2335-shallow-clone branch 2 times, most recently from 8a70c19 to 7d482c8 Compare December 14, 2023 20:54
@syu-w syu-w requested a review from mr-cal December 14, 2023 21:01
Git shallow clone is not pushable by design. Fallback to legacy remote
build which has workaround. This only support core20 and core22. Any
other bases and devel will report error.
@syu-w syu-w force-pushed the work/CRAFT-2335-shallow-clone branch from 7d482c8 to 4527498 Compare December 14, 2023 21:02
@syu-w syu-w marked this pull request as ready for review December 14, 2023 21:44
Copy link
Collaborator

@mr-cal mr-cal left a comment

Choose a reason for hiding this comment

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

Good start but there are a few code smells. The business logic in the flowchart had 4 checks and 2 outcomes (either running the new or legacy remote-build).

The code here is now out-of-order with the flowchart, introduces more checks, and adds more outcomes (raising exceptions within the business logic).

@syu-w syu-w requested review from mr-cal and lengau December 15, 2023 19:59
Copy link
Collaborator

@mr-cal mr-cal left a comment

Choose a reason for hiding this comment

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

Looks good! Just a minor comment about an emit and an error class.

@syu-w syu-w requested a review from mr-cal December 15, 2023 21:41
Copy link
Collaborator

@mr-cal mr-cal left a comment

Choose a reason for hiding this comment

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

👍

@mr-cal mr-cal merged commit 1e28514 into main Dec 15, 2023
8 checks passed
syu-w added a commit that referenced this pull request Jan 29, 2024
Shallow git repos are not designed to be pushed, so the new
remote-builder now raises an error for shallowly cloned repos.
core20 and core22 projects in shallow clone repos fall back
to the legacy remote-builder to retain compatibility.
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