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

feat: add generate config loading #186

Merged
merged 12 commits into from
Jan 25, 2022
Merged

feat: add generate config loading #186

merged 12 commits into from
Jan 25, 2022

Conversation

katcipis
Copy link
Contributor

@katcipis katcipis commented Jan 21, 2022

Adds:

  • Parsing of terramate.config.generate
  • Hierarchical load of generate config

Integration on actual code generation (and check) will be done on a separate PR, should be considerably smaller since this is the core logic and the other functions will only get the loaded config as a parameter.

@katcipis katcipis self-assigned this Jan 21, 2022
@codecov-commenter
Copy link

codecov-commenter commented Jan 21, 2022

Codecov Report

Merging #186 (70988e2) into main (ece3a47) will increase coverage by 0.56%.
The diff coverage is 58.29%.

❗ Current head 70988e2 differs from pull request most recent head 1ea6cd3. Consider uploading reports for the commit 1ea6cd3 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main     #186      +/-   ##
==========================================
+ Coverage   60.56%   61.13%   +0.56%     
==========================================
  Files          28       29       +1     
  Lines        4694     4914     +220     
==========================================
+ Hits         2843     3004     +161     
- Misses       1686     1738      +52     
- Partials      165      172       +7     
Flag Coverage Δ
tests 61.13% <58.29%> (+0.56%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
cmd/terramate/cli/cli.go 0.00% <0.00%> (ø)
init.go 39.13% <0.00%> (ø)
run/order.go 0.00% <0.00%> (ø)
run/run.go 0.00% <0.00%> (ø)
manager.go 60.79% <34.42%> (-6.97%) ⬇️
test/hcl.go 57.74% <44.82%> (-3.13%) ⬇️
stack/stack.go 77.77% <65.30%> (-11.59%) ⬇️
stack/loader.go 53.52% <72.72%> (-1.19%) ⬇️
hcl/hcl.go 78.89% <77.01%> (-0.66%) ⬇️
project/project.go 31.11% <85.71%> (-1.50%) ⬇️
... and 11 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fbe8270...1ea6cd3. Read the comment docs.

@katcipis katcipis requested review from i4ki and thiesen January 21, 2022 19:02
@katcipis katcipis marked this pull request as ready for review January 21, 2022 19:05
Copy link
Contributor

@mariux mariux left a comment

Choose a reason for hiding this comment

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

hey @katcipis... can you give a short demo to me tomorrow about the changes? really interested how this works ... thanks a lot..

i4ki
i4ki previously approved these changes Jan 24, 2022
Copy link
Contributor

@i4ki i4ki left a comment

Choose a reason for hiding this comment

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

lgtm

generate/config.go Outdated Show resolved Hide resolved
}
cfg.BackendCfgFilename = attrVal.AsString()

logger.Trace().Msg("parsed with success")
Copy link
Contributor

Choose a reason for hiding this comment

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

nice =)

@katcipis
Copy link
Contributor Author

hey @katcipis... can you give a short demo to me tomorrow about the changes? really interested how this works ... thanks a lot..

Not yet because this PR is the core logic but it is not integrated to the code generation itself, but integrating should be fast (but not done yet). After the follow up PR we are good for demo time (when I make changes on the cli level I always add some demo script, usually very simple but with some demo value =P).

i4ki
i4ki previously approved these changes Jan 25, 2022
Copy link
Contributor

@i4ki i4ki left a comment

Choose a reason for hiding this comment

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

lgtm

generate/config.go Outdated Show resolved Hide resolved
Co-authored-by: Tiago de Bem Natel de Moura <t.nateldemoura@gmail.com>
@katcipis katcipis merged commit c7cb2df into main Jan 25, 2022
@katcipis katcipis deleted the katcipis-generate-config branch January 25, 2022 11:52
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.

4 participants