Skip to content

feat: add non-recursive group config syntax (group/) - #1429

Open
itewk wants to merge 1 commit into
gitlabform:mainfrom
itewk:main
Open

itewk wants to merge 1 commit into
gitlabform:mainfrom
itewk:main

Conversation

@itewk

@itewk itewk commented Sep 16, 2026

Copy link
Copy Markdown
  • Add group/ trailing-slash key syntax for non-recursive group config, distinct from group/* which cascades to all subgroups
  • Add group_exact key type in _get_key_type() to classify /-ending keys
  • Update get_groups() to collect and deduplicate both /* and / keys
  • Update get_effective_config_for_group() to merge exact config on top of recursive config before the common merge
  • Add exact parameter to _get_group_config() to look up group/ keys
  • Add 14 unit tests covering config resolution, inherit: false interaction, key type classification, and project exclusion
  • Update docs/reference/index.md with the new configuration level

Closes #541. Based on the approach from PR #986.

Co-Authored-By: Claude Opus 4.6 [email protected]

* Add group/ trailing-slash key syntax for non-recursive group config,
distinct from group/* which cascades to all subgroups
* Add group_exact key type in _get_key_type() to classify /-ending keys
* Update get_groups() to collect and deduplicate both /* and / keys
* Update get_effective_config_for_group() to merge exact config on top
of recursive config before the common merge
* Add exact parameter to _get_group_config() to look up group/ keys
* Add 14 unit tests covering config resolution, inherit: false
interaction, key type classification, and project exclusion
* Update docs/reference/index.md with the new configuration level

Closes gitlabform#541. Based on the approach from PR gitlabform#986.

Co-Authored-By: Claude Opus 4.6 [email protected]
@itewk

itewk commented Sep 22, 2026

Copy link
Copy Markdown
Author

this would also provide a resolution to: #1427

if not has_parent_context:
self._validate_break_inheritance_flag(exact_config, group)
group_config = self._merge_configs(group_config, exact_config)
debug("*Effective* group/subgroup+exact config: %s", to_str(group_config))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What happens when there's a config like below:

projects_and_groups:
  my_group/:
    group_settings:
      inherit: false 
      visibility: public

Will it crash because there's no config from parent level to break the inheritance (i.e. no my_group/* paths with configs).

debug("*Exact* (non-recursive) config for %s: %s", group, to_str(exact_config))
has_parent_context = bool(common_config) or bool(group_config)
if not has_parent_context:
self._validate_break_inheritance_flag(exact_config, group)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Does it break inheritance for all hierarchy? For example:

projects_and_groups:
  "*":
    group_settings:
      from_common: true      # from the * (common) layer

  some_group/*:
    group_settings:
      from_recursive: true   # from the group/* layer

  some_group/:
    group_settings:
      inherit: false          # user expects to break ALL inheritance?
      visibility: public

Will the above break inheritance from * also for some_group/?

Comment thread pyproject.toml
[project]
name = "gitlabform"
version = "6.2.2"
version = "6.3.0"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please undo the version change. This is updated when we make a release.

Comment thread uv.lock
[[package]]
name = "gitlabform"
version = "6.2.2"
version = "6.3.0"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please undo the version change. This is updated when we make a release.

@itewk

itewk commented Sep 29, 2026

Copy link
Copy Markdown
Author

havn't forgotten aboutu this. circling back in a day or two to do the redsquest updates and respond on the othe rchain.

This branch is waiting to be deployed

1 waiting deployment
Integrate Pull Request — 4ae32f70 Waiting Sep 16, 2026 by itewk via Acceptance Tests / GitLab Ultimate #251
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.

How to add users ONLY to top-level group?

3 participants