Conversation
9a8fedb to
72e137a
Compare
| Optional: true, | ||
| Computed: true, | ||
| ForceNew: true, | ||
| ExactlyOneOf: []string{"vcs_repo"}, |
There was a problem hiding this comment.
Required to be removed because this prevents having both vcs_repo AND module_provider which we need to support monorepo scenarios with source_directory
72e137a to
d94fc03
Compare
d94fc03 to
e2678b3
Compare
e2678b3 to
c38cbff
Compare
|
add5b9e to
40b6992
Compare
40b6992 to
b559277
Compare
|
Failures observed in CI will be resolved with hashicorp/go-tfe#1283 and #1975 |
brandonc
left a comment
There was a problem hiding this comment.
Ideally speaking, could you add a test for the error case where the convention is not followed and no name or provider is given? That's not blocking feedback, though.
| nameParts := strings.Split(repoName, "-") | ||
| followsConvention := len(nameParts) == 3 |
There was a problem hiding this comment.
This prohibits dashes in the module name, which I think are valid
I think you may need to check for at least 3 parts
| nameParts := strings.Split(repoName, "-") | |
| followsConvention := len(nameParts) == 3 | |
| nameParts := strings.SplitN(repoName, "-", 3) | |
| followsConvention := len(nameParts) == 3 |
There was a problem hiding this comment.
Thank you for noticing this - atlas will follow-through with any additional validation as well. I will merge your suggestion along with that negative test case.
There was a problem hiding this comment.
perhaps the first part should must be "terraform" ? Just thinking out loud and not sure it matters too much
There was a problem hiding this comment.
@brandonc great point, I believe here it doesn't matter for the following reasons.
Although you are 100% right we did suggest this pattern of terraform-provider-name, and even having an example that aligns in our guide docs - it is not something that is actually enforced or required in our processing of the registry module (referencing the code that processes it here).
Even in our in-app experience, we are able to create a registry module without the leading terraform

26b25c0 to
7b81e4b
Compare
Co-authored-by: Brandon Croft <brandon.croft@gmail.com>
Description
This pull request enhances the
tfe_registry_moduleresource to support explicitnameandmodule_providerfields when using a VCS repository with asource_directory. This is especially useful for monorepos or repositories that do not follow the standardterraform-<provider>-<name>naming convention. The changes ensure that bothnameandmodule_providerare required in these cases, improve validation logic, update documentation, and add comprehensive test coverage for these scenarios.Enhancements to
tfe_registry_moduleresource:nameandmodule_provideralongsidevcs_repowithsource_directory, enabling registration of modules from monorepos or non-standard repository names. [1] [2]validateNameAndProvider) to enforce that bothnameandmodule_providerare provided when the repository name does not follow theterraform-<provider>-<name>convention andsource_directoryis set. [1] [2]Schema and validation updates:
vcs_repoormodule_providercan be specified, allowing their combined use when required.nameandmodule_provider. [1] [2] [3] [4]Documentation improvements:
source_directory, highlighting the need to specify bothnameandmodule_provider.module_providerandnamefields.Test coverage:
Remember to:
Testing plan
External links
Output from acceptance tests
Please run applicable acceptance tests locally and include the output here. See testing.md to learn how to run acceptance tests.
Rollback Plan
Changes to Security Controls