Repository navigation
Conversation
doistbot
left a comment
There was a problem hiding this comment.
This PR migrates the CLI to the @todoist owner/package scope and splits the release pipeline into a single build artifact plus a protected publisher, with solid dual-registry and release-record guards.
Few things worth tightening:
- The automatic npmjs publish path has no credentials and no provenance, so it will fail with
ENEEDAUTHonce automatic releases are enabled — wire up trusted publishing or retain a scoped token in the isolated npmjs environment. - The SDK-update workflow's dispatch-triggered builds never meet the push-event condition for auto-publishing, and the resulting unrecorded artifact then blocks every later main build until a maintainer manually dispatches the publisher; pushing with a bot app token or dispatching the publisher directly would fix it.
LICENSEdoesn't exist in the repo, so packing fails withENOENTonce the dependency gates clear — add the file or make the copy optional (the pack test's fixture masks this).- Subsequent publish/check-registry/record steps re-download and re-hash the same artifact roughly eight times per run; a lightweight verified mode would cut that, and
@todoist/cli-coreshould be exact-pinned instead of~1.10.0per repo standards.
I also included a few optional follow-up notes in the details below.
Optional follow-up notes (8)
release.config.js:17: The configured plugin
./scripts/release-analysis.mjsimports@semantic-release/commit-analyzerand@semantic-release/release-notes-generator, but neither is declared inpackage.json. They only resolve becausesemantic-releasecurrently hoists them transitively. Add both as direct devDependencies so this build does not depend on npm's hoisting layout.scripts/record-release.mjs:51: This
gitAuthblock duplicates the identicalautharray inscripts/source-release-record.mjs(line 132). Export that configuration from one shared module (for examplerelease-policy.mjs, or export it fromsource-release-record.mjs) and import it here, so thecredential.helper=!gh auth git-credentialoverride andhttp.extraheaderreset cannot drift between the recorder and the source commitback.scripts/pending-release.mjs:42: This local
apiclosure is the fourth copy of the sameJSON.parse(execFileSync('gh', ['api',repos/${REPOSITORY}/${path}]))requester in scripts/ (github-pages.mjs default requester, artifact-source.mjs, validate-source-run.mjs). Extract one shared requester — e.g. export the default from github-pages.mjs — and use it here, so future changes to gh invocation (auth env, maxBuffer) land in one place.scripts/pending-release.mjs:16: Lines 15–16 are two separate imports from the same module ('./release-policy.mjs'). Merge them into one import:
import { validateSourceRun, REPOSITORY, VERSION } from './release-policy.mjs'.scripts/github-release-record.mjs:250:
assertRecordedBaselinealready fetched the release assets and both asset bodies at lines 223–244, thenassertPublishedRecordimmediately fetches them again throughinspectAssets(api.assetsplus oneapi.readAssetper file). Nothing mutates in between, so pass the already-read asset list/bytes into the check (or inline it) to avoid duplicate GitHub round-trips.scripts/github-release-record.test.ts:285: This
unexpected assetsetup branch is dead code: theit.eacharray for this describe (lines 266–274) never produces'unexpected asset', so the branch can never run. Either add the scenario to the array or delete the branch so the test doesn't imply coverage that doesn't exist.scripts/pending-release.test.ts:45:
retainedPlansis only exercised with the defaultbeforeBaseline = () => false, so theif (beforeBaseline(run.head_sha)) continuepath is never covered. An inverted predicate would skip pending runs and letcheckPendingReleasespass over an unrecorded retained artifact. Add a case wherebeforeBaselinereturns true and assert the run is skipped without a download or yielded value.docs/releasing.md:147: This export line contradicts the requirement two paragraphs above it: "Obtain
GH_PACKAGES_TOKENthrough the existing secure credential flow, never in source or shell history." Exporting an interactive-shell variable is exactly how the token lands in shell history (and possibly a terminal transcript). Suggest instead reading the token at use time from a file or the credential manager, e.g.GH_PACKAGES_TOKEN=$(cat "$TOKEN_FILE")with a note to keep the file out of shared storage. See https://handbook.doist.com/doc/standard-secrets-management-wbKmIfrtgr
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| GH_PACKAGES_TOKEN: ${{ github.token }} | ||
| run: node scripts/release.mjs publish .tmp/release npmjs |
There was a problem hiding this comment.
This automatic npmjs publish has no npm credentials.
scripts/release.mjs publish ... npmjs uses command: 'publish', which skips the interactive npm login that only bootstrap-npm performs, strips NODE_AUTH_TOKEN/NPM_TOKEN from the isolated environment, and then publishes with --provenance=false, so it never enters the OIDC trusted-publishing path either. Once COMMS_CLI_AUTOMATIC_RELEASES=true is enabled, this step will fail with ENEEDAUTH. Use trusted publishing (provenance) for later npmjs releases or supply a scoped npm token that the isolated npmjs environment retains.
| if: >- | ||
| (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main') || | ||
| (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success' && | ||
| github.event.workflow_run.event == 'push' && vars.COMMS_CLI_AUTOMATIC_RELEASES == 'true') |
There was a problem hiding this comment.
SDK-update releases can never auto-publish, and their artifacts block later builds. update-comms-sdk.yml pushes its commit with GITHUB_TOKEN (which does not trigger workflows) and then runs
gh workflow run release.yml, so the only build for an SDK bump is a workflow_dispatch run — and this condition requires workflow_run.event == 'push', so it never publishes even after COMMS_CLI_AUTOMATIC_RELEASES=true. Since prepare-release.mjs fails any later push build while an unrecorded artifact exists (Retained release ... is not recorded), every SDK update also bricks the next main build until a maintainer manually dispatches publish-release.yml. Fix by having update-comms-sdk.yml push with the release bot app token (producing a real push-event build that auto-publishes) or by dispatching publish-release.yml itself after the artifact build succeeds.
| runAttempt: process.env.GITHUB_RUN_ATTEMPT, | ||
| }), | ||
| ) | ||
| execFileSync('node', ['scripts/release.mjs', 'pack', '.tmp/release'], { stdio: 'inherit' }) |
There was a problem hiding this comment.
Handle the missing LICENSE before packing. This command reaches
scripts/release.mjs, which unconditionally copies LICENSE, but that file doesn't exist in the repository. Once the dependency gates are cleared, release builds will still fail with ENOENT before uploading an artifact. Add the file or make its copy optional, and cover the actual repository layout—the pack test currently masks this by creating a fixture LICENSE.
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| GH_PACKAGES_TOKEN: ${{ github.token }} | ||
| run: node scripts/release.mjs publish .tmp/release npmjs |
There was a problem hiding this comment.
Each
publish/check-registry invocation re-enters release.mjs verify(), which re-downloads the full GitHub artifact through compareRetainedArtifact and re-inspects the tarball. The job already ran the same verify in the previous step, and record-release.mjs (line 121) repeats it three more times internally, so a normal both publish downloads and hashes the same artifact roughly eight times. Add a lightweight mode for the subsequent publish/check-registry/record steps (or pass the already-verified metadata/tarball) while keeping the per-write registry preflights.
| "dependencies": { | ||
| "@doist/cli-core": "1.9.0", | ||
| "@doist/comms-sdk": "3.11.0", | ||
| "@todoist/cli-core": "~1.10.0", |
There was a problem hiding this comment.
@todoist/cli-core is declared as ~1.10.0, a range specifier. The TypeScript repository standards require dependencies in package.json to be pinned to exact versions (https://handbook.doist.com/doc/standard-backend-repositories-). Every other dependency here is exact-pinned; pin this to the genuine published version before merge and regenerate the lockfile to match.
|
Obsolete now, closing |
[Posted by Jarvis]
Prepares Migration 001 for
@doist/comms-cli → @todoist/comms-cliand the GitHub owner rename. WAITING_FOR_PUBLICATION — draft, not mergeable. Proposed first new-scope release: 4.1.1, derived from current main/tag/npm 4.1.0 and guarded normal semantic-release analysis.tdc, config/keyring/OAuth identities, domains and API semantics.Merge/publication gates
@todoist/comms-sdk@4.0.1and transitive@todoist/sdk-kmp@0.6.2publication/access (SDK #139, KMP #74).@todoist/cli-coresuccessor; current old-scope main/npm is 1.10.0.~1.10.0is a temporary compatibility constraint, not an invented release. Exact-pin the genuine version, regenerate the lock and run fresh verification. The original lock is intentionally unchanged.npm-release, actual package visibility/linkage/ACLs, interactive real-artifact bootstrap and subsequent npm trust. Automatic publication remains disabled untilCOMMS_CLI_AUTOMATIC_RELEASES=true.M04 CLI producer precedes M05 TodoistOS #616. That consumer needs this final producer version,
tdc, explicit old-installation transition, matching dual-registry bytes and actual install evidence.Evidence
npm run verifypassed.@doist/comms-sdk@4.0.0+@doist/cli-core@1.10.0; 1,585 tests passed across 69 files, including the normal pre-push hook. Types/build/skill sync, local version/update-help and pre-commit checks passed.npm run verifystops at the genuine manifest/lock publication gate. No fabricated lock, skipped checks or production aliases.ubicloudcustom label; no runner/check was changed.Not verified: genuine new-scope install/pack, Node 26, live Comms/OAuth, actual publication/OIDC/retry, or post-rename access. No merge, dispatch, publication, release/tag creation, deployment, account/settings change, global CLI update or team message was performed.
See docs/releasing.md for exact setup, merge, bootstrap, retry and consumer-resume commands.