Dashboard › institutional-transition-lab › Distillation
442530fb-508f-498e-b360-0d58406fc8fb["lore_tm_v1_rCyEt73dhr2ebfvP1yd3goOFaZstnUPNz337X2xxDV8","lore_tm_v1_WgxNAGp-59wzDDCOD1L_akoxnYjKBU7nn0rQTa3ULfs","lore_tm_v1_YppbAcdMF9FgJcY4hJ3cv-jOU83M_Td5RQJtElWtigY"]
Date: Sep 8, 2026
internal/getmodules/moduleaddrs/detect_gcs_test.go added TestDetectGCS, covering 3 shorthand normalizations: www.googleapis.com/storage/v1/bucket/foo β gcs::https://www.googleapis.com/storage/v1/bucket/foo; the same address with /bar; and www.googleapis.com/storage/v1/foo/bar.baz.internal/getmodules/moduleaddrs/detect_git.go added detectGit, detectGitHub, detectBitBucket, and detectSSH. detectGit accepts SCP-like SSH addresses only when u.User.Username() == "git" and prefixes the normalized URL with git::; detectGitHub recognizes github.com/username/repo, appends .git when absent, and converts extra path components into a // package subdirectory; detectBitBucket recognizes bitbucket.org/, assumes Git, and appends .git; detectSSH uses sshPattern = regexp.MustCompile("^(?:([^@]+)@)?([^:]+):/?(.+)$"), emits scheme ssh, and parses/re-encodes query parameters via url.ParseQuery.internal/getmodules/moduleaddrs/detect_git_test.go added tests for Git SCP-like URLs across github.com and github.xyz.com, including ?ref=test-branch, ?foo=bar, //bar, and //module/a; it also verifies canonical git::ssh://git@git.example.com:2222/hashicorp/foo.git remains unchanged. GitHub tests cover adding/preserving .git, converting /bar to //bar, and retaining query strings; Bitbucket tests cover shorthand with and without an existing .git suffix.internal/getmodules/moduleaddrs/detect_remote_shorthands.go defines the backward-compatible detector order exactly as: 1. detectGitHub, 2. detectGit, 3. detectBitBucket, 4. detectGCS, 5. detectS3, 6. detectAbsFilePath. Its comment says not to add new detectors; new source types must use canonical source-address syntax.detectRemoteSourceShorthands recognizes forced getter syntax with forcedRegexp = regexp.MustCompile(\^([A-Za-z0-9]+)::(.+)$`); separates package subdirectories with SplitPackageSubdir; returns already-valid URLs unchanged; runs detectors in order; prepends detector-produced subdirectories to user-requested subdirectories using filepath.Join; sets u.RawPath = u.Pathso subdirectory wildcards remain unescaped; prefers the callerβs forced getter over a detector-supplied getter; and otherwise returnsinvalid source address: %s`.internal/getmodules/moduleaddrs/detect_remote_shorthands_test.go added shared helper tableTestDetectorFuncs, which runs each input as a subtest through detectRemoteSourceShorthands, fails on any unexpected error, and compares the exact output with the expected normalized address.internal/getmodules/moduleaddrs/detect_s3.go added detectS3 for schemeless strings containing .amazonaws.com/. It dispatches by hostname shape: 3 parts β detectS3PathStyle, 4 parts β detectS3OldVhostStyle, and 5 parts with hostParts[1] == "s3" β detectS3NewVhostStyle; malformed shapes return URL is not a valid S3 URL, while URL parse failures return error parsing S3 URL: %s.s3:: URLs as follows: detectS3PathStyle(region, parts) β https://<region>.amazonaws.com/<parts>; detectS3OldVhostStyle(region, bucket, parts) β https://<region>.amazonaws.com/<bucket>/<parts>; detectS3NewVhostStyle(region, bucket, parts) β https://s3.<region>.amazonaws.com/<bucket>/<parts>.internal/getmodules/moduleaddrs/detect_s3_test.go added 13 cases covering virtual-hosted bucket.s3.amazonaws.com, old regional virtual-hosted bucket.s3-eu-west-1.amazonaws.com, 5-part virtual-hosted bucket.s3.eu-west-1.amazonaws.com, path-style s3.amazonaws.com, regional path-style s3-eu-west-1.amazonaws.com, nested object paths, .baz object names, and query preservation for ?version=1234.NormalizePackageAddress returns a normalized source address that βalways includes a prefix naming a protocol to fetch with and may also include a transformed/normalized version of the protocol-specific source address included afterward.βinternal/getmodules/moduleaddrs/package.go changed from package getmodules to moduleaddrs; removed the github.com/hashicorp/go-getter import; replaced getter.Detect(given, "", goGetterDetectors) with detectRemoteSourceShorthands(given); updated documentation links to [ParseModulePackage], [ParseModuleSource], and [SplitPackageSubdir]; and removed documentation describing network-dependent go-getter detectors and Bitbucket Git-versus-Mercurial probing.ParseModuleSource must silently fall through from a failed ParseModuleSourceRegistry(raw) attempt to direct remote-source parsing for compatibility dating to Terraform v0.10.internal/getmodules/moduleaddrs/source_parsing.go added ParseModuleSource, ParseModuleSourceRegistry, parseModuleSourceLocal, isModuleSourceLocal, and parseModuleSourceRemote. Local-source prefixes are exactly ./, ../, .\\, and ..\\; local paths replace backslashes with /, normalize through path.Clean, collapse duplicate slashes, and retain or add a leading ./ unless the result starts with ../.ParseModuleSourceRegistry explicitly rejects local addresses with can't use local directory %q as a module registry address, delegates registry parsing to tfaddr.ParseModuleSource, and returns addrs.ModuleSourceRegistry{Package: src.Package, Subdir: src.Subdir}.parseModuleSourceRemote uses SplitPackageSubdir, rejects a user subdirectory beginning with ../ as escaping the package, calls NormalizePackageAddress, prepends any detector-produced subdirectory using path.Join, performs a second escape check for detector-produced paths, and returns addrs.ModuleSourceRemote{Package: addrs.ModulePackage(norm), Subdir: subDir}.internal/getmodules/moduleaddrs/source_parsing_test.go moved tests from package addrs to moduleaddrs and qualified expected values through github.com/hashicorp/terraform/internal/addrs. Visible cases preserve normalization for Unix and Windows local paths, mixed slash styles, implied and custom registry addresses with optional subdirectories, GitHub shorthand, and URL-style Git sources.internal/getmodules/moduleaddrs/source_parsing_test.go patch text was truncated mid-expression at Package: a, despite reporting length=5173; conclusions about the remainder of that test file cannot be made from this evidence.