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

TaskCat Config Generator #820

Closed
wants to merge 7 commits into from
Closed

TaskCat Config Generator #820

wants to merge 7 commits into from

Conversation

tbulding
Copy link

@tbulding tbulding commented Mar 26, 2024

Overview

This change adds the ability to generate the .taskcat.yml config file based on a CloudFormation template. The tool can generate the configuration file with verbose information (-v) about the parameters.(This information is taken from the CFN)
The tool also offers the option to generate a .taskcat_overrides.yml file (-c). The tool attempts to populate empty values based on the parameter name.

Testing/Steps taken to ensure quality

How did you validate the changes in this PR?
I ran the tool against a 15 different Quick Start projects.

Notes

Optional. Caveats, Alternatives, Other relevant information.

Testing Instructions

To test this PR you will need to install Taskcat From the Originating fork. Clone the Forked repo, and from the root of the repo run:
python setup.py install
Once taskcat is installed you can run it against an existing template with:

taskcat generate-tc-config -m templates/your_template.template.yaml -c

Copy link
Contributor

@andrew-glenn andrew-glenn left a comment

Choose a reason for hiding this comment

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

Generally, a well intended review and I 💯 appreciate the thought and effort. I think this will need a few iterations before it's ready to merge. Feel free to reach out internally to discuss.

taskcat/project_config/tools.py Outdated Show resolved Hide resolved
taskcat/project_config/tools.py Outdated Show resolved Hide resolved
taskcat/project_config/tools.py Outdated Show resolved Hide resolved
taskcat/project_config/tc_config.py Outdated Show resolved Hide resolved
taskcat/project_config/tc_config.py Outdated Show resolved Hide resolved
taskcat/project_config/tools.py Outdated Show resolved Hide resolved
Copy link
Contributor

@jaymccon jaymccon left a comment

Choose a reason for hiding this comment

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

looking good in general. A few asks:

  • rename command to generate-config having the tc in there is redundant, and tc is not a commonly seen shortening for taskcat
  • add unit tests to get to at least 80% coverage. I'd specifically like to see tests that check for safety of existing config files with this feature. Test should ensure that if a project/global config already exists and this command is run, that the existing files are not overritten and that the command exit's with an error
  • run pre-commit run --all-files, fix any issues it raises, and provide the output as a comment on the pr. We used to do this automatically on PR's but haven't gotten around to re-implementing it since we stopped using travis. You may need to setup some tools locally before precommit will work, have a look at the travis config to get an idea of what is needed.

jaymccon
jaymccon previously approved these changes May 29, 2024
@tbulding tbulding marked this pull request as draft May 30, 2024 17:31
@tbulding tbulding closed this May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants