feat: KEEP-1053 add kh workflow enable and disable - #80
Merged
Conversation
Nothing in the CLI was called enable, so turning a workflow on looked impossible: pause turns off, go-live publishes a template, update has no flag. The capability existed as resume - named for the inverse of pause rather than for the action - so a reader scanning the verb list, or searching for enable, concluded it was missing and reached for the API or the web UI. enable and disable become the primary names. resume, activate and pause are kept as aliases and stay working indefinitely; scripts, tutorials and published doc links depend on them, and tests pin each alias to its command so a later rename cannot quietly drop one. Their help text now cross-references, so finding one leads to the other. Runtime output follows the new vocabulary: 'Workflow <id> disabled' rather than 'paused'. This is a visible change for anyone matching on that string, and leaving it would have kept the confusion the rename exists to remove - the command and its own output would disagree. Regenerating replaces the pause and resume pages with enable and disable, which is the first real exercise of the pruning added in #78: the old pages are deleted rather than left behind as orphans.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
There was no discoverable way to turn a workflow on. Scanning
kh workflow --helpyou seepause(turns off),go-live(publishes a template) andupdate(no enable flag). Nothing says enable, so a tutorial ending "now turn iton" had to send readers to the web UI or a raw
PATCH /api/workflows/<id>.The capability existed as
resume- named for the inverse ofpauseratherthan for the action - so searching for "enable" found nothing.
enableanddisablebecome the primary names.Backwards compatibility
resume,activateandpauseare kept as aliases and stay workingindefinitely. Scripts, tutorials and already-published doc links depend on them.
Tests pin each alias to its command, so a later rename cannot quietly drop one.
The pre-existing pause/resume tests were kept invoking the old names, which
means they now double as alias coverage.
One visible behaviour change
Runtime output follows the new vocabulary:
Worth calling out for anyone matching on those strings. I changed it deliberately
rather than leaving it: the command and its own output would otherwise disagree,
which is exactly the confusion this PR exists to remove.
Help text now cross-references
Each command points at its opposite, so landing on one leads to the other:
A test asserts the cross-reference in both directions, since it is the part most
likely to rot.
This is the first real exercise of #78's pruning
Regenerating deletes
kh_workflow_pause.mdandkh_workflow_resume.mdand addskh_workflow_enable.mdandkh_workflow_disable.md.Before #78 the two old pages would have survived as orphans - published, indexed
in
_meta.ts, and documenting commands whose primary names no longer existed.That is precisely the failure #78 was built to prevent, now demonstrated on a
real rename rather than a planted canary.
Test plan
enable/resume/activate->enable;disable/pause->disablego build,go vet,golangci-lint run ./...(0 issues), fullgo test -race ./...- no failures