File tree Expand file tree Collapse file tree
fixtures/node_templates/no_version Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -340,8 +340,9 @@ def owlbot_main(
340340 templates = common_templates .node_library (source_location = "build/src" )
341341 s_copy ([templates ], excludes = templates_excludes )
342342
343- library_version = template_metadata ()["version" ]
344- common .update_library_version (library_version , _GENERATED_SAMPLES_DIRECTORY )
343+ library_version = template_metadata ().get ("version" )
344+ if library_version :
345+ common .update_library_version (library_version , _GENERATED_SAMPLES_DIRECTORY )
345346
346347
347348if __name__ == "__main__" :
Original file line number Diff line number Diff line change 1+ {
2+ "name" : " repo-automation-bots" ,
3+ "name_pretty" : " Repo Automation Bots" ,
4+ "release_level" : " stable" ,
5+ "language" : " nodejs" ,
6+ "repo" : " googleapis/repo-automation-bots" ,
7+ "distribution_name" : " repo-automation-bots" ,
8+ "codeowner_team" : " @googleapis/github-automation" ,
9+ "client_documentation" : " https://cloud.google.com/nodejs/docs/reference/repo-automation-bots/latest" ,
10+ "library_type" : " OTHER"
11+ }
Original file line number Diff line number Diff line change 1+ {
2+ "name" : " repo-automation-bots" ,
3+ "private" : true ,
4+ "license" : " Apache-2.0" ,
5+ "repository" : " googleapis/repo-automation-bots" ,
6+ "engines" : {
7+ "node" : " >=12.0.0"
8+ },
9+ "scripts" : {
10+ "run" : " ./scripts/scripts.js" ,
11+ "fix" : " npm run run -- npm run fix" ,
12+ "test" : " c8 npm run run -- npm test" ,
13+ "proxy" : " smee" ,
14+ "generate-bot" : " node ./packages/generate-bot/run.js"
15+ },
16+ "devDependencies" : {
17+ "c8" : " ^7.1.0" ,
18+ "gaxios" : " ^5.0.0" ,
19+ "smee-client" : " ^1.1.0" ,
20+ "@google-cloud/mono-repo-publish" : " ^1.0.0"
21+ }
22+ }
Original file line number Diff line number Diff line change @@ -276,3 +276,9 @@ def patch(library: Path):
276276 assert "import * as v2" in staging_text
277277 assert "export * as v2" not in staging_text
278278 assert "export * as v2" in text
279+
280+
281+ def test_owlbot_main_without_version ():
282+ with util .copied_fixtures_dir (FIXTURES / "node_templates" / "no_version" ):
283+ # just confirm it doesn't throw an exception.
284+ node .owlbot_main (TEMPLATES )
You can’t perform that action at this time.
0 commit comments