Repository navigation
Conversation
The Release workflow tags a version and publishes smarter-api to PyPI by itself, but docs.smarter-python.smarter.sh was published only when a maintainer ran make sphinx-publish with AWS credentials, so after a release the site could describe an older version than PyPI serves. cache-results already publishes its site from its Release workflow; this brings smarter-python in line with it. Written against the Smarter platform at release v0.36.20. Release workflow (.github/workflows/release.yml): - A new publish-docs job, copied from cache-results' job of the same name, runs after verify-pypi has installed the release back from PyPI, so the site documents exactly what pip install smarter-api installs. Prereleases from alpha and beta never reach PyPI, and so never reach the site. - It checks out the release tag, builds the site with sphinx-build -W, signs in to AWS with aws-actions/configure-aws-credentials, runs the same s3 sync and CloudFront invalidation as make sphinx-publish, then waits until the site's index page shows the new version, which html_title in docs/source/conf.py carries. - It runs in a new docs environment, to be limited to main in the repository's settings as the pypi environment is, and only when the repository variable PUBLISH_DOCS is true. - The role, bucket and distribution come from the repository variables DOCS_AWS_ROLE_ARN, DOCS_BUCKET and DOCS_DISTRIBUTION_ID, because this public repository must not contain an account or distribution id. The header comment lists the job and its variables. AWS access (terraform/docs/github_actions.tf, variables.tf, outputs.tf): - The role smarter-python-docs-publisher, which the job assumes with its GitHub OIDC token, so no AWS access key is stored in GitHub. Its trust policy accepts only a job in this repository's docs environment (variables github_repository and github_environment), and its policy allows only listing, reading, writing and deleting objects in the docs bucket, and creating and reading invalidations of its distribution. - GitHub's OIDC provider is one per AWS account and cache-results' terraform/docs creates it, so this stack reads it with a data source instead of creating it; a second aws_iam_openid_connect_provider would fail to apply. Apply cache-results' stack first. - A new output, publisher_role_arn, is the value of DOCS_AWS_ROLE_ARN; bucket_name and distribution_id are those of DOCS_BUCKET and DOCS_DISTRIBUTION_ID. Documentation: ADR-027 records the decision and the alternatives, which were an AWS key, publishing on every push to main, publishing prereleases, and creating a second OIDC provider. ADR-023, the README, and the smarter-python-release and smarter-sphinx-docs skills describe the job, its variables and environment, the dependency on cache-results' stack, and make sphinx-publish as the way to publish a docs fix between releases. Checked with actionlint, terraform fmt and validate, the pre-commit hooks and make sphinx-build. The job first runs on the next release from main. Before then, apply terraform/docs (make terraform-plan, make terraform-apply), create the docs environment limited to main, and set DOCS_AWS_ROLE_ARN, DOCS_BUCKET, DOCS_DISTRIBUTION_ID and PUBLISH_DOCS. Until PUBLISH_DOCS is true, the job is skipped. Co-authored-by: Claude <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
Author
|
🎉 This PR is included in version 0.6.0-alpha.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Contributor
Author
|
🎉 This PR is included in version 0.6.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Contributor
Author
|
🎉 This PR is included in version 1.0.0-alpha.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
The Release workflow tags a version and publishes smarter-api to PyPI by itself, but docs.smarter-python.smarter.sh was published only when a maintainer ran make sphinx-publish with AWS credentials, so after a release the site could describe an older version than PyPI serves. cache-results already publishes its site from its Release workflow; this brings smarter-python in line with it. Written against the Smarter platform at release v0.36.20.
Release workflow (.github/workflows/release.yml):
AWS access (terraform/docs/github_actions.tf, variables.tf, outputs.tf):
Documentation: ADR-027 records the decision and the alternatives, which were an AWS key, publishing on every push to main, publishing prereleases, and creating a second OIDC provider. ADR-023, the README, and the smarter-python-release and smarter-sphinx-docs skills describe the job, its variables and environment, the dependency on cache-results' stack, and make sphinx-publish as the way to publish a docs fix between releases.
Checked with actionlint, terraform fmt and validate, the pre-commit hooks and make sphinx-build. The job first runs on the next release from main. Before then, apply terraform/docs (make terraform-plan, make terraform-apply), create the docs environment limited to main, and set DOCS_AWS_ROLE_ARN, DOCS_BUCKET, DOCS_DISTRIBUTION_ID and PUBLISH_DOCS. Until PUBLISH_DOCS is true, the job is skipped.
Pull Request Template
Type of Change
Resolves
Changes
Describe what this Pull Request does
Testing
Describe the testing that has been done or needs to be done
Screenshots
Add any relevant screenshots
Dependencies
List dependencies
Breaking Changes
Describe any breaking changes