feat: update versionmanager to support root.hcl files#369
Merged
kvendingoldo merged 3 commits intoMar 11, 2025
Conversation
0d1c555 to
0c02170
Compare
Signed-off-by: Edgar Castillo <edgar.castillo@gametime.co>
Signed-off-by: Edgar Castillo <edgar.castillo@gametime.co>
Signed-off-by: Edgar Castillo <edgar.castillo@gametime.co>
7d734c2 to
7a3e34a
Compare
edgar-castle
commented
Mar 11, 2025
kvendingoldo
approved these changes
Mar 11, 2025
Collaborator
kvendingoldo
left a comment
There was a problem hiding this comment.
Wow! Looks amazing! LGTM
Collaborator
|
Thank you for the contribution, @edgar-castle! I gonna merge it, and make a release. |
Contributor
Author
|
Sweeeet, happy to help! 😃 |
tmeijn
pushed a commit
to tmeijn/dotfiles
that referenced
this pull request
Mar 24, 2025
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [tofuutils/tenv](https://github.com/tofuutils/tenv) | minor | `v4.2.4` -> `v4.4.0` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>tofuutils/tenv (tofuutils/tenv)</summary> ### [`v4.4.0`](https://github.com/tofuutils/tenv/releases/tag/v4.4.0) [Compare Source](tofuutils/tenv@v4.3.0...v4.4.0) #### Changelog - [`14f8f7d`](tofuutils/tenv@14f8f7d) use EarlyErrorExitCode (42) on proxy failure before proxied command call ([#​373](tofuutils/tenv#373)) - [`9981094`](tofuutils/tenv@9981094) Fix Readme syntax for Jekyll compatibility - [`8ebb9ca`](tofuutils/tenv@8ebb9ca) Update bages - [`458ba45`](tofuutils/tenv@458ba45) Fix dots in README.md - [`0d50464`](tofuutils/tenv@0d50464) go: bump github.com/BurntSushi/toml from 1.4.0 to 1.5.0 ([#​378](tofuutils/tenv#378)) - [`11c8e9b`](tofuutils/tenv@11c8e9b) go: bump github.com/stretchr/testify from 1.8.4 to 1.10.0 ([#​375](tofuutils/tenv#375)) - [`4bd46f8`](tofuutils/tenv@4bd46f8) chore(deps): bump github.com/go-git/go-git/v5 in /tools - [`226c7e4`](tofuutils/tenv@226c7e4) chore(deps): bump golang.org/x/net from 0.32.0 to 0.36.0 in /tools - [`5ccaee3`](tofuutils/tenv@5ccaee3) Add end-to-end tests for the latest features - [`8804b3d`](tofuutils/tenv@8804b3d) tidy - [`812d6ca`](tofuutils/tenv@812d6ca) Add TENV_SKIP_LAST_USE and improve file permissions consistency ([#​372](tofuutils/tenv#372)) - [`ca79866`](tofuutils/tenv@ca79866) go: bump github.com/charmbracelet/lipgloss from 1.0.0 to 1.1.0 ([#​371](tofuutils/tenv#371)) ### [`v4.3.0`](https://github.com/tofuutils/tenv/releases/tag/v4.3.0) [Compare Source](tofuutils/tenv@v4.2.4...v4.3.0) #### Changelog - [`ef2d597`](tofuutils/tenv@ef2d597) Merge pull request [#​369](tofuutils/tenv#369) from edgar-castle/add-root-hcl-file-support - [`7a3e34a`](tofuutils/tenv@7a3e34a) chore: add changelog file - [`a3e364d`](tofuutils/tenv@a3e364d) feat: ensure HCLNameLegacy and JSONNameLegacy are parsed first - [`0c32ac1`](tofuutils/tenv@0c32ac1) feat: update versionmanager to support root.hcl files - [`4eae74e`](tofuutils/tenv@4eae74e) Disable deprecated tenv linter - [`59b90ad`](tofuutils/tenv@59b90ad) Add basic end to end tests - [`a62b2f9`](tofuutils/tenv@a62b2f9) Merge pull request [#​366](tofuutils/tenv#366) from tofuutils/dependabot/go_modules/github.com/ProtonMail/gopenpgp/v2-2.8.3 - [`cbb426c`](tofuutils/tenv@cbb426c) go: bump github.com/ProtonMail/gopenpgp/v2 from 2.8.2 to 2.8.3 - [`9378b0c`](tofuutils/tenv@9378b0c) go: bump github.com/charmbracelet/bubbletea from 1.3.3 to 1.3.4 ([#​365](tofuutils/tenv#365)) - [`d538c9e`](tofuutils/tenv@d538c9e) Merge pull request [#​364](tofuutils/tenv#364) from tofuutils/dependabot/github_actions/sigstore/cosign-installer-3.8.1 - [`49b29ca`](tofuutils/tenv@49b29ca) gh-actions: bump sigstore/cosign-installer from 3.8.0 to 3.8.1 - [`6d429b4`](tofuutils/tenv@6d429b4) go: bump github.com/spf13/cobra from 1.8.1 to 1.9.1 ([#​359](tofuutils/tenv#359)) - [`349bcfd`](tofuutils/tenv@349bcfd) Merge pull request [#​363](tofuutils/tenv#363) from Nmishin/feat/goreleaser - [`28e8952`](tofuutils/tenv@28e8952) Fix goreleaser deprecations - [`7439866`](tofuutils/tenv@7439866) Merge pull request [#​361](tofuutils/tenv#361) from Nmishin/fix/golangci-img - [`306a435`](tofuutils/tenv@306a435) Update check-golangci-lint.yml - [`dd68c23`](tofuutils/tenv@dd68c23) Merge pull request [#​362](tofuutils/tenv#362) from Nmishin/feat/cloudsmiths - [`fdf6da8`](tofuutils/tenv@fdf6da8) Include more linux distributives to the cloudsmiths config - [`863d910`](tofuutils/tenv@863d910) Update check golangci-lint GH action - [`55e9301`](tofuutils/tenv@55e9301) Merge pull request [#​360](tofuutils/tenv#360) from Nmishin/fix/golangci - [`7c0b680`](tofuutils/tenv@7c0b680) Fix golangci-lint configuration - [`8120be4`](tofuutils/tenv@8120be4) Merge pull request [#​358](tofuutils/tenv#358) from tofuutils/dependabot/go_modules/github.com/PuerkitoBio/goquery-1.10.2 - [`6dc3bf4`](tofuutils/tenv@6dc3bf4) go: bump github.com/PuerkitoBio/goquery from 1.10.1 to 1.10.2 - [`4ce0309`](tofuutils/tenv@4ce0309) Merge pull request [#​357](tofuutils/tenv#357) from tofuutils/dependabot/go_modules/github.com/charmbracelet/bubbletea-1.3.3 - [`2386032`](tofuutils/tenv@2386032) go: bump github.com/charmbracelet/bubbletea from 1.3.2 to 1.3.3 - [`bb6426e`](tofuutils/tenv@bb6426e) Merge pull request [#​356](tofuutils/tenv#356) from tofuutils/dependabot/go_modules/github.com/charmbracelet/bubbletea-1.3.2 - [`4c254b8`](tofuutils/tenv@4c254b8) go: bump github.com/charmbracelet/bubbletea from 1.3.0 to 1.3.2 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xOTQuMCIsInVwZGF0ZWRJblZlciI6IjM5LjIxMC4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
When running plan/applies in newer versions of terragrunt, you now get the following output when the root configuration file is named
terragrunt.hcl.Gruntwork now recommends renaming the root config file to
root.hclinstead. This PR is to add support for the new recommended naming convention in versionmanager.Motivation
We've been doing some testing around using tenv to aid with Terraform & Terragrunt version management in our CI pipelines. Some repos use the new
root.hclformat and tenv wasn't parsingterraform_version_constraintandterragrunt_version_constraintsince the file was named differently.I first thought of setting an env var to pass in a different root terragrunt file name instead to make this more customizable. However, most people will likely conform to rename the file using whatever GruntWorks recommends so I figured adding support for the most likely cases was the better approach. It makes using the tool even easier since out of the box it will work with the most common configurations.
Summary of Change
The changes I made should be backwards compatible without changing anyone's current setup.
The following was done:
gruntparser.gowith 2 new constsHCLNameLegacyandJSONNameLegacyand added some Go Doc compliant comments to indicate the move towards the new recommended naming convention.Testing
I built the binaries then tested out the logic to ensure that it is correctly parsing the legacy and newly named files. I also ensured that the legacy file name takes precedence over the new one.
Terraform Detect Tests

Terragrunt Detect Test

Tofu Detect Test
