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

fix(runners): Namespace Application tag #2182

Merged
merged 13 commits into from
Nov 30, 2022

Conversation

mcaulifn
Copy link
Contributor

@mcaulifn mcaulifn commented Jun 22, 2022

Namespaces the Application by ghr:Application tag to avoid conflicting with Application tag set by policies.

Resolves #2143

@mcaulifn
Copy link
Contributor Author

@npalm Seems the TF checks are broken?

@npalm
Copy link
Member

npalm commented Jun 23, 2022

For some reason the CI is failing, can you double check you are in sync? Should not fail since no TF files are changed.

@mcaulifn
Copy link
Contributor Author

Thought I had the latest. Pulled down develop again but still failing.

@npalm
Copy link
Member

npalm commented Jun 23, 2022

Strange, since develop and main are building without an issue. Including todays release.

@mcaulifn
Copy link
Contributor Author

@npalm Looks like one of the policies had some unintended formatting applied. I revered and all checks are passing.

@npalm npalm self-requested a review June 27, 2022 20:18
@npalm npalm changed the title fix(tag): Namespace Application tag fix(runners): Namespace Application tag Jun 27, 2022
@mcaulifn
Copy link
Contributor Author

@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?

@npalm
Copy link
Member

npalm commented Jun 30, 2022

@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.

@npalm
Copy link
Member

npalm commented Jul 6, 2022

@mcaulifn it the PR ready for review?

@mcaulifn
Copy link
Contributor Author

mcaulifn commented Jul 6, 2022

@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 = [
Copy link
Member

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

Copy link
Contributor Author

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.

Copy link
Member

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

Copy link
Contributor Author

@mcaulifn mcaulifn Aug 4, 2022

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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?

Copy link
Member

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.

Copy link
Member

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.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 4, 2022

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.

@github-actions github-actions bot added the Stale label Sep 4, 2022
@github-actions github-actions bot removed the Stale label Sep 7, 2022
@npalm
Copy link
Member

npalm commented Sep 16, 2022

@mcaulifn back from PTO, will try to check what I can do on this PR next week.

@npalm
Copy link
Member

npalm commented Oct 14, 2022

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

@github-actions
Copy link
Contributor

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.

@github-actions github-actions bot added the Stale label Nov 14, 2022
@npalm npalm removed the Stale label Nov 14, 2022
@npalm
Copy link
Member

npalm commented Nov 16, 2022

@mcaulifn I just started digging in the PR and running some test, keep you posted.

@npalm
Copy link
Member

npalm commented Nov 16, 2022

@mcaulifn found 2 issues, would you have tim for a quick look?

Copy link
Member

@npalm npalm left a 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!

@npalm
Copy link
Member

npalm commented Nov 24, 2022

@mcaulifn thanks will have asap another check on the PR!

Copy link
Member

@npalm npalm left a comment

Choose a reason for hiding this comment

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

@mcaulifn once again thanks for you support. I already have prepared the PR to remove the legacy tag (#2705)

@npalm npalm merged commit a1a47a4 into philips-labs:develop Nov 30, 2022
forest-releaser bot pushed a commit that referenced this pull request Nov 30, 2022
## [1.17.0](v1.16.1...v1.17.0) (2022-11-30)

### Features

* **runners:** Namespace `Application` tag ([#2182](#2182)) ([a1a47a4](a1a47a4))

### Bug Fixes

* Adding missing input lambda vpc vars to syncer module ([#2701](#2701)) ([c91a96b](c91a96b))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tag conflicting with Launch Template
2 participants