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

You can't enable builds for private projects #2

Closed
gdubicki opened this issue Aug 25, 2017 · 3 comments
Closed

You can't enable builds for private projects #2

gdubicki opened this issue Aug 25, 2017 · 3 comments

Comments

@gdubicki
Copy link
Member

Because of GitLab bug https://gitlab.com/gitlab-org/gitlab-ce/issues/27298 you can't use the following config:

my_group/my_project:
  project_settings:
    builds_enabled: true
    visibility_level: 0

because it results in HTTP 400 response from GitLab API:

{
  'project_feature.builds_access_level': [
    'cannot have higher visibility level than repository access level'
  ]
}

This is of the long standing bugs that was one of the reasons we implemented project skipping: https://github.com/egnyte/gitlabform/blob/master/config.yml#L119

But we can no longer skip such projects so I plan to implement a better workaround that will allow skipping only a part of project config (such as project_settings, deploy_keys etc.), even if it is configured on a group level (like we do for files: https://github.com/egnyte/gitlabform/blob/master/config.yml#L117 ).

gdubicki pushed a commit that referenced this issue Sep 3, 2017
with possibility to skip configuration sections
per project (a workaround for #2) and unified
skipping using "skip" keyword (changed from
"ignore" used up to this point for single files)
@gdubicki
Copy link
Member Author

So as a workaround for this you should skip project_settings for single projects within a group which have this problem, like this:

my_group/my_project:
  project_settings:
    skip: true

@gdubicki
Copy link
Member Author

gitlabform error output:

gitlabform.gitlab.core.UnexpectedResponseException: Request path='projects/XXX', method=PUT, data='{'public_builds': True, 'visibility_level': 10, 'only_allow_merge_if_all_discussions_are_resolved': False, 'builds_enabled': True, 'only_allow_merge_if_build_succeeds': False}' failed - expected code(s) 200, got code 400 & body: 'b'{"message":{"project_feature.builds_access_level":["cannot have higher visibility level than repository access level"]}}''

gdubicki pushed a commit that referenced this issue Feb 1, 2020
@gdubicki
Copy link
Member Author

gdubicki commented Feb 1, 2020

This issue is not valid anymore.

Note that the syntax of the config has changedin the mean time.

Please see an example how you should enable builds for a private project here: https://github.com/egnyte/gitlabform/blob/master/gitlabform/gitlabform/test/test_project_settings.py#L24

@gdubicki gdubicki closed this as completed Feb 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant