Skip to content

Enable auto-formatting subgroups in flake names - #145

Merged
lucperkins merged 16 commits into
mainfrom
subgroups-flatten-slashes
Jun 25, 2024
Merged

lucperkins merged 16 commits into
mainfrom
subgroups-flatten-slashes

Conversation

@lucperkins

@lucperkins lucperkins commented Jun 19, 2024 •

Copy link
Copy Markdown
Member

Gitlab supports subgroups that can nested up to 20 levels, which doesn't work well without our {owner}/{repo} schema for flakes. This PR handles subgroup names by converting all slashes past the first one into dashes. Some example conversions:

"a/b" => "a/b"
"a/b/c" => "a/b-c"
"a/b/c/d" => "a/b-c-d"
"a/b/c/d/e/f/g/h/i/j/k" => "a/b-c-d-e-f-g-h-i-j-k"

There's also a built-in escape hatch from this behavior via FLAKEHUB_PUSH_DISABLE_SUBGROUPS or --disable-subgroups.

Comment thread src/push_context.rs Resolved
@lucperkins
lucperkins requested review from cole-h and grahamc June 19, 2024 18:09
Comment thread src/cli/mod.rs Resolved
@lucperkins
lucperkins merged commit 9f6ba9b into main Jun 25, 2024
@lucperkins
lucperkins deleted the subgroups-flatten-slashes branch June 25, 2024 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants