PublishPlanner class

Decides what a ticket's publish run does with each of its repositories, and collects the answers the run needs — in one pass, in dependency order.

Per repository the pass

  1. decides whether a release is needed (PublishSkipCheck, unless publishUnchanged forces one or the repository already carries publish step progress),
  2. asks the version increment and the merge message — but only for a repository that publishes, and only when the configuration does not already answer them, and
  3. predicts the version the repositories after it resolve against: a skipped one contributes its unchanged manifest version, a publishing one the version its increment will produce.

One pass suffices because the repositories arrive in dependency order: a repository's decision depends only on its own state and on the versions of the dependencies before it, which are final by the time it is reached. Everything undecidable predicts null, which makes dependents publish rather than resolve against a guess.

gg do review runs the pass to learn which repositories get a pull request — and to ask the questions there instead of at publish time; gg do publish runs it to plan the release. Both write their answers into the ticket's .gg/gg-publish.json, so whoever runs second asks nothing again.

Implementers

Constructors

PublishPlanner({required GgLog ggLog, PublishSkipCheck? publishSkipCheck, PublishedVersion? publishedVersion, ReadManifestVersion? readManifestVersion, VersionSelector? versionSelector, EditMessage? editMessage, HasTerminal? hasTerminal})
Constructor

Properties

ggLog → GgLog
The log function
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

configureRepo({required Directory repoDir, required String seedMessage, RepoPublishConfig? existing, bool mergeOnly = false}) Future<RepoPublishPlan>
Asks the publish questions for the single repository repoDir and returns the answers plus the registry baseline the increment preview was calculated from.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
plan({required Directory ticketDir, required List<Node> subs, required GgLog ggLog, bool continueRun = false, bool publishUnchanged = false, bool mergeOnly = false, bool ask = true, bool reconfigure = false, bool requireAnswers = true, String? defaultMergeMessage, PublishPlanWording wording = PublishPlanWording.publish}) Future<PublishPlan>
Plans the run for the repositories subs of the ticket in ticketDir.
publishedNames(Directory repoDir, String fallback) Future<Map<PublishTarget, String>>
The names repoDir is known under on the registries it publishes to.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

seedMessageFor({required Directory ticketDir, String? defaultMergeMessage}) String
The merge-message seed of a ticket: an explicit -m wins, otherwise the ticket description.