-
Notifications
You must be signed in to change notification settings - Fork 622
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: Adding the possibility of removing the default labels #3491
base: main
Are you sure you want to change the base?
feat: Adding the possibility of removing the default labels #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
@sdarwin I would have been great to be able to introduce a proper variable validation with TF 1.9, but in order to keep backwards compatibility, I updated the code to ignore runner_enable_default_labels = false (use the default value => true) in case enable_jit_config and enable_ephemeral_runners aren't set to true. |
I don't understand how there is any connection between a new method of terraform variable validation, and what ought to be done here: conditionally adding the "--no-default-labels" flag to |
0d7e0c2
to
3ea9682
Compare
Reverted the last change and added the |
@jgutierrezglez , great. I believe that is logically the correct step. |
In the absence of automated CI tests, how about manual testing. Run through these cases and report back the findings. Not what might be expected, but what the tests show. Post screen shots perhaps. Let's say your chosen labels are [a,b,c]. We'll call them my_custom_labels. You can use any that you prefer. Check in the Github control panel UI at https://github.com/_my_org_/_my_repo_/settings/actions/runners to see what labels are ultimately applied by Terraform. Let's call that "real resulting labels". Fill in the blanks.
If all eight tests are correct, hopefully the maintainers will agree the PR is ready. |
Windows (add at least some windows tests) |
How about this instead?
|
3119e48
to
3b287fc
Compare
781a629
to
0a661ca
Compare
This PR is still on my radar, but in the meantime started to refactor the webhook as well. See #4160 This change should not impact this PR, but good to be aware. |
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.
Thx the PR already looks quite good. But made some comments to suggest different names. Please can you also update the following parts.
- Update the windows start script to read the parameter
- Update docs, add the paramater: https://philips-labs.github.io/terraform-aws-github-runner/configuration/#aws-ssm-parameters
- Update the multi-runner module to pass the parameter down.
Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action Co-authored-by: npalm <[email protected]>
90f4998
to
66bc44c
Compare
6941e3b
to
de25eca
Compare
@jgutierrezglez feel free to grant maintainers access to write to the PR branch. There is a checkbox you can tick to that. In that case I can push my updates used for local testing as well. |
It's already enabled, you should be able to push your updates |
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.