tags module¶
The tags module of GitLab Guard.
- class confirm.gitlab_guard.tags.ProtectedTags(project, expected, fix)¶
The class which does all the heavy load to compare the expected, with the current protected tags.
- Parameters:
project (gitlab.v4.objects.projects.Project) – The project
expected (dict) – The expected protected tags
fix (bool) – Fix violations automatically
- create(name, expected)¶
Create a new protected tag.
- Parameters:
name (str) – The tag name
expected (dict) – The expected settings
- property current¶
The currently protected tags.
- Returns:
The currently protected tags
- Return type:
dict
- delete(tag)¶
Delete a protected tag.
- Parameters:
tag (gitlab.v4.objects.tags.ProjectProtectedBranch) – The protected tag
- property expected¶
The expected protected tags.
The method will replace the level with a proper
gitlab.const.AccessLevelinstance.- Returns:
The expected protected tags
- Return type:
list
- update_if_required(name, expected, current)¶
Update a protected tag if required.
- Parameters:
name (str) – The tag name
expected (dict) – The expected settings
current (gitlab.v4.objects.tags.ProjectProtectedBranch) – The current tag
- Returns:
State if something has changed
- Return type:
bool
- verify()¶
Verify the protected tags.
The method will check the project repository status. If it’s disabled the verification will be skipped.
- Returns:
Violations
- Return type:
int
- Raises:
UpdateError – When project couldn’t be updated