Skip to content
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

Enable auto-formatting subgroups in flake names #145

Merged
merged 16 commits into from
Jun 25, 2024

Conversation

lucperkins
Copy link
Member

@lucperkins lucperkins commented Jun 19, 2024

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.

src/push_context.rs Outdated Show resolved Hide resolved
@lucperkins lucperkins requested review from grahamc and cole-h June 19, 2024 18:09
src/cli/mod.rs Outdated Show resolved Hide resolved
@lucperkins lucperkins merged commit 9f6ba9b into main Jun 25, 2024
10 checks passed
@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