Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8c1aaa3

Browse files
max-wittigJohnVillalovos
authored andcommitted
1 parentf4f7d7a commit8c1aaa3

File tree

6 files changed

+18
-18
lines changed

6 files changed

+18
-18
lines changed

‎docs/gl_objects/protected_container_repositories.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ References
1111

1212
+:class:`gitlab.v4.objects.ProjectRegistryRepositoryProtectionRuleRule`
1313
+:class:`gitlab.v4.objects.ProjectRegistryRepositoryProtectionRuleRuleManager`
14-
+:attr:`gitlab.v4.objects.Project.registry_repository_protection_rules`
14+
+:attr:`gitlab.v4.objects.Project.registry_protection_repository_rules`
1515

1616
* GitLab API: https://docs.gitlab.com/ee/api/container_repository_protection_rules.html
1717

@@ -20,11 +20,11 @@ Examples
2020

2121
List the container registry protection rules for a project::
2222

23-
registry_rules = project.registry_repository_protection_rules.list()
23+
registry_rules = project.registry_protection_repository_rules.list()
2424

2525
Create a container registry protection rule::
2626

27-
registry_rule = project.registry_repository_protection_rules.create(
27+
registry_rule = project.registry_protection_repository_rules.create(
2828
{
2929
'repository_path_pattern': 'test/image',
3030
'minimum_access_level_for_push': 'maintainer',
@@ -39,6 +39,6 @@ Update a container registry protection rule::
3939

4040
Delete a container registry protection rule::
4141

42-
registry_rule = project.registry_repository_protection_rules.delete(registry_rule.id)
42+
registry_rule = project.registry_protection_repository_rules.delete(registry_rule.id)
4343
# or
4444
registry_rule.delete()

‎gitlab/v4/objects/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@
5555
from .project_access_tokensimport*
5656
from .projectsimport*
5757
from .push_rulesimport*
58+
from .registry_protection_repository_rulesimport*
5859
from .registry_protection_rulesimport*
59-
from .registry_repository_protection_rulesimport*
6060
from .releasesimport*
6161
from .repositoriesimport*
6262
from .resource_groupsimport*

‎gitlab/v4/objects/projects.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,12 @@
8686
)
8787
from .project_access_tokensimportProjectAccessTokenManager# noqa: F401
8888
from .push_rulesimportProjectPushRulesManager# noqa: F401
89+
from .registry_protection_repository_rulesimport (# noqa: F401
90+
ProjectRegistryRepositoryProtectionRuleManager,
91+
)
8992
from .registry_protection_rulesimport (# noqa: F401; deprecated
9093
ProjectRegistryProtectionRuleManager,
9194
)
92-
from .registry_repository_protection_rulesimport (# noqa: F401
93-
ProjectRegistryRepositoryProtectionRuleManager,
94-
)
9595
from .releasesimportProjectReleaseManager# noqa: F401
9696
from .repositoriesimportRepositoryMixin
9797
from .resource_groupsimportProjectResourceGroupManager
@@ -242,7 +242,7 @@ class Project(
242242
protectedtags:ProjectProtectedTagManager
243243
pushrules:ProjectPushRulesManager
244244
registry_protection_rules:ProjectRegistryProtectionRuleManager
245-
registry_repository_protection_rules:ProjectRegistryRepositoryProtectionRuleManager
245+
registry_protection_repository_rules:ProjectRegistryRepositoryProtectionRuleManager
246246
releases:ProjectReleaseManager
247247
resource_groups:ProjectResourceGroupManager
248248
remote_mirrors:"ProjectRemoteMirrorManager"

‎gitlab/v4/objects/registry_repository_protection_rules.pyrenamed to ‎gitlab/v4/objects/registry_protection_repository_rules.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class ProjectRegistryRepositoryProtectionRule(SaveMixin, RESTObject):
1515
classProjectRegistryRepositoryProtectionRuleManager(
1616
ListMixin,CreateMixin,UpdateMixin,RESTManager
1717
):
18-
_path="/projects/{project_id}/registry/repository/protection/rules"
18+
_path="/projects/{project_id}/registry/protection/repository/rules"
1919
_obj_cls=ProjectRegistryRepositoryProtectionRule
2020
_from_parent_attrs= {"project_id":"id"}
2121
_create_attrs=RequiredOptional(

‎tests/functional/api/test_registry.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ def protected_registry_feature(gl: Gitlab):
1111

1212
@pytest.mark.skip(reason="Not released yet")
1313
deftest_project_protected_registry(project:Project):
14-
rules=project.registry_repository_protection_rules.list()
14+
rules=project.registry_protection_repository_rules.list()
1515
assertisinstance(rules,list)
1616

17-
protected_registry=project.registry_repository_protection_rules.create(
17+
protected_registry=project.registry_protection_repository_rules.create(
1818
{
1919
"repository_path_pattern":"test/image",
2020
"minimum_access_level_for_push":"maintainer",

‎tests/unit/objects/test_registry_protection_rules.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def resp_list_protected_registries():
2121
withresponses.RequestsMock()asrsps:
2222
rsps.add(
2323
method=responses.GET,
24-
url="http://localhost/api/v4/projects/1/registry/repository/protection/rules",
24+
url="http://localhost/api/v4/projects/1/registry/protection/repository/rules",
2525
json=[protected_registry_content],
2626
content_type="application/json",
2727
status=200,
@@ -34,7 +34,7 @@ def resp_create_protected_registry():
3434
withresponses.RequestsMock()asrsps:
3535
rsps.add(
3636
method=responses.POST,
37-
url="http://localhost/api/v4/projects/1/registry/repository/protection/rules",
37+
url="http://localhost/api/v4/projects/1/registry/protection/repository/rules",
3838
json=protected_registry_content,
3939
content_type="application/json",
4040
status=201,
@@ -50,7 +50,7 @@ def resp_update_protected_registry():
5050
withresponses.RequestsMock()asrsps:
5151
rsps.add(
5252
method=responses.PATCH,
53-
url="http://localhost/api/v4/projects/1/registry/repository/protection/rules/1",
53+
url="http://localhost/api/v4/projects/1/registry/protection/repository/rules/1",
5454
json=updated_content,
5555
content_type="application/json",
5656
status=200,
@@ -59,13 +59,13 @@ def resp_update_protected_registry():
5959

6060

6161
deftest_list_project_protected_registries(project,resp_list_protected_registries):
62-
protected_registry=project.registry_repository_protection_rules.list()[0]
62+
protected_registry=project.registry_protection_repository_rules.list()[0]
6363
assertisinstance(protected_registry,ProjectRegistryRepositoryProtectionRule)
6464
assertprotected_registry.repository_path_pattern=="test/image"
6565

6666

6767
deftest_create_project_protected_registry(project,resp_create_protected_registry):
68-
protected_registry=project.registry_repository_protection_rules.create(
68+
protected_registry=project.registry_protection_repository_rules.create(
6969
{
7070
"repository_path_pattern":"test/image",
7171
"minimum_access_level_for_push":"maintainer",
@@ -76,7 +76,7 @@ def test_create_project_protected_registry(project, resp_create_protected_regist
7676

7777

7878
deftest_update_project_protected_registry(project,resp_update_protected_registry):
79-
updated=project.registry_repository_protection_rules.update(
79+
updated=project.registry_protection_repository_rules.update(
8080
1, {"repository_path_pattern":"abc*"}
8181
)
8282
assertupdated["repository_path_pattern"]=="abc*"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp