keilerkonzept / terraform-module-versions

CLI tool that checks Terraform code for module updates. Single binary, no dependencies. linux, osx, windows. #golang #cli #terraform
MIT License
188 stars 27 forks source link

Add module name to the output #68

Open yhekma opened 2 years ago

yhekma commented 2 years ago

Added the name of the module to the tabled output. Example output:

| UPDATE? |             NAME   |             MODULE NAME              | CONSTRAINT |      VERSION      | LATEST MATCHING | LATEST |
|---------|--------------------|--------------------------------------|------------|-------------------|-----------------|--------|
| (Y)     | adf                | terraform-azurerm-datafactory        |            | v1.5.0            |                 | v2.0.2 |
| (Y)     | databricks_request | terraform-azurerm-org-data-request   |            | v0.0.1            |                 | v0.0.3 |
sgreben commented 2 years ago

Hey! Thanks for thinking about how to improve tf-module-versions 👍

I'm not sure whether there really is a well-defined "source name" other than the source URL - it would really be the "source basename" (in the sense of unix basename) - and we do have the full source URL included in the markdown-wide and structured output formats.

I'm fine with adding a name, but only if we can reliably define it consistently for any module source (consider also host.com/org/repo.git vs host.com/org/repo, or hashicorp/consul, or ../modules/abc/.). This isn't clear to me yet.

yhekma commented 2 years ago

Hey, thanks for the feedback. Those are good points, I should have at least checked against the examples. I think this feature makes no sense with local modules but I think now it works as you would expect.

yhekma commented 2 years ago

wrt the full name, I thought it would be useful to have the basename in the default output since the full url can get messy/long (but I do agree the information is there in the wide output, so if you don't agree this has added value, I could live with that :))