Skip to content

Remove flows - #194

Merged
aguspe merged 6 commits into
masterfrom
chore/remove-flows
Nov 11, 2026
Merged

aguspe merged 6 commits into
masterfrom
chore/remove-flows

Conversation

@aguspe

@aguspe aguspe commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Removes raider flow and everything behind it, and removes schedules made with 4.1 automatically (spec: test schedules §6, §7; plan B). No user-facing text says "flow". Nothing the user wrote is deleted. lib/version stays 4.1.0 (the 4.2.0 bump is a later PR).

What changes

  • Removed: raider flow (init, run, list, schedule, unschedule, schedules), lib/utilities/flows/*, the flow templates, their sigs and specs. raider help no longer lists it.
  • Automatic cleanup (Schedules::Legacy): every raider schedule command first removes this project's 4.1 OS entries (dev.rubyraider.flow.<this project's hash10>.*, enumerated per OS; cron lines under the old tag that match the 4.1 command), then deletes .raider/flows/schedules.yml. One line on stderr: "Removed 1 schedule made with Ruby Raider 4.1 (name); it can't run in 4.2. Add it again with raider schedule add." list --json carries it in notice. A failed removal keeps the yml, is reported in the same line and retried next time.
    • Only ids recomputed from this project's real path are ever removed; an os_id stored in the yml is never used. Another project's same-name entry survives (specced for launchd, cron byte for byte, systemd, Task Scheduler).
    • The yml is deleted only when it parsed cleanly and every entry belongs to this project (a moved project's yml stays: its old ids are what the README tells the user to remove by hand).
    • Never deleted: flows/, .raider/tests/flows/, flow-results/, .raider/flows/env, .raider/flows/<name>/.
    • With no .raider/flows folder it costs one lstat: no adapter, no enumeration. While that folder exists, each raider schedule command (scheduled runs included) also enumerates the OS for old entries (a directory read on macOS; one extra schtasks /Query on Windows; a systemctl --user probe plus listing on Linux). The README says to delete the folder only after the removal line has appeared, because old cron/systemd entries log into it and the cleanup keys on it.
  • Hidden stub: an old entry that fires runs raider flow …; Raider.start catches flow/f before Thor, runs the cleanup for --project only (absolute, real path, regular Gemfile), writes the line to the entry's log, and exits 2 with any argv. No notification. Its own launchd entry is removed last, after the line is written and the yml deleted (launchd kills the job on bootout).
  • Launchd#remove now unlinks the plist before bootout (both kinds).
  • The 4.1 kind's words are reworded so error text the cleanup relays has no "flow"; adapter error text keeps the os_id/path verbatim (it is what the README's manual steps search for).
  • README: flows sections removed; "Upgrading from 4.1" added. RELEASE.md 4.2.0 line updated.
  • CI: e2e_tests.yml no longer runs the deleted spec/utilities/flows.

Example count

Full rspec at 8f15e9b: 2388 examples. Now 2240, 0 failures, 10 pending (Ruby 3.2 syntax checked for every changed lib file).

  • −191 deleted with flows: flow_commands 13, flows/project 18, run_log 5, runner 34, schedule 35, schedule_store 15, scheduler 27, integration/flows 36, generators/flow_helper 6, end_to_end Flows context 2.
  • +43 new: legacy, legacy_stub, kind, commands and adapter specs.
  • The 8 shared specs that built flow objects (next_run, os_enumerator, scheduler, cron, launchd, linux, systemd, task_scheduler) moved to the test-schedule kind with every escape/refusal case kept. They are now hermetic: they stub the captured GEM_* and bundle path. Before this, 7 cron/linux examples failed with a long GEM_HOME (crontab line over 990 bytes).

Word match

git grep -n -i -w -E 'flows?' -- lib sig README.md hits only kind.rb (the 4.1 kind), legacy.rb, legacy_stub.rb, the stub dispatch in ruby_raider.rb, and in README the leftover paths/ids/tags of "Upgrading from 4.1" (flows/, flow-results/, .raider/flows/, dev.rubyraider.flow., # raider-flow ).

Verified

  • Local: full rspec (incl. spec/utilities, spec/generators) 2240/0/10; rubocop, reek, steep 0.
  • Real macOS launchd (throwaway projects; 4.1 entries made with the released gem 4.1.0 from RubyGems, then the project switched to this branch):
    • raider schedule list: one stderr line "Removed 2 schedules made with Ruby Raider 4.1 (demo, weekly); …", both plists gone, launchctl print 113, flows/, flow-results/, .raider/flows/env byte-identical, only schedules.yml deleted.
    • An old entry kickstarted before any schedule command: the stub wrote the line to its scheduler.log; plist and job gone.
    • A throwaway project's 4.1 entry with the same name as another project's live entry: only the throwaway's was removed; the other plist's sha256 and mtime unchanged.
    • raider schedule add / list / list --json / run (passed) / launchd kickstart (passed, trigger schedule) / remove still work.
  • Windows Task Scheduler, systemd and cron: unit tests with command doubles only. On first contact also check: a running task deleting itself with schtasks /Delete.

Notes

  • The notice goes to whichever raider schedule command runs first in the project (normally the desktop's list when the Tests tab opens).

Deletes raider flow: its command, lib/utilities/flows, the flows templates, their sigs and specs, the end-to-end Flows context and the CI path. The UTF-8 guard stays for schedule/sc. The shared OS adapter, scheduler, next-run and enumerator specs now build TESTS-kind schedules, with hostile values carried in the bundle path, GEM_HOME and the project path, and stub the captured gem env and bundle so they no longer depend on the caller's GEM_HOME.
A job removing itself is ended by its own bootout, so its plist must be gone first.
Every raider schedule command first removes this project's 4.1 OS entries
(os_ids recomputed from the project path, never read from the yml) and then
.raider/flows/schedules.yml, with one notice on stderr (and in list --json).
A hidden stub catches raider flow from an old OS entry, cleans up (its own
entry last) and exits 2. No user-facing text says flow.
@aguspe
aguspe marked this pull request as ready for review November 11, 2026 19:51
@aguspe
aguspe merged commit 6dfad93 into master Nov 11, 2026
17 checks passed
@aguspe
aguspe deleted the chore/remove-flows branch November 11, 2026 22:52
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