-
Notifications
You must be signed in to change notification settings - Fork 628
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
feat(runners): add support to disable default labels (Linux) #3491
feat(runners): add support to disable default labels (Linux) #3491
Conversation
b296740
to
eb9a4e6
Compare
I think I missed GitHub changes this. In the past the default labels are added by GitHub without control. When we introduced the JIT config the default labels are not added by default. But is this the same for non JIT? |
We're using JIT - and the default labels are added by default, that's why we have created this new variable and set it to false in the cases where we just want to use custom labels |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to find some time to test.
- Changes impacted the runner module should also reflected to the multi-runner module. See comment
- I think this option requires that JIT config is enabled. Can you hadd this to the docs of the introduced variable.
9b858e0
to
e945d21
Compare
For the reasons explained in the original post, this feature would be great, so you can enable runners without repository restrictions.
Maybe I am mistaken (and I might be!) but here are a few quick comments:
|
This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed if no further activity occurs. Thank you for your contributions. |
Sorry we had no time yet to dig in this PR. I do my best to check the PR in the coming week. Sorry for the delay. |
ed603ef
to
c0ebeb7
Compare
cd60c15
to
78a52a2
Compare
This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed if no further activity occurs. Thank you for your contributions. |
5d77fea
to
01b73bf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jgutierrezglez thanks for this great PR. I have tested several cases
- Default runner - works, requires a suggested change on defaults
- Multi runner (linux)
- Multi runner (linux) - with JIT
- Multi runner (windows)
For the multi runner I needed to make the follwoing adjusments:
- mutli-runner module runners.tf
Pass parametr into runner module:
runner_disable_default_labels = each.value.runner_config.runner_disable_default_labels
and avoid setting defaults if labels are disabled.
runner_labels = each.value.runner_config.runner_disable_default_labels ? sort(distinct(each.value.runner_config.runner_extra_labels)) : sort(distinct(concat(["self-hosted", each.value.runner_config.runner_os, each.value.runner_config.runner_architecture], each.value.runner_config.runner_extra_labels)))
I would say the PR is getting close to merge. To get it faster passed you could split the PR in two parts. First the linux part adding the feature, next another PR to fix the windows part.
Co-authored-by: Niek Palm <npalm@users.noreply.github.com>
… between linux and windows changes
@jgutierrezglez , this is a question rather than definitely something needs to change, but why does it say |
Thanks for the catch, there is no real reason to use $${extra_flags} and I just corrected |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made two tiny documentation suggestions. Rest looks good and tested for linux (amazon and ubuntu).
Maybe worth to add a small section in the docs to disuss the choice betwoon using default labels and disable them.
Besides those small notes good to go 🚀
Co-authored-by: Niek Palm <npalm@users.noreply.github.com>
Co-authored-by: Niek Palm <npalm@users.noreply.github.com>
9e14e8b
to
611fa17
Compare
I added a small note under "Configuration considerations" - let me know what you think about it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and all good, one tiny change requested
Co-authored-by: Niek Palm <npalm@users.noreply.github.com>
@@ Description Adding support for no default labels on Windows, see #3491
🤖 I have created a release *beep* *boop* --- ## [5.20.0](v5.19.0...v5.20.0) (2024-11-19) ### Features * **runners:** add support to disable default labels (Linux) ([#3491](#3491)) ([772e1a5](772e1a5)) @jgutierrezglez * **runners:** add support to disable default labels (Windows) ([#4261](#4261)) ([ad9bcc4](ad9bcc4)) @jgutierrezglez ### Bug Fixes * **lambda:** bump cross-spawn from 7.0.3 to 7.0.6 in /lambdas ([#4273](#4273)) ([dcec236](dcec236)) * **lambda:** bump the aws group in /lambdas with 7 updates ([#4266](#4266)) ([849549e](849549e)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: forest-releaser[bot] <80285352+forest-releaser[bot]@users.noreply.github.com>
In case the pool of runners deployed using this module are fully available for an wide GH org (no repository restrictions) any workflow configured to run in runners that contain just default labels in the runs-on definition:
e.g.
runs-on: self-hosted
runs-on: Linux
can end-up running in this pool without knowing it. That's why I have decided to remove the default labels from our runners and just rely on unique custom labels, and I believed the best way to do it by adding a runner_enable_default_labels variable - that by default is true (so, it doesn't change the current behavior), but it can help other people to deal with similar issues like the one described above.