Skip to content

writ upgrade and reconcile do not see the segments deploy was given: -s is deploy-only, and reconcile's Config.Segments is never read #970

Closed

Description

@David-Noble-at-work

writ deploy -s KEY=value sets or appends a segment (cmd/writ/writ/config.go:94-101, segment.go:125-137), but only deploy registers the flag (cmd/writ/writ/commands.go:58):

  • writ upgrade re-renders templates from segments (cmd/writ/writ/upgrade/upgrade.go:100), reading WRIT_SEGMENT_* but not -s. A deploy made with -s renders differently on upgrade.
  • Reconcile's Config.Segments is set (config.go:179, commands.go:271) and never read (cmd/writ/writ/reconcile/reconcile.go:42-43 is its only occurrence), despite the "freshness comparison" comment at config.go:177-178.
  • WRIT_SEGMENT_<NAME> fills only segments that already exist (detect.go:45-57), so an environment variable can't add a custom segment the way -s can.

Found 2026-09-28 at 9cd1e95d, verifying #944.

Resolution

The segments a deploy used are the segments its upgrade and reconcile use: recorded, or taken from the same flags and environment, and read by reconcile or removed from its config.

Plan and design documents

Kind Document
Plan Not yet opened

Epic: #447 · Feature: #463

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Epic:WritDeploymentwrit deployment: layers, adoption, and driftSeverity:MediumBroken with a workaround, or a narrow pathbugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions