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

refactor: change auto detect logic to include tfvars #2563

Merged
merged 1 commit into from
Jul 12, 2023

Conversation

hugorut
Copy link
Contributor

@hugorut hugorut commented Jul 11, 2023

Changes auto detection logic so that terraform var files are automatically taken into consideration:

  1. If a single terraform var file is found under a project, we add it to the evaluator
  2. If more than one are found under a project, we split the project into multiples. One for each var file discovered.

This functionality is solely for auto detection and once a user defines a config file, we no longer adhear to these rules.

Also added a jsoniter refactor into this pr to speed up the parsing logic. Let me know if you want me to separate it out.

@hugorut hugorut self-assigned this Jul 11, 2023
@hugorut hugorut force-pushed the refactor/auto-detect-improvements branch 3 times, most recently from eb24137 to b647542 Compare July 11, 2023 12:48
Changes auto detection logic so that terraform var files are automatically taken into consideration:

1. If a single terraform var file is found under a project, we add it to the evaluator
2. If more than one are found under a project, we split the project into multiples. One for each var file discovered.

This functionality is solely for auto detection and once a user defines a config file, we no longer adhear to these rules.
@hugorut hugorut force-pushed the refactor/auto-detect-improvements branch from b647542 to bdab661 Compare July 11, 2023 12:50
@hugorut hugorut requested a review from aliscott July 11, 2023 12:58
@hugorut hugorut marked this pull request as ready for review July 11, 2023 13:30
Copy link
Member

@aliscott aliscott left a comment

Choose a reason for hiding this comment

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

Looks great.

Not needed for just now, but this got me thinking if we could do something more intelligent here to determine if the var file is a project-specific var file or a shared/global var file. Maybe this could work by looking at the variable names within the var file and seeing if there's multiple overlapping keys.

@hugorut hugorut merged commit bfe5f78 into master Jul 12, 2023
10 checks passed
@hugorut hugorut deleted the refactor/auto-detect-improvements branch July 12, 2023 13:18
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

2 participants