Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
b82b899
ci: publish every package whose version is not on its registry
Tanmaycode1 Oct 28, 2026
b33c164
ci(release): grant the called workflows contents and id-token from th…
Tanmaycode1 Oct 28, 2026
6165029
Merge Tanmay Shastri release publisher (#300) into dev-based release …
nik13 Oct 29, 2026
0f1d362
ci: automate SDK release PRs across five languages
nik13 Oct 29, 2026
e00b125
fix(ci): pass signing key to Central BC signer
nik13 Oct 29, 2026
0a13942
fix(ci): release already-merged SDK changes at bootstrap
nik13 Oct 29, 2026
cb68acc
chore: complete Python npm and NuGet registry metadata
nik13 Oct 29, 2026
9fe4ed4
docs: disclose existing npm packaging limitations
nik13 Oct 29, 2026
b4414b1
fix(npm): point google-adk, livekit, pipecat and vertexai entry point…
nik13 Oct 29, 2026
0f797ea
fix: correct registry metadata tests and standalone tracing recipes
nik13 Oct 29, 2026
896d14e
fix(release): cover core manifests and stage npm dependencies
nik13 Oct 29, 2026
5a726c2
Merge release-please automation into registry metadata
nik13 Oct 29, 2026
4c55284
fix(npm): release the entry-point repairs as 0.1.1
nik13 Oct 29, 2026
f081e43
fix(release): run each PyPI publish in its own environment
nik13 Oct 29, 2026
4e4d257
fix(release): create the 16 new PyPI projects with a one-time bootstr…
nik13 Oct 29, 2026
8cef4fc
ci(release): make npm publishing ready for trusted publishing
nik13 Oct 29, 2026
7f83800
fix(ci): allow npm trusted publishing through release gates
nik13 Oct 31, 2026
883cc00
Merge fixed release automation into registry metadata
nik13 Oct 31, 2026
8faf84f
Merge dev into ci/release-please-sdk
nik13 Oct 31, 2026
b356d7e
Merge ci/release-please-sdk into chore/registry-metadata
nik13 Oct 31, 2026
42231be
test(cerebras): compare __version__ with package metadata
nik13 Oct 31, 2026
57ff583
Merge ci/release-please-sdk into chore/registry-metadata
nik13 Oct 31, 2026
f75001d
Merge dev into ci/release-please-sdk
nik13 Oct 31, 2026
4722b8d
Merge ci/release-please-sdk into chore/registry-metadata
nik13 Oct 31, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,985 changes: 1,985 additions & 0 deletions .github/release/bootstrap-audit.json

Large diffs are not rendered by default.

163 changes: 163 additions & 0 deletions .github/release/bootstrap_audit.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
#!/usr/bin/env python3
"""Read-only, reproducible audit of same-version code stranded at bootstrap.

Read package manifests from --ref, query public registry upload timestamps, then
inspect first-parent package history after that timestamp. No package code runs.
--check validates the committed one-time bumps without querying a registry.
"""
from __future__ import annotations

import argparse
from concurrent.futures import ThreadPoolExecutor
from datetime import datetime, timezone
import json
from pathlib import Path
import re
import subprocess
import tomllib

from release_plan import REPO_ROOT, _get_json, load_config

BASELINE = "35f2e3dc364676fa5bdab1e71ae500daf9efc00c"
AUDIT = Path(__file__).with_name("bootstrap-audit.json")


def git(root: Path, *args: str) -> str:
return subprocess.check_output(["git", "-C", str(root), *args], text=True)


def manifests(root: Path, ref: str) -> list[dict]:
out = []
for file in git(root, "ls-tree", "-r", "--name-only", ref).splitlines():
if file.startswith("python/") and file.endswith("/pyproject.toml"):
data = tomllib.loads(git(root, "show", f"{ref}:{file}"))
pkg = data.get("project", data.get("tool", {}).get("poetry", {}))
ecosystem = "python"
elif re.fullmatch(r"typescript/packages/[^/]+/package.json", file):
pkg = json.loads(git(root, "show", f"{ref}:{file}"))
ecosystem = "typescript"
else:
continue
if pkg.get("private") or not pkg.get("name") or not pkg.get("version"):
continue
directory = str(Path(file).parent)
out.append({"ecosystem": ecosystem, "name": pkg["name"],
"version": pkg["version"], "manifest": file, "dir": directory,
"release_path": directory})
return out


def upload_time(package: dict, registry: dict | None) -> str | None:
if registry is None:
return None
version = package["version"]
if package["ecosystem"] == "python":
files = registry.get("releases", {}).get(version, [])
# Empty release entries are not downloadable versions. Use the LAST file
# upload so a wheel/sdist uploaded seconds apart is treated as one release.
return max((f["upload_time_iso_8601"] for f in files), default=None)
return registry.get("time", {}).get(version) if version in registry.get("versions", {}) else None


def patch_version(version: str, existing: set[str]) -> str:
match = re.fullmatch(r"(\d+)\.(\d+)\.(\d+)", version)
if not match:
raise ValueError(f"Bootstrap requires a stable semantic version: {version}")
major, minor, patch = map(int, match.groups())
# Never suggest re-uploading a version, even if a registry is ahead of dev.
patches = [int(m.group(1)) for v in existing
if (m := re.fullmatch(rf"{major}\.{minor}\.(\d+)", v))]
return f"{major}.{minor}.{max([patch, *patches]) + 1}"


def package_history(root: Path, ref: str, package: dict, since: str) -> list[dict]:
directory = package["dir"]
paths = [directory]
if directory == "python":
# Core doesn't own sibling SDKs. Retain its own source, tests, examples,
# pyproject/lockfile and docs, rather than attributing every SDK to core.
paths += [":(exclude)python/frameworks", ":(exclude)python/traceai"]
# A branch may be authored (and committed) before its registry upload.
# Compare first-parent landing/merge committer dates, not branch author dates.
# Filter without pruning traversal when later first-parent dates go backwards.
text = git(root, "log", "--first-parent", f"--since-as-filter={since}",
"--format=%H%x09%cI%x09%s", ref, "--", *paths)
return [dict(zip(("sha", "committed_at", "subject"), line.split("\t", 2)))
for line in text.splitlines()]


def audit_package(root: Path, ref: str, package: dict, skipped: dict) -> dict:
if package["name"] in skipped:
return {**package, "status": "excluded", "reason": skipped[package["name"]]}
if package["ecosystem"] == "python":
url = f"https://pypi.org/pypi/{package['name']}/json"
else:
url = "https://registry.npmjs.org/" + package["name"].replace("/", "%2F")
registry = _get_json(url)
uploaded = upload_time(package, registry)
result = {**package, "registry_url": url, "uploaded_at": uploaded}
if not uploaded:
return {**result, "status": "unpublished_current_version"}
history = package_history(root, ref, package, uploaded)
if not history:
return {**result, "status": "unchanged_since_upload", "commits": []}
existing = set(registry["releases"] if package["ecosystem"] == "python" else registry["versions"])
return {**result, "status": "patch_required", "next_version": patch_version(package["version"], existing),
"commits": history}


def check(root: Path, audit: dict) -> list[str]:
"""Audit is a one-time floor, not a permanent pin on future releases."""
versions = json.loads((root / ".release-please-manifest.json").read_text())
errors = []
# Later explicit repairs also need a version floor, without rewriting the
# original bootstrap snapshot or its historical registry audit.
for package in [*audit["packages"], *audit.get("explicit_bumps", [])]:
if package["status"] != "patch_required":
continue
file = root / package["manifest"]
if package["ecosystem"] == "python":
data = tomllib.loads(file.read_text())
current = data.get("project", data.get("tool", {}).get("poetry", {}))["version"]
else:
current = json.loads(file.read_text())["version"]
parse = lambda v: tuple(map(int, v.split(".")))
if parse(current) < parse(package["next_version"]):
errors.append(f"{package['name']}: {current} strands the audited bootstrap changes; expected >= {package['next_version']}")
if versions.get(package["release_path"]) != current:
errors.append(f"{package['name']}: release-please manifest doesn't match {current}")
return errors


def main() -> int:
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--root", type=Path, default=REPO_ROOT)
parser.add_argument("--ref", default=BASELINE)
parser.add_argument("--check", action="store_true")
parser.add_argument("--output", type=Path, default=AUDIT)
args = parser.parse_args()
if args.check:
problems = check(args.root, json.loads(args.output.read_text()))
if problems:
print("\n".join(problems))
return 1
print("bootstrap: all audited same-version changes have a new manifest version")
return 0
ref = git(args.root, "rev-parse", args.ref).strip()
packages = manifests(args.root, ref)
skipped = load_config().get("skip", {})
with ThreadPoolExecutor(max_workers=6) as pool:
entries = list(pool.map(lambda p: audit_package(args.root, ref, p, skipped), packages))
summary = {eco: {status: sum(p["ecosystem"] == eco and p["status"] == status for p in entries)
for status in ("excluded", "unpublished_current_version", "unchanged_since_upload", "patch_required")}
for eco in ("python", "typescript")}
result = {"baseline": ref, "queried_at": datetime.now(timezone.utc).isoformat(),
"method": "First-parent package history after the last file upload of the baseline manifest version. Explicit one-time patch bumps; no historical replay.",
"summary": summary, "packages": entries}
args.output.write_text(json.dumps(result, indent=2) + "\n")
print(json.dumps(summary, indent=2))
return 0


if __name__ == "__main__":
raise SystemExit(main())
47 changes: 47 additions & 0 deletions .github/release/complete_release.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/usr/bin/env python3
"""Clear release-please's pending label only after all release tags exist.

release-please release-pr refuses new PRs while a merged release PR is pending.
Publishers own the tags, so they must also acknowledge completed release PRs.
"""
import json
import os
import subprocess
from pathlib import Path

from release_plan import REPO_ROOT, load_config, other_packages, python_packages, typescript_packages, published_versions


def gh_json(*args):
return json.loads(subprocess.check_output(["gh", *args], text=True))


def main():
repo = os.environ["GITHUB_REPOSITORY"]
pending = gh_json("pr", "list", "--repo", repo, "--base", "main", "--state", "merged", "--label", "autorelease: pending",
"--limit", "100", "--json", "number,headRefName")
pending = [p for p in pending if p["headRefName"].startswith("release-please--branches--main")]
if not pending:
return
releases = gh_json("api", "--paginate", "--slurp", f"repos/{repo}/releases?per_page=100")
tags = {r["tag_name"] for page in releases for r in page}
skip = load_config().get("skip", {})
packages = python_packages(REPO_ROOT) + typescript_packages(REPO_ROOT) + other_packages(REPO_ROOT)
missing = [p["tag"] for p in packages if p["name"] not in skip and p["tag"] not in tags]
if missing:
print(f"Still pending: {len(missing)} package releases; finish credentials/publishing and rerun Release.")
return
for package in packages:
if package["name"] in skip:
continue
versions = published_versions(package)
if versions is None or package["version"] not in versions:
print(f"Still pending: {package['name']} {package['version']} is not served by its registry")
return
for pr in pending:
subprocess.run(["gh", "pr", "edit", str(pr["number"]), "--repo", repo,
"--remove-label", "autorelease: pending", "--add-label", "autorelease: tagged"], check=True)


if __name__ == "__main__":
main()
26 changes: 26 additions & 0 deletions .github/release/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"_comment": "Packages release.yml never publishes, with the reason. Everything else under python/, python/frameworks/ and typescript/packages/ is published when its version is not on its registry.",
"skip": {
"traceai": "the PyPI name traceai belongs to another publisher; the package has no registry name yet",
"futureagi-hermes-plugin": "Hermes plugin dependency manifest, explicitly not a buildable distribution"
},
"_pypi_bootstrap_comment": "PyPI allows only three pending trusted publishers per organization, so these first-time projects are created by their first upload with the PYPI_BOOTSTRAP_TOKEN secret instead. Only a package in this list that has never been published uses the token. After the first release: add each project to the futureagi organization, add its trusted publisher (release.yml, blank environment), delete the token on PyPI and the secret, and empty this list.",
"pypi_bootstrap_token": [
"traceAI-ag2",
"traceAI-discoveryengine",
"traceAI-elevenlabs-agents",
"traceAI-exa",
"traceAI-firecrawl",
"traceAI-google-genai-live",
"traceAI-hermes-agent",
"traceAI-mcp-use",
"traceAI-minimax",
"traceAI-openai-realtime",
"traceAI-parallel",
"traceAI-replicate",
"traceAI-semantic-kernel",
"traceAI-tavily",
"traceAI-typesafe",
"traceAI-voyage"
]
}
35 changes: 35 additions & 0 deletions .github/release/github_release.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/env python3
"""Publisher-owned, idempotent tags/releases. Called only after registry verification."""
import argparse
import os
import subprocess
from pathlib import Path

import release_notes


def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--install", required=True)
parser.add_argument("--dist")
args = parser.parse_args()
tag, name, version = (os.environ[k] for k in ("TAG", "NAME", "VERSION"))
if subprocess.run(["gh", "release", "view", tag], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL).returncode == 0:
print(f"Release {tag} already exists")
return
changelog = Path(os.environ.get("CHANGELOG") or "__no_changelog__")
notes = release_notes.notes(name, version, changelog_text=changelog.read_text() if changelog.is_file() else None,
install=args.install, changelog_path=str(changelog) if changelog.is_file() else None)
path = Path(os.environ["RUNNER_TEMP"]) / "release-notes.md"
path.write_text(notes)
command = ["gh", "release", "create", tag, "--target", os.environ["GITHUB_SHA"],
"--title", f"{name} {version}", "--notes-file", str(path), "--latest=false"]
# An existing registry version need not match this checkout byte-for-byte. Never attach
# newly built artifacts to its historical release; only new uploads get asset attachments.
if args.dist and os.environ.get("REGISTRY_PUBLISHED") != "true":
command += [str(p) for p in sorted(Path(args.dist).glob("*")) if p.is_file()]
subprocess.run(command, check=True)


if __name__ == "__main__":
main()
Loading
Loading