Improve the monorepo release process
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 5/5
- 預估耗時
- 一週以上
- 新手友好度
- 45/100
研究方向
先閱讀 .github/workflows/pypi-publish.yml、相關的 lambda-layer-publish.yml,以及 ECR 模擬器映像工作流程。追蹤 release 標籤、來自 about.py 的套件版本與發佈步驟目前如何互動,接著將提議的 preflight 與驗證流程與所參照的 JS 儲存庫模型進行比較。當依標籤選取的套件能安全發佈、不相符的情況會在上傳前中止、已發佈的版本會被略過,且成功的 release 會經過驗證時,即表示完成。
由索引模型根據 Issue 內容生成。
描述
Problem
Python has no native tooling for releasing multiple packages from one monorepo. There is no equivalent of npm workspaces with per-package publish orchestration. This repository works around the gap with a GitHub Actions workflow, pypi-publish.yml. The workflow builds and publishes every package on every GitHub release. This design has three problems.
1. The release tag does not control what gets published.
The workflow triggers on release: published. It uses the tag only as a checkout ref. No filter connects the tag name to the package matrix. So a release tagged sdk-v2.0.0 builds and uploads all four packages: aws-durable-execution-sdk-python, -otel, -testing, and -insight.
The real selector is each package's __about__.py version. A package publishes when its version is absent from PyPI. A package fails when its version is already there. So the set of published packages depends on which version bumps sit on the tagged commit. It does not depend on what the tag says. A maintainer who intends to release only the SDK can unintentionally publish other packages.
One workflow does read the tag. lambda-layer-publish.yml gates on contains(tag_name, 'otel-v'). That gate forced the combined tag convention sdk-v1.7.0,otel-v0.3.0. The convention packs several package names into one git tag with commas.
2. Already-published versions fail the workflow instead of being skipped.
The publish step does not check PyPI before uploading. It does not set skip-existing. A package with an unchanged version is rebuilt and re-uploaded. PyPI rejects the upload with 400: Uploading new files to releases older than 14 days is not allowed. In practice the -testing package hits this on most releases. So every release since the monorepo conversion has finished with a failed workflow run. This holds even when the intended packages published successfully. A release workflow that is always red trains maintainers to ignore failures. Ignored failures hide real ones.
3. There is no pre-flight plan and no post-publish verification.
Nothing reports which packages will publish before uploads begin. Nothing confirms afterward that PyPI serves the new versions. The first signal of a wrong or missing publish is a user report, or a red job found by reading logs.
How the JS repository avoids this
aws-durable-execution-sdk-js has the same outer shape. A release event triggers a workflow that iterates all publishable packages. The difference is its publish script, iterate-publish-npm.sh. The script runs in two phases.
Phase one is a pre-flight. Before any upload, the script reads the npm registry state for every package. It decides a plan per package: publish under a computed dist-tag, skip because the version is already published, or reject for a policy violation. A reject aborts the run before any upload. An unreadable registry also aborts the run.
Phase two publishes according to the plan. A skip is a deliberate decision and the run stays green. After each upload the script polls the registry until the dist-tag points at the published version.
This makes releases idempotent. A release evaluates six packages and publishes only the ones whose versions moved. Single-package releases such as sdk-2.3.1 and combined releases such as sdk-2.4.0/test-1.1.4/otel-1.0.0 go through the same workflow.
The JS model still does not make the tag authoritative. Package selection there is also version-file-driven. The proposal below goes one step further.
Proposal
- Make the tag the source of truth for package selection. Define one tag grammar. For example,
sdk-v2.0.0names a single package andsdk-v2.0.0+otel-v1.0.0names a combined release. A preflight script parses the tag. Only the named packages are built and published. If a tagged version disagrees with the package's__about__.py, the preflight fails before any upload. - Add a preflight plan job. For each selected package, compare
__about__.pyagainst the PyPI JSON API. Emit a plan of publish, skip, or error to the job summary. Downstream jobs consume the plan. - Make publishing idempotent. Set
skip-existing: trueonpypa/gh-action-pypi-publish. A re-run of a partially failed release then republishes only what is missing. - Verify after publishing. Poll the PyPI JSON API until the new version is served. Bound the retries.
- Apply the same tag gate to the downstream release workflows. These are the Lambda layer and ECR emulator image workflows. An SDK-only tag must not rebuild or retag unrelated artifacts.
Acceptance criteria
- No tag/publish discrepancy. A release tagged for package X publishes exactly X. Publishing a package not named in the tag is impossible. This holds regardless of which version bumps exist on the tagged commit.
- Protection against accidental and inconsistent publishes. The preflight aborts before any upload when a tagged version disagrees with the source version. It also aborts when a policy check fails. Nothing is published on abort.
- Successful workflow runs on every legitimate release. An already-published version is a reported skip, not a failure. A green run means everything intended was published and verified. A red run means something went wrong. Re-running a release is safe and idempotent.
- 主要語言
- Python
- 星號
- 58
- 分支
- 32
- 平均合併
- 1 天 6 小時
- 30 天內合併 PR
- 80
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
aws/aws-durable-execution-sdk-python 的其他 Issue
-
enhancement needs-triage
難度 1/5 1-3 小時 新手友好度 72/100
aws/aws-durable-execution-sdk-python#927 ·
維護者通常 1 天內回覆
-
enhancement
難度 2/5 1-3 小時 新手友好度 82/100
aws/aws-durable-execution-sdk-python#875 ·
維護者通常 1 天內回覆
-
enhancement
難度 1/5 1 小時以內 新手友好度 85/100
aws/aws-durable-execution-sdk-python#794 ·
維護者通常 1 天內回覆
-
bug
難度 3/5 1-2 天 新手友好度 58/100
aws/aws-durable-execution-sdk-python#921 ·
維護者通常 1 天內回覆
-
[Bug]: JS examples CI still invokes Jest after Vitest migration可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉bug needs-triage
難度 3/5 1-2 天 新手友好度 55/100
aws/aws-durable-execution-sdk-python#918 ·
維護者通常 1 天內回覆
查看 aws/aws-durable-execution-sdk-python 的全部 Issue
相似的 Issue
-
physical
難度 2/5 1-3 小時 新手友好度 74/100
antonyrag/ragleap-core#1339 ·
-
enhancement good first issue
難度 2/5 1-3 小時 新手友好度 83/100
AllenCell/SubCellSeg#5 ·
-
[🐛 Bug]: oidc_authverifier.py strips trailing slash causing "Invalid token: Invalid issuer" error未關閉
難度 2/5 1-3 小時 新手友好度 76/100
keephq/keep#6934 · 1 個 reaction ·
維護者通常 1 天內回覆
-
bug game: 01008BA02525A000 ios
難度 2/5 1-3 小時 新手友好度 76/100
維護者通常 1 天內回覆
-
needs-triage
難度 1/5 1 小時以內 新手友好度 87/100
gke-labs/kube-agents#5501 ·
維護者通常 1 天內回覆