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

Add Gitlab group runners support #3935

Merged

Conversation

lgatellier
Copy link
Contributor

@lgatellier lgatellier commented Dec 22, 2021

SUMMARY

This PR adds Gitlab group runners support to community.general.gitlab_runner module.
This allow to register a new Gitlab Runner within group settings, its update & deletion as a non-admin user.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

gitlab_runner module

ADDITIONAL INFORMATION

This PR :

  • Adds a group string parameter to gitlab-runner module, similar to the project parameter, to specify the Gitlab group on which to register the runner
  • Fixes a bug on project & group runner creation/deletion, which was previously done using the project API, but needs to be done from root /runners API.
  • Adds a check to fail when both group and project and specified
- name: Register Gitlab Runner
  community.general.gitlab_runner:
    access_level: not_protected
    active: yes
    api_url: "{{ runner.gitlab_url }}"
    api_token: "{{ gitlab_api_token }}"
    description: "{{ inventory_hostname }}"
    locked: no
    group: "{{ runner.group }}"
    registration_token: "{{ runner.registration_token }}"
    state: present
    run_untagged: yes

@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added feature This issue/PR relates to a feature request gitlab module module new_contributor Help guide this first time contributor plugins plugin (any type) source_control labels Dec 22, 2021
@ansibullbot

This comment has been minimized.

@ansibullbot ansibullbot added ci_verified Push fixes to PR branch to re-run CI needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR labels Dec 22, 2021
@lgatellier lgatellier force-pushed the feat/gitlab-group-runner branch from 1bda100 to 4c56ada Compare December 22, 2021 19:40
@ansibullbot ansibullbot removed ci_verified Push fixes to PR branch to re-run CI needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR labels Dec 22, 2021
Copy link
Collaborator

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution! Can you please add a [changelog fragment](and if you have better ideas for fixing some of the issues, feel free to comment on these PRs!)?

plugins/modules/source_control/gitlab/gitlab_runner.py Outdated Show resolved Hide resolved
@felixfontein felixfontein added backport-4 check-before-release PR will be looked at again shortly before release and merged if possible. labels Dec 22, 2021
@lgatellier lgatellier force-pushed the feat/gitlab-group-runner branch 2 times, most recently from 4dbdec3 to ec61241 Compare December 24, 2021 00:57
@lgatellier lgatellier force-pushed the feat/gitlab-group-runner branch from 265c546 to b7a7779 Compare December 26, 2021 18:09
@ansibullbot ansibullbot added the needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR label Dec 26, 2021
@felixfontein
Copy link
Collaborator

CI failure is unrelated.

@ansibullbot ansibullbot removed the needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR label Dec 27, 2021
@lgatellier
Copy link
Contributor Author

@felixfontein I've done a few more tests, the PR is okay for me 😉

@lgatellier lgatellier force-pushed the feat/gitlab-group-runner branch 2 times, most recently from b9525a5 to ce9c245 Compare December 28, 2021 16:25
@ansibullbot ansibullbot added needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR and removed needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI labels Dec 28, 2021
@github-actions
Copy link

github-actions bot commented Dec 6, 2022

Docs Build 📝

Thank you for contribution!✨

This PR has been merged and your docs changes will be incorporated when they are next published.

@lgatellier lgatellier force-pushed the feat/gitlab-group-runner branch from d2cf8b5 to 31194d1 Compare December 6, 2022 19:29
@ansibullbot ansibullbot removed the ci_verified Push fixes to PR branch to re-run CI label Dec 6, 2022
@lgatellier lgatellier force-pushed the feat/gitlab-group-runner branch 2 times, most recently from 9f35aed to 5fb640c Compare December 6, 2022 20:53
@lgatellier lgatellier marked this pull request as ready for review December 6, 2022 22:16
@lgatellier lgatellier marked this pull request as draft December 6, 2022 22:16
@lgatellier lgatellier force-pushed the feat/gitlab-group-runner branch 2 times, most recently from 1f4e2cf to 1daa0f2 Compare December 10, 2022 15:19
@ansibullbot ansibullbot added the stale_ci CI is older than 7 days, rerun before merging label Dec 18, 2022
@lgatellier lgatellier force-pushed the feat/gitlab-group-runner branch from 1daa0f2 to 7996856 Compare March 11, 2023 17:52
@lgatellier lgatellier force-pushed the feat/gitlab-group-runner branch from 7996856 to b34df3b Compare March 11, 2023 17:53
@ansibullbot ansibullbot removed the stale_ci CI is older than 7 days, rerun before merging label Mar 11, 2023
@lgatellier lgatellier marked this pull request as ready for review March 11, 2023 19:29
@lgatellier
Copy link
Contributor Author

lgatellier commented Mar 11, 2023

@felixfontein Just back from some busy months, I rebased on main branch, and run some more tests with instance/group/project runners on a GitLab 15.8 self-hosted instance.

Thus I think this PR is finally ready to get a review 😉

Copy link
Collaborator

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! If nobody objects, I'll merge this in a week.

@felixfontein felixfontein removed the check-before-release PR will be looked at again shortly before release and merged if possible. label Mar 25, 2023
@felixfontein felixfontein merged commit f3be007 into ansible-collections:main Mar 25, 2023
@patchback
Copy link

patchback bot commented Mar 25, 2023

Backport to stable-6: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-6/f3be0076af3c7869edd9f3360bf6b4bc25cd93cb/pr-3935

Backported as #6234

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Mar 25, 2023
@felixfontein
Copy link
Collaborator

@lgatellier thanks a lot for your contribution!
@nejch @markuman thanks for your reviews!

felixfontein pushed a commit that referenced this pull request Mar 25, 2023
…rt (#6234)

Add Gitlab group runners support (#3935)

(cherry picked from commit f3be007)

Co-authored-by: Léo GATELLIER <26511053+lgatellier@users.noreply.github.com>
@lgatellier lgatellier deleted the feat/gitlab-group-runner branch November 1, 2023 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This issue/PR relates to a feature request gitlab has_issue module module plugins plugin (any type) source_control tests tests unit tests/unit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants