Skip to content

Tighten doctor re-sync types: ReapplyOutcome enum and shared pack resolution #425

Open

Description

@bguidolim

Problem

Two small type/duplication issues introduced or carried forward in #421:

  1. ScopeReapplier.reapplyScope returns a Bool. true covers both "blocked because a configured pack cannot be produced" and "no packs to refresh". doctor --fix reads it as blocked, the tests call it blocked, and mcs update discards it via @discardableResult. The meaning lives only in the doc comment.
  2. "Resolve identifiers or collect the unresolved" is written twice, in BootstrapCommand.runSync (declared packs) and ConfiguratorSupport.additivePackSet (configured extras). Both build a pack list plus an unresolved list, then report and throw.

Proposed fix

  1. Return enum ReapplyOutcome { case applied, skipped } (or split skipped into blocked / nothingToDo if a caller needs it) so every call site reads clearly.
  2. Add one helper on TechPackRegistry, e.g. packs(for ids:) -> (packs: [any TechPack], unresolved: [String]), and use it at both sites.

Found during review of #421.

Activity

  1. added
    tech-debtTechnical debt and code quality improvements
    DRYCode duplication / DRY violation
    P4Low priority
    on Sep 25, 2026
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

    DRYCode duplication / DRY violationP4Low prioritytech-debtTechnical debt and code quality improvements

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions