Skip to content

feat(install): support hosted tree URLs for git sources#1502

Open
peter-jerry-ye wants to merge 7 commits intomainfrom
zihang/install-hosted-tree-url
Open

feat(install): support hosted tree URLs for git sources#1502
peter-jerry-ye wants to merge 7 commits intomainfrom
zihang/install-hosted-tree-url

Conversation

@peter-jerry-ye
Copy link
Contributor

Summary

  • add hosted tree URL parsing for binary install source
  • support GitHub and GitCode tree URL forms and map them into git URL + optional branch + optional path-in-repo
  • wire parsed tree URL components into git install dispatch
  • reject ambiguous input when source already contains a tree path and PATH_IN_REPO is also provided
  • add unit tests for hosted tree URL parsing and update install reference docs

Supported source forms

Notes

This PR is stacked on top of PR #1501 and should be reviewed after it.

Testing

  • cargo test -p moon install_binary
  • cargo test -p moon deps::tests

@semanticdiff-com
Copy link

semanticdiff-com bot commented Mar 5, 2026

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6df4219ddb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +136 to +140
let (branch, path_in_repo) = if after_tree.len() == 1 {
(Some(after_tree[0].to_string()), None)
} else {
(
Some(after_tree[0].to_string()),

Choose a reason for hiding this comment

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

P1 Badge Handle slash-containing refs in hosted tree URLs

This parser assumes the ref is always after_tree[0], so URLs like .../tree/feature/new-ui (a valid branch/tag name containing /) are misinterpreted as ref feature plus path_in_repo new-ui. In that case moon install will either check out the wrong ref or fail with a missing-path error, even though the copied hosted tree URL is valid; this affects common branch naming conventions such as feature/... and release/....

Useful? React with 👍 / 👎.

@peter-jerry-ye peter-jerry-ye force-pushed the zihang/install-exact-only branch 3 times, most recently from f65b0b1 to 7f52d3f Compare March 9, 2026 05:37
Base automatically changed from zihang/install-exact-only to main March 9, 2026 05:53
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.

1 participant