-
-
Notifications
You must be signed in to change notification settings - Fork 234
feat(mobile-app): Add default vcs base_ref parsing for mobile-app subcommand #2706
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
feat(mobile-app): Add default vcs base_ref parsing for mobile-app subcommand #2706
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Deferring review until after HackWeek – please ping me if you need a review more urgently |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor comments, otherwise lgtm!
src/commands/mobile_app/upload.rs
Outdated
// Try to get the current ref from the VCS if not provided | ||
// Note: git_repo_head_ref will return an error for detached HEAD states, | ||
// which .ok() converts to None - this prevents sending "HEAD" as a branch name | ||
// In that case, the user will need to provide a valid branch name. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment appears to be outdated, as we are no longer calling .ok()
on None
here
f6fa2a9
to
76521d3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think Cursor identified a potentially legit concern with the test
c4afc9d
to
b83b917
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, I have a question though. Please check it before merging
// Try to get the current ref from the VCS if not provided | ||
// Note: git_repo_head_ref will return an error for detached HEAD states, | ||
// which the error handling converts to None - this prevents sending "HEAD" as a branch name | ||
// In that case, the user will need to provide a valid branch name. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[question] Does this imply that the head_ref
is required? From what I can tell right now, we don't validate its presence locally, so if it is required by the server, we would likely get a 4xx response when attempting the upload. If that is the case, we should likely return an error here, rather than swallow the error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not required, it is optional on the backend so no response failure if not provided.
Adds default handling of
head_ref
(branch name) to themobile-app upload
subcommand. This will leverage thehead.shorthand()
value if no value is provided by the user.Also handles the detached HEAD state with some logging that will require the user to specify using the command arguments.