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

Group setting is being skipped #334

Closed
amimas opened this issue Feb 9, 2022 · 4 comments · Fixed by #350
Closed

Group setting is being skipped #334

amimas opened this issue Feb 9, 2022 · 4 comments · Fixed by #350
Labels

Comments

@amimas
Copy link
Collaborator

amimas commented Feb 9, 2022

Describe the bug

Certain attributes of group settings is not being recognized when it is added/updated in gitlabform config. I needed to configure a new setting for a specific group. My initial config was:

config_version: 2
gitlab:
  api_version: 4

projects_and_groups:
  dev-group/team1-subgroup/*:
    group_settings:
      description: Projects developed and maintained by team1.
      project_creation_level: maintainer
      subgroup_creation_level: owner
      visibility: internal
      mentions_disabled: true
      request_access_enabled: false

I needed to configure template settings at the group level. The setting is available as file_template_project_id attribute of group update api. So, I added that config, which looks like this:

config_version: 2
gitlab:
  api_version: 4

projects_and_groups:
  dev-group/team1-subgroup/*:
    group_settings:
      description: Projects developed and maintained by team1.
      project_creation_level: maintainer
      subgroup_creation_level: owner
      visibility: internal
      mentions_disabled: true
      request_access_enabled: false
      file_template_project_id: 485

After running gitlabform, the added config was not being applied. The dry-run mode does show the difference:

Processing section 'group_settings' in dry-run mode.
group_settings changes:
             description: "Projects developed and maintained by team1." => "Projects developed and maintained by  team1."
  project_creation_level: "maintainer"                                          => "maintainer"                                         
 subgroup_creation_level: "owner"                                               => "owner"                                              
              visibility: "internal"                                            => "internal"                                           
       mentions_disabled: true                                                  => true                                                 
  request_access_enabled: false                                                 => false                                                
file_template_project_id: "???"                                                 => 485                                                  
Skipping section 'group_members' - not in config.
Skipping section 'group_ldap_links' - not in config.
Skipping section 'group_badges' - not in config.
:: # of groups processed successfully: 1
:: # of projects processed successfully: 0

But when I try to apply it in verbose mode, I realized that gitlabform thinks there are no changes to be applied.

# gitlabform --config test-config.yml --verbose ALL_DEFINED
🏗  GitLabForm version: 2.10.0 = the latest stable 😊
Reading config from file: test-config.yml
Connected to GitLab version: 14.5.2-ee (4511944420f)
>>> Getting ALL_DEFINED groups and projects...
:: # of groups to process: 1
groups: ['dev-group/team1-subgroup']
:: # of projects to process: 0
:: (# of omitted projects - empty effective config: 18)
projects: []
omitted projects - empty effective config: [<list of projects goes here>]
@ (1/1) Processing group: dev-group/team1-subgroup
Skipping section 'group_secret_variables' - not in config.
Processing section 'group_settings'
group_settings in dev-group/team1-subgroup doesn't need an update.
Skipping section 'group_members' - not in config.
Skipping section 'group_ldap_links' - not in config.
Skipping section 'group_badges' - not in config.
:: # of groups processed successfully: 1
:: # of projects processed successfully: 0

GitLabForm version

Output of gitlabform -V

🏗  GitLabForm version: 2.10.0 = the latest stable 😊

GitLab version

F.e. 14.5.2-ee

@gdubicki
Copy link
Member

Hi @amimas!

Sorry for the delay. I think I got it working in #350 but I cannot verify that because we don't have GitLab premium license available for tests - only "starter" one.

@gdubicki
Copy link
Member

Please verify the pre-release 2.10.1rc1, @amimas. If it's fine, I will make a final release.

@amimas
Copy link
Collaborator Author

amimas commented Mar 25, 2022

Cool!! I'll try and test it out soon. Thanks so much for looking into it.

@amimas
Copy link
Collaborator Author

amimas commented Mar 25, 2022

@gdubicki - just tested the rc version. It does set the file_temolate_project_id for the group setting. 👏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants