-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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: add new flag --silence-no-projects #1469
Conversation
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.
LGTM
@GenPage test are failing, when you have a chance take a look at the tests. |
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.
Can't we put this logic around pullUpdater.updatePull
work better? I'm not sure how useful this would be to general atlantis users, is it common to run several instances of atlantis pointing to the same repo? I'm also hesitant adding more configuration flags. Also any new feature needs tests.
We could, we'd need to surface projectCmds into either the
I understand the hesitation here. I can't speak to commonality but I have come across multiple users of Atlantis attempting to run multiple instances. Our main use case is for Terragrunt, we keep all our configuration for multiple AWS accounts in the one repo for easier maintainability and DRY thanks to Terragrunt. Plus we have strict security guidelines about cross-account traffic. (One instance can't talk to all AWS accounts.)
Sorry about that, I have been getting more familiar with the codebase and working to get up to speed on how the mocks and test are setup. Already working on adding those ASAP. |
@msarvar The use of one repo and multiple atlantis servers is as common as using a single one. In my experience and base on the companies that I worked for I found very strange the fact that a security team will allow the use of an orchestration server that can cross boundaries so for me is the opposite and that is why there is so many people hacking around the fact that atlantis does not support this. |
@msarvar I'm working on getting up to speed on understanding the E2E and test fixtures. Do you have any suggestions on how to test this properly with some examples? I'm thinking I might have to create a new testfixure with a atlanits.yaml without any projects or matching files for a defined project. |
@GenPage Sorry for a slow response. Since you are passing in the flag into the runner you should be able to test them as unit tests in the Some implementation thoughts, I think the code needs to reset PR status checks similar to how |
@msarvar No worries on the slow response, I appreciate the guidance! I do see some similar example in I just caught https://www.runatlantis.io/docs/server-configuration.html#vcs-status-name Once I get tests passing I'll work on site documentation. |
@msarvar On second thought, I think we can fix the implementation by not submitting the first pending status check until after The reason for this is because the assumption is at least one of the Atlantis servers responds with a passing check, instead of N (number of servers) * 3 commands (plan, policy_check, apply). (In our specific case at Autodesk that would be 18 checks). Unless you can think of an issue where no projects triggering any servers would be an issue. |
@GenPage I think that will still produce stale status checks if your server doesn't have autoplan enabled. And for consistency your atlantis servers should always create status checks even if they're not running any plans in your PR. |
0f56bd8
to
425bd7e
Compare
Codecov Report
@@ Coverage Diff @@
## master #1469 +/- ##
==========================================
+ Coverage 70.08% 70.21% +0.12%
==========================================
Files 94 94
Lines 6485 6530 +45
==========================================
+ Hits 4545 4585 +40
- Misses 1554 1555 +1
- Partials 386 390 +4
Continue to review full report at Codecov.
|
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.
Looks good overall, I have several change requests.
381315c
to
5e26990
Compare
5e26990
to
6eb3d01
Compare
Rebased against master, I addressed all of your comments @msarvar. Please let me know if I missed anything |
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.
Looks good, before merging please update the comments in the a.silenceVCSStatusNoProjects
checks to reflect their command, right now it is mentions all 3 possible commands.
@msarvar I think its ready now, thanks! |
this is awesome and solves my exact issues. Will prevent me to unnecessary pre-workflow hooks that set an intentionally invalid repo name to avoid the "cross talk" |
@msarvar @nishkrishnan I fixed the merge conflicts, can we get this merged for the next stable release? |
Currently planning to fork this branch and merge in main/current release just for this feature. Big +1 here. |
It's quite interesting to see how automatically genereted atlantis.yaml looks. Should it be located not in repo (as should be) but locally on server? |
@ipeacocks Yes, that is what we currently do. We use Terragrunt so we use https://github.com/transcend-io/terragrunt-atlantis-config with a pre-workflow-hook to generate the atlantis.yaml. This way we only generate the projects for the specific AWS accounts the server is located in. |
This is to be used when you:
The idea is that if the dynamically generated atlantis.yaml does not return any matching projects when the commands are built, then there is nothing to respond to as another Atlantis instance will handle it.
This should fix comment spam when multiple Atlantis instances are setup on the same monorepo.
Here is an example of what this PR attempts to fix: