Skip to content

fix(publish)!: apply schema publish defaults when the config has no publish block - #690

Merged
goosewobbler merged 3 commits into
mainfrom
fix/667-publish-default-ecosystems
Oct 23, 2026
Merged

goosewobbler merged 3 commits into
mainfrom
fix/667-publish-default-ecosystems

Conversation

@goosewobbler

@goosewobbler goosewobbler commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

Description

Without a publish block, loadPublishConfig returned undefined and @releasekit/publish fell back to a hand-written getDefaultConfig() that still had cargo.enabled / pub.enabled set to false, the asymmetry ADR-0004 removed. The defaults now come from the schema instead:

  • loadPublishConfig parses an absent block through PublishConfigSchema and always merges the top-level git config.
  • getDefaultConfig() is toPublishConfig(PublishConfigSchema.parse({})). Only the git fallbacks stay hand-written, because publish.git has no schema defaults by design (it inherits the top-level git).
  • toPublishConfig structuredClones its input: Zod 4 shallow-clones .default({...}) values, so nested defaults (verify.*, npm.copyFiles) were otherwise shared between configs.
  • The same root cause dropped the top-level git config when there was no publish block (git.push: false still pushed). Fixed too.
  • Docs that still described crates.io / pub.dev publishing as opt-in: docs/rust.md, docs/dart.md, docs/architecture.md, packages/release/docs/ci-setup.md, packages/publish/README.md.

Breaking: a repo with detected Rust crates or Dart/Flutter packages and no publish block now publishes them, as ADR-0004 intends (#563 shipped the default, but it only applied when a publish block existed). Without credentials it fails rather than skips: crates.io at its auth check (CARGO_REGISTRY_TOKEN not set), pub.dev when dart pub publish / flutter pub publish runs. The run stops there; npm packages already published in that run stay published, and the push, tags and GitHub Releases wait for a re-run. Set publish.cargo.enabled / publish.pub.enabled to false to version and tag only.

Related Issue(s)

Closes #667. Found while working on it: #688, #689.

Type of Change

  • feat — New feature
  • fix — Bug fix
  • docs — Documentation change
  • refactor — Code refactoring
  • test — Adding or updating tests
  • chore — Maintenance, dependencies, tooling
  • Breaking change — Requires major version bump

Scope

  • @releasekit/version
  • @releasekit/notes
  • @releasekit/publish
  • @releasekit/release
  • @releasekit/config
  • @releasekit/core
  • CI / workflows
  • Root / monorepo

Checklist

  • Lint passes (pnpm lint)
  • Tests pass (pnpm test)
  • Typecheck passes (pnpm typecheck)
  • Documentation updated (if applicable)
  • Breaking changes noted in description

Testing Notes

  • @releasekit/publish config.spec.ts: a table test over no config file / no publish block / empty publish block, each equal to getDefaultConfig() with npm, cargo and pub enabled; top-level git inheritance without a publish block; defaults don't share nested objects between calls.
  • @releasekit/config load.spec.ts: the same table over the loader, plus git inheritance.
  • The new cases fail against main's sources and pass with the fix.
  • pnpm turbo run test --force for config / publish / release: 224 / 293 (+3 skipped) / 848 passed. docs:check and schema:check clean (the schema is unchanged).

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge with its documented breaking behavior.

Summary

The PR makes missing and empty publish blocks use the same schema defaults.

  • Missing publish settings now use schema defaults and inherit top-level Git settings.
  • Each publish config gets its own nested settings and lists.

Acknowledgments from goosewobbler: enabling detected Cargo/pub packages, including failures without credentials, is intentional breaking behavior. The exposed main branch default is acknowledged and tracked separately in #688.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Load repository config] --> B{Publish block exists?}
  B -->|Yes| C[Use parsed publish settings]
  B -->|No| D[Parse schema defaults]
  C --> E[Merge top-level Git settings]
  D --> E
  E --> F[Deep-clone settings]
  F --> G[Fill remaining Git defaults]
  G --> H[Publish pipeline]
Loading

Reviews (1) · Last reviewed commit: "fix(publish)!: apply schema publish defa..." · Reviewed by Greptile

…ublish block

Without a publish block, loadPublishConfig returned undefined and the
publish package fell back to a hand-written getDefaultConfig() that still
had crates.io and pub.dev publishing off, contrary to ADR-0004. It also
dropped the top-level git config, so e.g. git.push: false was ignored.

loadPublishConfig now parses an absent block through PublishConfigSchema
and always merges the top-level git config, and getDefaultConfig() derives
from the schema so the two can't drift again. toPublishConfig deep-clones
its input because Zod shallow-clones defaults, which would otherwise share
nested default objects between configs.

BREAKING CHANGE: a repo with detected Rust crates or Dart/Flutter packages
and no publish block now publishes them. Set publish.cargo.enabled or
publish.pub.enabled to false to version and tag only.

Closes #667

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Standing release PR: #614 · v0.42.0 queued (4 packages) · open 82d 20h 33m · ✅ ready to merge

Release Preview — v0.41.2 → v0.42.0

Note: Labels on this PR are advisory in standing-pr mode. Bumps come from conventional commits in the standing PR; override by editing labels on the standing PR itself. Add release:immediate to bypass the standing PR and release this PR directly.

These changes will be added to the release PR (#614) when merged:

Changelog

monorepo 0.41.2 → 0.42.0

Added

  • BREAKING envelope the version and publish commands, unwrap on the pipe (cli) (PR #616)

Changed

  • say where publish.git's fallbacks come from (publish)
  • add a Live Tests job, starting with notes against Ollama Cloud (PR #697 · closes #589)
  • run tests when packages/forge or packages/git change (PR #705 · closes #704)
  • cut isOllamaUnreachable's tests to the three that pin its rule (notes) (PR #702)
  • generate release notes with the OLLAMA_MODEL repo variable's model (PR #703)
  • make the LLM e2e infra-tolerant and close a false green (notes) (PR #618)
  • fix the skipped-bump entries (troubleshooting) (PR #695)
  • disable cargo/pub explicitly in the skip-when-disabled tests (publish)
  • run the integration suite in CI and fix its stale sync-tags fixture (version) (PR #685 · closes #654)

Fixed

  • BREAKING report each error's exit-code family as its envelope category (core) (PR #708)
  • BREAKING default to conventionalcommits and reject unsupported presets (version) (PR #694 · closes #652)
  • commit a hybrid package's Cargo.toml in a direct release (release) (PR #691 · closes #678)
  • BREAKING sync every committed Cargo.lock that records a bumped crate (version) (PR #674 · closes #650)
  • push the current branch when git.branch is unset (publish) (PR #696 · closes #688)
  • keep per-package and baseline tags in --input (publish) (PR #684 · closes #675)
  • skip crates marked publish = false (publish) (PR #693 · closes #692)
  • BREAKING apply schema publish defaults when the config has no publish block (publish) (#667)

All packages → 0.42.0 (sync versioning)

  • @releasekit/version
  • @releasekit/notes
  • @releasekit/publish
  • @releasekit/release

After merge — predicted release

No version escalation — this PR's changes will be included in the queued release without affecting the projected versions.

Package Standing PR This PR After merge
monorepo 0.42.0 0.42.0 0.42.0

Updated automatically by ReleaseKit

… tests

Both relied on the old off-by-default and, with no manifest on disk, passed
whatever the setting. They now write a crate/pubspec and turn the registry off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

crates.io and pub.dev publishing stays off when the config has no publish block

1 participant