Skip to content

Protected Environments not supported #1130

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

Closed
nastrofaction opened this issue Jul 7, 2020 · 6 comments
Closed

Protected Environments not supported #1130

nastrofaction opened this issue Jul 7, 2020 · 6 comments
Labels
EE Issues related to the enterprise version of GitLab help wanted

Comments

@nastrofaction
Copy link

Description of the problem, including code/CLI snippet

Per API: https://docs.gitlab.com/ee/api/protected_environments.html we should be able to create protected environment but the code fails as it isn't supported

Expected Behavior

project.protectedenvironments.create({
                'name': env,
                'deploy_access_levels': [{"access_level": gitlab.MAINTAINER_ACCESS}]
            })

should create the protected environment

Actual Behavior

Doesn't work

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/gitlab/base.py", line 59, in __getattr__
    return self.__dict__["_updated_attrs"][name]
KeyError: 'protectedenvironments'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/gitlab/base.py", line 62, in __getattr__
    value = self.__dict__["_attrs"][name]
KeyError: 'protectedenvironments'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/gitlab/base.py", line 82, in __getattr__
    return self.__dict__["_parent_attrs"][name]
KeyError: 'protectedenvironments'

Specifications

  • python-gitlab version: python-gitlab-2.3.1
  • API version you are using (v3/v4): v4
  • Gitlab server version (or gitlab.com): gitlab.com
@max-wittig
Copy link
Member

I don't have access to Gitlab Premium. That's why I'm not really implementing these features, but I would be open to review any MRs regarding EE features.

@max-wittig max-wittig added EE Issues related to the enterprise version of GitLab help wanted labels Jul 8, 2020
@nastrofaction
Copy link
Author

Thanks for responding @max-wittig For now I am using cURL to complete my automation through API for protected environments. Once this is complete; I'll try to come back and submit MR for this.

@filip-malczak-bny
Copy link

@nastrofaction is there any update on this?

calve added a commit to calve/python-gitlab that referenced this issue Jun 21, 2022
- https://docs.gitlab.com/ee/api/protected_environments.html
- python-gitlab#1130

no write operation are implemented yet as I have no use case right now
and am not sure how it should be done
calve added a commit to calve/python-gitlab that referenced this issue Jun 22, 2022
- https://docs.gitlab.com/ee/api/protected_environments.html
- python-gitlab#1130

no write operation are implemented yet as I have no use case right now
and am not sure how it should be done
calve added a commit to calve/python-gitlab that referenced this issue Jun 22, 2022
- https://docs.gitlab.com/ee/api/protected_environments.html
- python-gitlab#1130

no write operation are implemented yet as I have no use case right now
and am not sure how it should be done
calve added a commit to calve/python-gitlab that referenced this issue Jun 22, 2022
- https://docs.gitlab.com/ee/api/protected_environments.html
- python-gitlab#1130

no write operation are implemented yet as I have no use case right now
and am not sure how it should be done
calve added a commit to calve/python-gitlab that referenced this issue Jun 22, 2022
- https://docs.gitlab.com/ee/api/protected_environments.html
- python-gitlab#1130

no write operation are implemented yet as I have no use case right now
and am not sure how it should be done
calve added a commit to calve/python-gitlab that referenced this issue Jun 22, 2022
- https://docs.gitlab.com/ee/api/protected_environments.html
- python-gitlab#1130

no write operation are implemented yet as I have no use case right now
and am not sure how it should be done
calve added a commit to calve/python-gitlab that referenced this issue Jun 22, 2022
- https://docs.gitlab.com/ee/api/protected_environments.html
- python-gitlab#1130

no write operation are implemented yet as I have no use case right now
and am not sure how it should be done
calve added a commit to calve/python-gitlab that referenced this issue Jun 22, 2022
- https://docs.gitlab.com/ee/api/protected_environments.html
- python-gitlab#1130

no write operation are implemented yet as I have no use case right now
and am not sure how it should be done
calve added a commit to calve/python-gitlab that referenced this issue Jun 22, 2022
- https://docs.gitlab.com/ee/api/protected_environments.html
- python-gitlab#1130

no write operation are implemented yet as I have no use case right now
and am not sure how it should be done
@calve
Copy link
Contributor

calve commented Jun 23, 2022

I added support for Protected Environments in #2084 which is merged but not released yet

Do note that the API use the name protected_environments and not protectedenvironments as specified in this issue

@nickbroon
Copy link
Contributor

Protected environment support is available since v3.6.0. Should this issues now be closed?

@nejch
Copy link
Member

nejch commented Jan 5, 2023

Oh, completely missed that one, good to do some cleanup here. Thanks a lot @nickbroon!

@nejch nejch closed this as completed Jan 5, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
EE Issues related to the enterprise version of GitLab help wanted
Projects
None yet
Development

No branches or pull requests

6 participants