binbashar / leverage

Binbash Leverage CLI intended to orchestrate Leverage Reference Architecture for AWS (www.binbash.co/leverage)
https://pypi.org/project/leverage/
Apache License 2.0
17 stars 2 forks source link

[159] Fix issue with argument parsing logic for tf apply #274

Closed borland667 closed 5 days ago

borland667 commented 2 months ago

What?

Simplified solution:

Why?

References

Before release

Review the checklist here

coveralls commented 2 months ago

Pull Request Test Coverage Report for Build 9584808751

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
leverage/logger.py 4 5 80.0%
leverage/modules/terraform.py 36 54 66.67%
<!-- Total: 44 63 69.84% -->
Totals Coverage Status
Change from base Build 8847843590: 0.2%
Covered Lines: 2042
Relevant Lines: 2846

💛 - Coveralls
coveralls commented 3 weeks ago

Pull Request Test Coverage Report for Build 10565722330

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
leverage/logger.py 4 5 80.0%
leverage/modules/terraform.py 12 15 80.0%
<!-- Total: 20 24 83.33% -->
Totals Coverage Status
Change from base Build 8847843590: 0.1%
Covered Lines: 2011
Relevant Lines: 2800

💛 - Coveralls
angelofenoglio commented 3 weeks ago

After consulting with @borland667 I've pushed a simplification to the originally proposed solution.

The only thing we really need to worry is to find out if we are receiving a plan file as a last argument for the apply command. And in turn, prepend or not our terraform default parameters, which basically are the references to the correct .tfvar files. Instead of parsing the entirety of the parameters, looking at the last two or so received arguments we can deduct if the last one is a positional argument or not (the plan file is the only positional parameter supported by plan). Any other errors/incompatibilities that the user may have introduced in the arguments we leave to terraform to decide.