Skip to content

Commit

Permalink
Add go module labels (#192)
Browse files Browse the repository at this point in the history
* Add labels for the module version

* version
  • Loading branch information
peterebden authored Dec 20, 2023
1 parent c38f6ba commit b78506b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Version 1.12.0
--------------
* go_repo now attaches go_module labels for consumers who made use of them on go_module

Version 1.11.5
--------------
* go_mod_download directory hash replaced (#187)
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.11.5
1.12.0
6 changes: 5 additions & 1 deletion build_defs/go.build_defs
Original file line number Diff line number Diff line change
Expand Up @@ -1211,6 +1211,9 @@ def go_repo(module: str, version:str='', download:str=None, name:str=None, insta
else:
modFileArg = ""

labels = ["go_module_path:" + module]
if version:
labels += [f"go_module:{module}@{version}"]
requirements = " ".join(requirements)
repo = build_rule(
name = name,
Expand All @@ -1226,7 +1229,7 @@ def go_repo(module: str, version:str='', download:str=None, name:str=None, insta
},
deps = deps + [CONFIG.GO.MOD_FILE] if CONFIG.GO.MOD_FILE else deps,
_subrepo = True,
labels=["go_module_path:" + module],
labels = labels,
requires = ["import_config"],
)
subrepo(
Expand All @@ -1241,6 +1244,7 @@ def go_repo(module: str, version:str='', download:str=None, name:str=None, insta
name = name,
visibility = visibility,
exported_deps=[f"///{pkg_name}/{subrepo_name}//:installs"],
labels = labels,
)
else:
return repo
Expand Down

0 comments on commit b78506b

Please sign in to comment.