Skip to content

Checks the card steps' hook and params - #223

Merged
johnnyt merged 1 commit into
mainfrom
se-635m-card-steps-hook-settings
Oct 11, 2026
Merged

johnnyt merged 1 commit into
mainfrom
se-635m-card-steps-hook-settings

Conversation

@johnnyt

@johnnyt johnnyt commented Oct 11, 2026

Copy link
Copy Markdown
Member

Refs se-635m.

What changes

  • StatifierExamples.FormPost.Steps.hooked/2 checks the delay and failure hook before it runs a step. :delay_ms takes a non-negative integer and :fail takes true or false; any other value, any other key, or a setting that is not a keyword list raises an ArgumentError naming the step. Before, a non-integer or negative delay raised a case clause error and any truthy :fail failed the step. The hook is a test's and a demo's configuration, so a mistake in it surfaces as a crash with that message, as a misconfigured statifier_oban does in Steps.config/0, rather than as an answer the step gives about the application.
  • Steps.application_id/1 refuses params that are not a map with the same keys-only refusal, {:params_not_an_application_id, []}: such params have no keys to name, and the value is left out. Before, they raised a function clause error.
  • The moduledocs were read against the card application chart on main (priv/form_post/card_application.json). The Steps, Reader, screen and sort moduledocs already read true of it. Two sentences changed: the hook's example delay is now 6_000, which outlasts the chart's five-second bound (the old 5_000 only tied it), and the area check's moduledoc says the chart hands its word on to the patron system's route with the card lane's send, since no condition in the chart reads that word.
  • steps_test.exs: the shared library-system scope test is split so the screen, the area check and the sort each have their own test and sabotage note. New tests cover the non-map refusal and each hook refusal. Every new test was sabotage-checked: the mutation in its note turned that test, and only that test, red on an assertion, and the file was restored byte-equal afterwards.

Provenance

  • The sort also gets its own scope test and sabotage note, beside the area check the bead names, because it reads through the same reader the same way.
  • The hook also refuses an unknown key, so a misspelled setting fails loudly instead of being ignored.

Review

The kit's pre-request review round ran in-turn: the diff critic and the test critic. Neither raised a blocking finding. One advisory was taken: the first wording of the hook paragraph claimed a raise is not retried, which is not what StatifierOban.Invoke.Worker does, and the paragraph now makes no claim about retries. No record text changes in this PR.

Gate

Full mix quality is green on the pushed head: format, compile with warnings as errors, credo, dialyzer, and the full test suite with coverage.

The delay and failure hook now refuses what it does not take: a delay
that is not a non-negative integer, a fail that is not true or false,
any other key, or a setting that is not a keyword list raises an
ArgumentError naming the step, where a bad delay raised a case clause
error and any truthy fail failed the step. Params that are not a map
get the keys-only refusal with an empty key list instead of a function
clause error.

Each step's library-system scope gets its own test and sabotage note,
the area check and the sort included. The hook's moduledoc example
outlasts the chart's five-second bound, and the area check's moduledoc
says the chart hands its word to the patron system's route.

Refs: se-635m
@johnnyt
johnnyt force-pushed the se-635m-card-steps-hook-settings branch from e43f2aa to 040977b Compare October 11, 2026 09:15
@johnnyt
johnnyt merged commit 5836e1b into main Oct 11, 2026
4 checks passed
@johnnyt
johnnyt deleted the se-635m-card-steps-hook-settings branch October 11, 2026 09:17
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.

1 participant