gitlab_label: ignore `archived` field when comparing labels by russoz · Pull Request #13006 · ansible-collections/community.general · GitHub
Skip to content

gitlab_label: ignore archived field when comparing labels - #13006

Draft
russoz wants to merge 2 commits into
ansible-collections:mainfrom
russoz-ansible:gitlab-label-archived
Draft

russoz wants to merge 2 commits into
ansible-collections:mainfrom
russoz-ansible:gitlab-label-archived

Conversation

@russoz

@russoz russoz commented Oct 18, 2026

Copy link
Copy Markdown
Collaborator
SUMMARY

Newer GitLab versions return an archived field for labels. gitlab_label compares the requested labels with the labels returned by the server, so every run reported existing labels as updated (changed=true), breaking idempotency.

The field is now removed before the comparison, like the other server-only fields.

Found by running the gitlab_label integration tests against GitLab CE 19.5.0 (see PR #13005).

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

gitlab_label

ADDITIONAL INFORMATION

Before the change, re-applying an existing label in the integration tests:

TASK [gitlab_label : Group label - Create Label ( Idempotency test )] **********
changed: [testhost] => {"changed": true, "labels": {"added": [], "removed": [], "untouched": [], "updated": ["ansible_test_label"]}, ...

fatal: [testhost]: FAILED! => {
    "assertion": "gitlab_group_label_create_idempotence is not changed",

With the change, the gitlab_label integration target passes against GitLab CE 19.5.0.

AI (Claude) was used to assist with this contribution.

🤖 Generated with Claude Code

Newer GitLab versions return an archived field for labels, which made
every run report existing labels as updated.

Assisted-by: Claude Opus 5.5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ansibullbot

Copy link
Copy Markdown
Collaborator

@ansibullbot ansibullbot added bug This issue/PR relates to a bug module module plugins plugin (any type) small_patch Hopefully easy to review labels Oct 18, 2026
@russoz
russoz marked this pull request as draft October 18, 2026 00:15
Assisted-by: Claude Opus 5.5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ansibullbot ansibullbot added WIP Work in progress and removed small_patch Hopefully easy to review labels Oct 18, 2026
@felixfontein felixfontein added check-before-release PR will be looked at again shortly before release and merged if possible. backport-12 Automatically create a backport for the stable-12 branch backport-13 Automatically create a backport for the stable-13 branch labels Oct 18, 2026
@felixfontein

Copy link
Copy Markdown
Collaborator

As far as I can tell this is OK for a hot-fix, but eventually it would be better if archived is properly supported by the module (so you can also modify that flag through the module).

@felixfontein

Copy link
Copy Markdown
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-12 Automatically create a backport for the stable-12 branch backport-13 Automatically create a backport for the stable-13 branch bug This issue/PR relates to a bug check-before-release PR will be looked at again shortly before release and merged if possible. module module plugins plugin (any type) WIP Work in progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants