You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you archive a subgroup but still sync the parent group as it has some other repositories next to the archived subgroup, then the archived subgroup still shows up in a config file with an empty object {} as value.
In my opinion the vcspull import gitlab command should ignore archived groups the same as it ignores archived repositories.
In --mode org without --flatten-groups, each GitLab subgroup maps to its own workspace root key in raw_config (for example ./parent/archived-sub:).
When that subgroup is archived and the parent group is re-synced with --sync or --prune, _run_import() deletes each stale repo entry via del ws_entries[repo_name] while leaving the outer ws_label key in raw_config, writing "./parent/archived-sub": {} back to YAML/JSON.
Dropping raw_config[ws_label] should be gated on ws_entries becoming empty because at least one entry in that section was pruned during the run (preserving any unrelated empty workspace sections a user already had in the file).
GitLabImporter._fetch_group() calls GET /groups/{target}/projects with include_subgroups=true and, when --archived is not passed, archived=false.
In GitLab's Groups REST API, archiving a group or subgroup (POST /groups/:id/archive) marks the namespace read-only/archived at the group level without flipping project-level archived: true on child projects; archived=false only checks project-level archived, whereas active=true (added in GitLab 18.8 on GET /groups/:id/projects and GET /groups/:id/descendant_groups) excludes projects whose group or ancestor subgroup is archived or marked for deletion.
Passing active=true alongside archived=false when not options.include_archived (and verifying fallback behavior on self-hosted GitLab < 18.8, e.g. checking /groups/{target}/descendant_groups if active is ignored) prevents fresh imports from pulling projects out of archived subgroups as well.
Related PRs
test(import[prune]) Add edge-case tests for prune scoping #533 (rebased onto v1.69.0 at 0051e8c) tests cross-workspace pruning in tests/cli/test_import_repos.py (test_import_prune_same_source_across_workspaces), where pruning every repo from a secondary workspace currently leaves {} behind.
Activity
tony commentedon Nov 28, 2026
Root cause
Two separate behaviors combine to produce
#579onv1.69.0(c113032):Pruning removes stale entries inside a subgroup section without removing the emptied workspace key (
src/vcspull/cli/import_cmd/_common.py,src/vcspull/cli/import_cmd/_common.py):--mode orgwithout--flatten-groups, each GitLab subgroup maps to its own workspace root key inraw_config(for example./parent/archived-sub:).--syncor--prune,_run_import()deletes each stale repo entry viadel ws_entries[repo_name]while leaving the outerws_labelkey inraw_config, writing"./parent/archived-sub": {}back to YAML/JSON.raw_config[ws_label]should be gated onws_entriesbecoming empty because at least one entry in that section was pruned during the run (preserving any unrelated empty workspace sections a user already had in the file).GitLab group-level archiving vs. project-level
archived=false(src/vcspull/_internal/remotes/gitlab.py,src/vcspull/_internal/remotes/gitlab.py):GitLabImporter._fetch_group()callsGET /groups/{target}/projectswithinclude_subgroups=trueand, when--archivedis not passed,archived=false.POST /groups/:id/archive) marks the namespace read-only/archived at the group level without flipping project-levelarchived: trueon child projects;archived=falseonly checks project-levelarchived, whereasactive=true(added in GitLab 18.8 onGET /groups/:id/projectsandGET /groups/:id/descendant_groups) excludes projects whose group or ancestor subgroup is archived or marked for deletion.active=truealongsidearchived=falsewhennot options.include_archived(and verifying fallback behavior on self-hosted GitLab< 18.8, e.g. checking/groups/{target}/descendant_groupsifactiveis ignored) prevents fresh imports from pulling projects out of archived subgroups as well.Related PRs
v1.69.0at 0051e8c) tests cross-workspace pruning intests/cli/test_import_repos.py(test_import_prune_same_source_across_workspaces), where pruning every repo from a secondary workspace currently leaves{}behind.v1.69.0with updatedUPDATE_URLandSKIP_UNCHANGEDprovenance/pin handling directly above the prune loop insrc/vcspull/cli/import_cmd/_common.py.