@@ -33,6 +33,7 @@ import (
3333 "github.com/bufbuild/buf/private/bufpkg/bufimage"
3434 "github.com/bufbuild/buf/private/bufpkg/bufimage/bufimageutil"
3535 "github.com/bufbuild/buf/private/bufpkg/bufmodule"
36+ "github.com/bufbuild/buf/private/bufpkg/bufparse"
3637 "github.com/bufbuild/buf/private/bufpkg/bufreflect"
3738 "github.com/bufbuild/buf/private/gen/data/datawkt"
3839 imagev1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/image/v1"
@@ -1085,39 +1086,39 @@ func (c *controller) warnUnconfiguredTransitiveImports(
10851086 if slicesext .Count (workspace .Modules (), bufmodule .Module .IsLocal ) == 0 {
10861087 return nil
10871088 }
1088- // Construct a struct map of all the ModuleFullName strings of the configured buf.yaml
1089+ // Construct a struct map of all the FullName strings of the configured buf.yaml
10891090 // Module dependencies, and the local Modules. These are considered OK to depend on
10901091 // for non-imports in the Image.
1091- configuredModuleFullNameStrings , err := slicesext .MapError (
1092+ configuredFullNameStrings , err := slicesext .MapError (
10921093 workspace .ConfiguredDepModuleRefs (),
1093- func (moduleRef bufmodule. ModuleRef ) (string , error ) {
1094- moduleFullName := moduleRef .ModuleFullName ()
1094+ func (moduleRef bufparse. Ref ) (string , error ) {
1095+ moduleFullName := moduleRef .FullName ()
10951096 if moduleFullName == nil {
1096- return "" , syserror .New ("ModuleFullName nil on ModuleRef" )
1097+ return "" , syserror .New ("FullName nil on ModuleRef" )
10971098 }
10981099 return moduleFullName .String (), nil
10991100 },
11001101 )
11011102 if err != nil {
11021103 return err
11031104 }
1104- configuredModuleFullNameStringMap := slicesext .ToStructMap (configuredModuleFullNameStrings )
1105+ configuredFullNameStringMap := slicesext .ToStructMap (configuredFullNameStrings )
11051106 for _ , localModule := range bufmodule .ModuleSetLocalModules (workspace ) {
1106- if moduleFullName := localModule .ModuleFullName (); moduleFullName != nil {
1107- configuredModuleFullNameStringMap [moduleFullName .String ()] = struct {}{}
1107+ if moduleFullName := localModule .FullName (); moduleFullName != nil {
1108+ configuredFullNameStringMap [moduleFullName .String ()] = struct {}{}
11081109 }
11091110 }
11101111
1111- // Construct a map from Image file path -> ModuleFullName string.
1112+ // Construct a map from Image file path -> FullName string.
11121113 //
1113- // If a given file in the Image did not have a ModuleFullName , it came from a local unnamed Module
1114+ // If a given file in the Image did not have a FullName , it came from a local unnamed Module
11141115 // in the Workspace, and we're safe to ignore it with respect to calculating the undeclared
11151116 // transitive imports.
1116- pathToModuleFullNameString := make (map [string ]string )
1117+ pathToFullNameString := make (map [string ]string )
11171118 for _ , imageFile := range image .Files () {
11181119 // If nil, this came from a local unnamed Module in the Workspace, and we're safe to ignore.
1119- if moduleFullName := imageFile .ModuleFullName (); moduleFullName != nil {
1120- pathToModuleFullNameString [imageFile .Path ()] = moduleFullName .String ()
1120+ if moduleFullName := imageFile .FullName (); moduleFullName != nil {
1121+ pathToFullNameString [imageFile .Path ()] = moduleFullName .String ()
11211122 }
11221123 }
11231124
@@ -1127,12 +1128,12 @@ func (c *controller) warnUnconfiguredTransitiveImports(
11271128 continue
11281129 }
11291130 for _ , importPath := range imageFile .FileDescriptorProto ().GetDependency () {
1130- moduleFullNameString , ok := pathToModuleFullNameString [importPath ]
1131+ moduleFullNameString , ok := pathToFullNameString [importPath ]
11311132 if ! ok {
11321133 // The import was from a local unnamed Module in the Workspace.
11331134 continue
11341135 }
1135- if _ , ok := configuredModuleFullNameStringMap [moduleFullNameString ]; ! ok {
1136+ if _ , ok := configuredFullNameStringMap [moduleFullNameString ]; ! ok {
11361137 c .logger .Warn (fmt .Sprintf (
11371138 `File %q imports %q, which is not in your workspace or in the dependencies declared in your buf.yaml, but is found in transitive dependency %q.
11381139Declare %q in the deps key in your buf.yaml.` ,
0 commit comments