Release artifact pipeline, SDK sync dispatch, and docs regeneration - #100
Release artifact pipeline, SDK sync dispatch, and docs regeneration#100adnanhq wants to merge 3 commits into
Conversation
- release.yml: on every published release, build the contracts at the tag and attach a deterministic ABI bundle (abis-<tag>.tar.gz plus SHA256SUMS) as release assets. Stable releases also dispatch a contracts-release-published event to oak-network/sdk (SDK_SYNC_TOKEN secret) so its Contracts Sync workflow opens an ABI update PR. Failures open a deduplicated release-pipeline issue. - docs.yml: regenerate forge-doc markdown on pushes to main that touch src/, sanitize machine-specific link paths, and open an auto PR. - build-abi-bundle.sh: reproducible tarball (sorted entries, fixed mtime) of all src/ ABIs plus DataRegistryKeys.sol and metadata. contractKind from the AST separates deployable contracts from libraries and interfaces. Errors on two sources sharing a contract name. - sanitize-docs.py: rewrites absolute machine paths in generated doc links to correct relative links, and fails on broken targets.
Replaces stale committed output: removes the deleted TestUSD contract doc, drops removed Ownable members and eliminates hardcoded absolute paths from the original author's machine. Generated with forge 1.7.1 plus .github/scripts/sanitize-docs.py, the same path docs.yml runs in CI.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Code reviewFound 3 issues:
Fix: delete the file, and add
contracts/.github/scripts/build-abi-bundle.sh Lines 88 to 90 in 4d1e416 Fix: replace line 89 with
contracts/.github/scripts/sanitize-docs.py Lines 6 to 8 in 4d1e416 Fix: either don't write the file when broken links are detected (collect all errors before writing), or correct the docstring to clarify the caveat. |
- Drop committed __pycache__ bytecode and ignore Python cache artifacts - Honor the workflow-pinned FOUNDRY_VERSION in metadata.json, falling back to the runtime forge version for local runs - Make sanitize-docs.py truly idempotent: compute all rewrites in memory and write nothing when a rewritten target is missing, so a failed run leaves the tree untouched and re-runs fail identically
|
All three issues from the earlier review are addressed in commit 4256469:
LGTM. 🤖 Generated with Claude Code |
Adds the release side of the SDK documentation sync pipeline, plus automated docs regeneration.
Release artifact pipeline (
release.yml)On every published GitHub Release: checks out the tag, builds with a pinned Foundry version (
forge build --ast), and attaches a deterministic ABI bundle (abis-<tag>.tar.gz+SHA256SUMS) as release assets. Stable (non-prerelease) releases then send acontracts-release-publishedrepository_dispatch to oak-network/sdk, whose Contracts Sync workflow opens an ABI update PR there. Any failure opens a deduplicatedrelease-pipelineissue here.The bundle is reproducible (sorted entries, fixed mtime) and contains trimmed per-contract ABI JSON for every
src/contract,DataRegistryKeys.sol, and metadata (tag, commit, solc and forge versions, contract inventory).contractKindfrom the AST separates deployable contracts from libraries and interfaces so the SDK can detect genuinely new contracts.Docs regeneration (
docs.yml)Pushes to main that touch
src/**regenerate the forge-doc markdown into a temp dir, sanitize any machine-specific absolute link paths (sanitize-docs.py, with a hard-failing guard), and open an auto PR. The customizedbook.toml,book.cssandsolidity.min.jsare never touched.This branch also includes a one-time regeneration of
docs/src: the committed output was stale (documented the removed TestUSD contract, still listed Ownable members that were removed, and contained hardcoded absolute paths from the original author's machine).Setup required
SDK_SYNC_TOKEN: fine-grained PAT scoped to oak-network/sdk only, Contents read/write (required by the dispatch API). A dead token fails the dispatch job loudly.release-pipelinefor the failure issues.release: published.v1.0.0tag cannot be rebuilt from a fresh clone (its tree is missing the openzeppelin-contracts submodule gitlink), so manual dispatch against it will fail at checkout. The next release cut from current main is fine.Testing
build-abi-bundle.shran end-to-end against the real artifacts tree (37 contracts, 9 deployable, byte-reproducible tarball across runs).sanitize-docs.pywas validated against the previously committed stale docs (28 absolute links rewritten, none broken, idempotent second run) and the regenerated docs are verified free of machine paths.Companion PRs: oak-network/sdk (sync workflows and tooling) and oak-network/crowdsplit (dispatch job).