Skip to content

Actionable v1.8.2 — review fixes

Choose a tag to compare

@aemadrid-twx aemadrid-twx released this 23 Oct 16:31
· 18 commits to main since this release
51f4f65

Three fixes found by a mutation-driven review, plus upgrade-guide answers from
a dry run against a large app. All three change what an app can see, so read
UPGRADING.md "1.8.1 → 1.8.2" before bumping. case_step branches now honour
if: / unless:: a guarded-out branch does nothing, silently, where the guard
used to be ignored. Actionable::RBS generates valid class names for ? / !
codes and raises on colliding ones. The first-run verb check sees through
alias_method, so it can raise on an aliased step it used to skip.

Fixed

  • case_step branches honour if: / unless:. on 'x', :handle, if: :ready? (and default :y, unless: …) accepted the guard and then ignored
    it, so the branch always ran. The branch is still picked by value alone; its
    guard now decides whether the target runs, as for a plain step. A matched
    branch whose guard opts out does nothing: no fall-through to the next branch
    or the default. Upgrade note: a branch you guarded now really skips.
  • Actionable::RBS names output classes for ? / ! codes validly.
    Under typed_outcomes, fails(:expired?) { … } emitted class Expired?FailureOutput, which RBS can't parse. A trailing ? / ! now
    becomes Predicate / Bang (ExpiredPredicateFailureOutput,
    DoneBangSkipOutput), so :x and :x? get different classes. generate
    now raises ArgumentError when two codes of one kind would share a class
    name (:ready / :ready_), which silently emitted one class for two
    schemas, or when a code can't start a class name. Upgrade note: rename
    one of two clashing codes.
  • The first-run verb check sees through alias_method. A step naming an
    alias (step :charge with alias_method :charge, :do_charge) looked up
    the def by the alias name, found none, and skipped the check; it now reads
    the original def, so a misplaced verb there raises DefinitionError like
    any other step. Documented limit: a module prepended over a step method
    hides the class's own def from the check. Upgrade note: fix the
    reported verb, as for any verb-position offense.

Documentation

  • UPGRADING.md, from a dry run against a large app (133 actions). The guide
    now says which six Finds must run on a green suite (silent behaviour changes)
    and that the rest cover code the suite doesn't reach. The describe Find skips
    RSpec.describe (1,552 hits before). The code Finds skip receivers and
    non-Ruby files. The @result entry says a Result you build yourself is still
    allowed, with halt!. A new section lists the class-level API unchanged since
    1.5.1. The cop entry says to list every base class defined in its own file. The
    opt-out goes in spec_helper, not an initializer. The effort estimate counts
    suite runs, and there is a PCRE2 check. AGENTS.md and the skill follow.