Skip to content

Conversation

rbro112
Copy link
Member

@rbro112 rbro112 commented Aug 12, 2025

Adds default handling of head_ref (branch name) to the mobile-app upload subcommand. This will leverage the head.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.

@rbro112 rbro112 requested review from szokeasaurusrex and a team as code owners August 12, 2025 17:11
Copy link
Member Author

rbro112 commented Aug 12, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

cursor[bot]

This comment was marked as outdated.

@rbro112 rbro112 changed the title Add default vcs base_ref parsing for mobile-app subcommand feat(mobile-app): Add default vcs base_ref parsing for mobile-app subcommand Aug 12, 2025
Copy link
Member

Deferring review until after HackWeek – please ping me if you need a review more urgently

Copy link
Member

@szokeasaurusrex szokeasaurusrex left a 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!

Comment on lines 143 to 146
// 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.
Copy link
Member

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

@rbro112 rbro112 force-pushed the ryan/add_default_vcs_base_ref_parsing_for_mobile-app_subcommand branch from f6fa2a9 to 76521d3 Compare August 26, 2025 17:22
cursor[bot]

This comment was marked as outdated.

Copy link
Member

@szokeasaurusrex szokeasaurusrex left a 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

@rbro112 rbro112 force-pushed the ryan/add_default_vcs_base_ref_parsing_for_mobile-app_subcommand branch from c4afc9d to b83b917 Compare August 27, 2025 15:52
Copy link
Member

@szokeasaurusrex szokeasaurusrex left a 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.
Copy link
Member

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.

Copy link
Member Author

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.

@rbro112 rbro112 merged commit 9064d5e into master Aug 27, 2025
24 checks passed
@rbro112 rbro112 deleted the ryan/add_default_vcs_base_ref_parsing_for_mobile-app_subcommand branch August 27, 2025 16:36
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.

2 participants