Publish the API docs from main, not only on a v* tag - #37
Open
wxiao0421 wants to merge 2 commits into
Open
Conversation
The Sphinx site has never been published. The job that deploys it lives in publish.yml, which triggers only on a v* tag, and the repository has no tags and no releases, so that workflow has never run and roblox.github.io/Sentinel returns 404 - while docs.yml sits on pages: write, id-token: write and a "pages" concurrency group it never uses. Moves that job into docs.yml on pushes to main, so the site tracks the code rather than waiting on a release that may never be cut. publish.yml keeps the package path only, with publish-pypi depending on build directly. The job as written would have published an empty site. autodoc imports the package to read its docstrings, sentinel_local_index imports sentence_transformers at module level, and that is an optional extra, so poetry install --with docs left all ten modules unimportable: sentinel.html built to 18 KB of bare headings rather than the 270 KB it produces once the package imports. Both jobs now install --extras sbert. sphinx-build exits 0 when autodoc cannot import a module, which is how an empty site would have shipped unnoticed, so both build steps now fail if the log contains "failed to import". The pull request job builds the HTML as well as the RST, since nothing checked that the site builds at all. Deployments take the "pages" group with cancel-in-progress false so a docs check on another branch cannot cancel a deployment in flight, and the workflow-level group becomes per branch. Also ignores docs/build/, the output directory docs/README.md tells you to open. Co-authored-by: Cursor <cursoragent@cursor.com>
The pull request trigger watched src/**/*.py and docs/**, so a change to docs.yml itself did not run it: the previous commit opened a pull request that rewrote this file and only Run Tests reported back, leaving the build and deploy steps unexercised until they reached main. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
roblox.github.io/Sentinelreturns 404 — the Sphinx site has never been published. The job that deploys it,publish-docs, lives inpublish.yml, which triggers only on av*tag, and this repository has no tags and no releases, so that workflow has never run. Meanwhiledocs.ymlcarriespages: write,id-token: writeand a"pages"concurrency group it never uses.This moves the deploy job into
docs.ymlon pushes tomain, so the site tracks the code rather than waiting on a release that may never be cut.The job as written would have published an empty site
Flagging this separately because it isn't obvious. autodoc imports the package to read its docstrings,
sentinel_local_indeximportssentence_transformersat module level, andsentence_transformersis an optional extra. Sopoetry install --with docsleaves all ten modules unimportable — andsphinx-buildstill exits 0:build/html/sentinel.html--with docs--with docs --extras sbertBoth jobs now install
--extras sbert, and both build steps fail if the log containsfailed to import, so an empty site cannot ship unnoticed. The pull request job also builds the HTML now; it previously regenerated only the RST, so nothing ever checked that the site builds at all.Arguably
sentinel_local_indexshould importsentence_transformerslazily, given the extra is declared optional. Left alone here as a separate concern.Other changes
publish.ymlkeeps the package path only, withpublish-pypidepending onbuilddirectly."pages"group withcancel-in-progress: false, so a docs check on another branch cannot cancel a deployment in flight. The workflow-level group is now per branch..gitignorecoversdocs/build/, the output directorydocs/README.mdtells you to open.Test plan
poetry install --with docs --extras sbertandsphinx-build -b html source build/html: build succeeded, no import failures, 270 KBsentinel.htmlcontaining the real APIdocs/generate_docs.pyleavesdocs/source/clean, so the existing sync check still passesbuildandpublish-pypistill useactions/upload-artifact@v3anddownload-artifact@v3, retired in January 2025, so tagging a release would fail before reaching PyPI