terraform/internal/configs
Martin Atkins 51b0aee36c addrs: ModuleRegistryPackage for representing module registry packages
Previously we had a separation between ModuleSourceRemote and
ModulePackage as a way to represent within the type system that there's an
important difference between a module source address and a package address,
because module packages often contain multiple modules and so a
ModuleSourceRemote combines a ModulePackage with a subdirectory to
represent one specific module.

This commit applies that same strategy to ModuleSourceRegistry, creating
a new type ModuleRegistryPackage to represent the different sort of
package that we use for registry modules. Again, the main goal here is
to try to reflect the conceptual modelling more directly in the type
system so that we can more easily verify that uses of these different
address types are correct.

To make use of that, I've also lightly reworked initwd's module installer
to use addrs.ModuleRegistryPackage directly, instead of a string
representation thereof. This was in response to some earlier commits where
I found myself accidentally mixing up package addresses and source
addresses in the installRegistryModule method; with this new organization
those bugs would've been caught at compile time, rather than only at
unit and integration testing time.

While in the area anyway, I also took this opportunity to fix some
historical confusing names of fields in initwd.ModuleInstaller, to be
clearer that they are only for registry packages and not for all module
source address types.
2021-06-03 08:50:34 -07:00
..
configload Refactoring of module source addresses and module installation 2021-06-03 08:50:34 -07:00
configschema
hcl2shim
testdata Refactoring of module source addresses and module installation 2021-06-03 08:50:34 -07:00
backend.go
compat_shim.go
config.go configs: EntersNewPackage methods for descendant modules 2021-06-03 08:50:34 -07:00
config_build.go Refactoring of module source addresses and module installation 2021-06-03 08:50:34 -07:00
config_build_test.go Refactoring of module source addresses and module installation 2021-06-03 08:50:34 -07:00
config_test.go Refactoring of module source addresses and module installation 2021-06-03 08:50:34 -07:00
depends_on.go
doc.go
escaping_blocks_test.go
experiments.go
experiments_test.go
module.go
module_call.go configs: EntersNewPackage methods for descendant modules 2021-06-03 08:50:34 -07:00
module_call_test.go addrs: ModuleRegistryPackage for representing module registry packages 2021-06-03 08:50:34 -07:00
module_merge.go Refactoring of module source addresses and module installation 2021-06-03 08:50:34 -07:00
module_merge_body.go
module_merge_test.go Refactoring of module source addresses and module installation 2021-06-03 08:50:34 -07:00
module_test.go
named_values.go
named_values_test.go
parser.go
parser_config.go
parser_config_dir.go
parser_config_dir_test.go
parser_config_test.go
parser_test.go Refactoring of module source addresses and module installation 2021-06-03 08:50:34 -07:00
parser_values.go
parser_values_test.go
provider.go
provider_meta.go
provider_requirements.go
provider_requirements_test.go
provider_test.go
provider_validation.go
provisioner.go
provisioneronfailure_string.go
provisionerwhen_string.go
resource.go
synth_body.go
synth_body_test.go
util.go
variable_type_hint.go
variabletypehint_string.go
version_constraint.go