Skip to content

Accept Git repository URLs in boulder recipe new - #837

Merged
ermo merged 15 commits into
mainfrom
boulder_new_git_recipes
Aug 7, 2026
Merged

Accept Git repository URLs in boulder recipe new#837
ermo merged 15 commits into
mainfrom
boulder_new_git_recipes

Conversation

@livingsilver94

@livingsilver94 livingsilver94 commented Aug 1, 2026

Copy link
Copy Markdown
Member

This PR makes the boulder recipe new command accept Git-styled URI to create a recipe out of a Git repository. a Git-styled URI is a regular URL prefixed with our git| specifier. The recipe created points to the hash of the current HEAD of the repo.

I've also simplified URL parsing in draft::monitoring::github and draft::monitoring::gitlab, as in my opinion the regexes were hard to grasp. We're still leveraging regexes (although ideally we would ditch them), but they're shorter and only match the path inside the URL. Other checks are performed using functions provided by the Url struct.
No functional change is introduced in these two modules except in gitlab's regular expressions, because the original ones weren't matching projects with a dot (".") in their name. In fact, I've also created a test with mesa3d.org's URL.

There's one effort remaining that is not covered in this PR: when running boulder recipe new <first_url> <second_url>, the command eventually fails because under the hood Git is trying to clone a repo inside the extraction root, that is not empty. Git is not happy about this. #838 will cover this case.

Fixes #537.

@livingsilver94 livingsilver94 changed the title Boulder new git recipes Accept Git repository URLs in boulder recipe new Aug 1, 2026
@livingsilver94
livingsilver94 force-pushed the boulder_new_git_recipes branch 2 times, most recently from d0c20bc to db9f41f Compare August 1, 2026 15:10
@livingsilver94
livingsilver94 marked this pull request as ready for review August 1, 2026 22:07
@ermo

ermo commented Aug 5, 2026

Copy link
Copy Markdown
Member

Looks sane to me, but will let a Rust expert chip in.

@tarkah tarkah left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM! Some nice cleanup in here as well. I have just two small comments.

Comment thread boulder/src/draft/upstream.rs
Comment thread boulder/src/draft/upstream.rs
@tarkah tarkah removed their assignment Aug 6, 2026
@ermo

ermo commented Aug 6, 2026

Copy link
Copy Markdown
Member

@livingsilver94 did you run just test with the MSRV compiler version?

Because I get failures w/rustc 1.91.1 that look like this:

image

@livingsilver94

Copy link
Copy Markdown
Member Author

No, I tested it with rustc 1.97.1 (8bab26f4f 2026-07-14) (Fedora 1.97.1-1.fc44). That is a crate I did not touch though. Want me to fix the error anyway?

@ermo

ermo commented Aug 7, 2026

Copy link
Copy Markdown
Member

No, I tested it with rustc 1.97.1 (8bab26f4f 2026-07-14) (Fedora 1.97.1-1.fc44). That is a crate I did not touch though. Want me to fix the error anyway?

If possible, that would be nice. =)

@livingsilver94
livingsilver94 force-pushed the boulder_new_git_recipes branch from 652ad58 to a656754 Compare August 7, 2026 09:26
@ermo
ermo merged commit 8de81e4 into main Aug 7, 2026
3 checks passed
@ermo
ermo deleted the boulder_new_git_recipes branch August 7, 2026 10:06
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.

Boulder: Add git| support in URIs supplied to recipe new command

3 participants