From 23075bc8ef31d88134dc353be3d72dab3a72a953 Mon Sep 17 00:00:00 2001 From: Gautam Sharda Date: Tue, 17 Feb 2026 23:54:00 +0000 Subject: [PATCH 1/3] chore: support split release-please configuration --- synthtool/languages/node_mono_repo.py | 57 +++++++++++++++++++++------ 1 file changed, 46 insertions(+), 11 deletions(-) diff --git a/synthtool/languages/node_mono_repo.py b/synthtool/languages/node_mono_repo.py index f433d618b..d575e7a78 100644 --- a/synthtool/languages/node_mono_repo.py +++ b/synthtool/languages/node_mono_repo.py @@ -129,17 +129,52 @@ def write_release_please_config(owlbot_dirs): except json.JSONDecodeError: logger.warning(f"Could not decode {ignore_file}, ignoring.") - with open("release-please-config.json", "r") as f: - data = json.load(f) - for dir in owlbot_dirs: - result = re.search(PACKAGE_DIRECTORIES_REGEX, dir) - assert result is not None - package_name = result.group() - if package_name in ignore_list: - continue - data["packages"][package_name] = {} - with open("release-please-config.json", "w") as f: - json.dump(data, f, indent=2) + config_path = Path("release-please-config.json") + submodules_path = Path("release-please-submodules.json") + + with open(config_path, "r") as f: + config_data = json.load(f) + + submodules_data = None + if submodules_path.is_file(): + with open(submodules_path, "r") as f: + submodules_data = json.load(f) + + for dir in owlbot_dirs: + result = re.search(PACKAGE_DIRECTORIES_REGEX, dir) + assert result is not None + package_name = result.group() + + if package_name in ignore_list: + continue + + if submodules_data is not None and package_name.startswith("handwritten/"): + # Add to submodules config + component_name = package_name.split("/")[-1] + if package_name not in submodules_data["packages"]: + submodules_data["packages"][package_name] = {} + submodules_data["packages"][package_name]["component"] = component_name + + # Remove from main config if present + if package_name in config_data["packages"]: + del config_data["packages"][package_name] + else: + # Add to main config + if package_name not in config_data["packages"]: + config_data["packages"][package_name] = {} + + # Remove from submodules config if present + if submodules_data is not None and package_name in submodules_data["packages"]: + del submodules_data["packages"][package_name] + + with open(config_path, "w") as f: + json.dump(config_data, f, indent=2) + f.write("\n") + + if submodules_data is not None: + with open(submodules_path, "w") as f: + json.dump(submodules_data, f, indent=2) + f.write("\n") def template_metadata(relative_dir: str) -> Dict[str, Any]: From 30340820dcdebe3eb80372d4237c41081dfdbd22 Mon Sep 17 00:00:00 2001 From: Gautam Sharda Date: Wed, 18 Feb 2026 22:36:31 +0000 Subject: [PATCH 2/3] chore: use `release-please-submodules.json` as an exclusion list from bundled release --- synthtool/languages/node_mono_repo.py | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/synthtool/languages/node_mono_repo.py b/synthtool/languages/node_mono_repo.py index d575e7a78..957b8a5f1 100644 --- a/synthtool/languages/node_mono_repo.py +++ b/synthtool/languages/node_mono_repo.py @@ -140,6 +140,9 @@ def write_release_please_config(owlbot_dirs): with open(submodules_path, "r") as f: submodules_data = json.load(f) + # If submodules config exists, use it as an exclusion list from bundled release + non_bundled_packages = set(submodules_data.get("packages", {}).keys()) if submodules_data else set() + for dir in owlbot_dirs: result = re.search(PACKAGE_DIRECTORIES_REGEX, dir) assert result is not None @@ -148,34 +151,18 @@ def write_release_please_config(owlbot_dirs): if package_name in ignore_list: continue - if submodules_data is not None and package_name.startswith("handwritten/"): - # Add to submodules config - component_name = package_name.split("/")[-1] - if package_name not in submodules_data["packages"]: - submodules_data["packages"][package_name] = {} - submodules_data["packages"][package_name]["component"] = component_name - - # Remove from main config if present + if package_name in non_bundled_packages: + # remove from bundled release if package_name in config_data["packages"]: del config_data["packages"][package_name] else: - # Add to main config if package_name not in config_data["packages"]: config_data["packages"][package_name] = {} - # Remove from submodules config if present - if submodules_data is not None and package_name in submodules_data["packages"]: - del submodules_data["packages"][package_name] - with open(config_path, "w") as f: json.dump(config_data, f, indent=2) f.write("\n") - if submodules_data is not None: - with open(submodules_path, "w") as f: - json.dump(submodules_data, f, indent=2) - f.write("\n") - def template_metadata(relative_dir: str) -> Dict[str, Any]: """Load node specific template metadata. From 80308e9f5c5e5b7f00adc84c1e5a1d5400b5ef05 Mon Sep 17 00:00:00 2001 From: Gautam Sharda Date: Thu, 19 Feb 2026 00:38:23 +0000 Subject: [PATCH 3/3] chore: lint --- synthtool/languages/node_mono_repo.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/synthtool/languages/node_mono_repo.py b/synthtool/languages/node_mono_repo.py index 957b8a5f1..4232a4bb0 100644 --- a/synthtool/languages/node_mono_repo.py +++ b/synthtool/languages/node_mono_repo.py @@ -141,7 +141,9 @@ def write_release_please_config(owlbot_dirs): submodules_data = json.load(f) # If submodules config exists, use it as an exclusion list from bundled release - non_bundled_packages = set(submodules_data.get("packages", {}).keys()) if submodules_data else set() + non_bundled_packages = ( + set(submodules_data.get("packages", {}).keys()) if submodules_data else set() + ) for dir in owlbot_dirs: result = re.search(PACKAGE_DIRECTORIES_REGEX, dir)