[CI/Tests] Keep the API reference generator here - #18
Conversation
Signed-off-by: yifeliu <31553858+pallasathena92@users.noreply.github.com>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 🧰 Additional context used📚 Code guidelines (3)No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (12)
Included review availability: This review used your included allowance. 2 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 3 reviews per hour. 📝 WalkthroughWalkthroughThis change adds a repository-owned API reference generator using configuration and Markdown templates, then updates the website and pin-move workflows to invoke it. It also updates generation instructions, workflow tests, and the generated page notice. ChangesAPI reference generation
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant Website as Website workflow
participant PinMove as Pin-move workflow
participant Baseline as Baseline revision
participant Generator as generate.sh
participant OME as OME checkout
participant Genref as genref v0.28.0
Website->>Generator: Generate API reference
Generator->>OME: Validate module and read Go version
Generator->>Genref: Install and run with configuration and templates
Genref->>OME: Read API types
Genref-->>Generator: Write generated page
Generator-->>Website: Copy page to output directory
PinMove->>Baseline: Read BASE_SHA
Baseline-->>PinMove: Provide hack/genref archive
PinMove->>Generator: Run archived script against OME
Merge Risk: ⚪ Minimal · up to The generator and workflow changes are ready to merge after normal checks. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. (10 skipped: 10 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
What this PR does
Moves the API reference generator into this repository.
hack/genref/now holds the genref version,config.yaml, the page templates andgenerate.sh, which builds the page from a checkout of OME.make genrefandhack/genref/website.hack/genref, which is the copy that the pin pull request's own check uses.config.yamland the templates are copied unchanged from OME at the pinned commit, except the header comment inpkg.tpl, which named a Make target. The regenerated page differs only in that comment.Why we need it
The config and the templates only describe this site's page, and the site left OME in ome-projects/ome#1192. With them here, a change to the page's layout or to the genref version is one pull request in this repository. The only thing this check then reads from OME is its source at the commit in
ome.ref, so OME can removehack/genref/website.genref still has to run inside the OME checkout: it resolves OME's types through OME's
go.mod, and it loads its templates from the working directory. The script copies the templates into a scratch directory in the checkout and removes it afterwards.How to test
hack/genref/generate.sh ../omeleavesgit statusclean. I also ran it against a copy of OME withhack/genrefdeleted, to confirm that nothing is read from there.python3 -m unittest discover -s hack/nightly-docs -p '*_test.py'has one new test, for the pin workflow's step.After this merges, a pull request in ome-projects/ome removes
hack/genref/website. The contributing pages still describe the in-repo workflow; their rewrite is a separate, planned change.Checklist
git commit -s)pnpm lint && pnpm check && pnpm test && pnpm buildpasses locallySummary by CodeRabbit
New Features
Documentation