-
Notifications
You must be signed in to change notification settings - Fork 629
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
fix(runners): Namespace Application
tag
#2182
Conversation
@npalm Seems the TF checks are broken? |
For some reason the CI is failing, can you double check you are in sync? Should not fail since no TF files are changed. |
Thought I had the latest. Pulled down |
Strange, since develop and main are building without an issue. Including todays release. |
@npalm Looks like one of the policies had some unintended formatting applied. I revered and all checks are passing. |
Application
tagApplication
tag
@npalm Looks like this might be a one-time break where users will have to clean out old runners. OK to keep as is or do you have suggestions? |
@mcaulifn not a really good idea rigiht now. Only option coming to my mind is let the scale down lambda be aware of the old and new tag. And remove the old tag in a next major release. |
@mcaulifn it the PR ready for review? |
@npalm Should be good now |
export async function listEC2Runners(filters: ListRunnerFilters | undefined = undefined): Promise<RunnerList[]> { | ||
const ec2Statuses = filters?.statuses ? filters.statuses : ['running', 'pending']; | ||
const ec2 = new EC2(); | ||
const ec2Filters = [ |
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.
Not sure if it is really needed, but back in the days we have implemented here hardcoded that if not set a filter. A filter got enforced. I think this was done to avoid the scale down can terminate anything that is not owned.
Don't like this hidden magic and we should got cleaned it at some moment. I also updated the tested to see the impact when we remove the depecrated tag Application
. In that case you will find that the test for instance we no tags 'Instances with no tags.'
failes. Which is related to these default.s
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.
Which test did you update? I'll replicate and resolve.
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.
The test Instances with no tags.
on L134 in on this branch. Sorry for the late reply
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.
'Instances with no tags.'
should be changed to expect 0 and now it is failing for me.
Despite mockReturnValueOnce
being used throughout, and that instance definition not being used in the test in question, I am getting the two instances used at the top of the test. This appears to be an issue with the test rather than with the code. I'm still trying to track down how it is getting injected.
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.
Seems this bug is being hit. I'll try to work up a fix.
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.
I have not been able to find a work-around for the testing bug. @npalm any suggestions?
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.
I check the tests again.
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.
At least I know what the problem is. When I remove the support vor the tag Application in (runner.ts). Merge the two mocks back in a single mock like before, returning 2 objects. The test "Instances with no tags." starts failing. Running the test in isolation is not causing a problem. So somehow the mocks are not resetting well.
Was not able to find a solution, but this eems the issue.
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. |
@mcaulifn back from PTO, will try to check what I can do on this PR next week. |
Will dig in the PR soon, we are working on several breaking changes. So would like to got this one merged soon. That gives the option to clean up logic together with #2517 |
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. |
@mcaulifn I just started digging in the PR and running some test, keep you posted. |
@mcaulifn found 2 issues, would you have tim for a quick look? |
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.
@mcaulifn PR is good with one small request, can you add the permission as suggested in the comment. Thanks!
@mcaulifn thanks will have asap another check on the PR! |
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.
## [1.17.0](philips-labs/terraform-aws-github-runner@v1.16.1...v1.17.0) (2022-11-30) ### Features * **runners:** Namespace `Application` tag ([#2182](https://github.com/philips-labs/terraform-aws-github-runner/issues/2182)) ([a1a47a4](philips-labs/terraform-aws-github-runner@a1a47a4)) ### Bug Fixes * Adding missing input lambda vpc vars to syncer module ([#2701](https://github.com/philips-labs/terraform-aws-github-runner/issues/2701)) ([c91a96b](philips-labs/terraform-aws-github-runner@c91a96b))
Namespaces the
Application
byghr:Application
tag to avoid conflicting withApplication
tag set by policies.Resolves #2143