Repository navigation
Conversation
Updates an existing trigger in place from a callsign file, changing only conditions.callsign and keeping its original string/array shape. Dry-run by default; refuses an empty file or removals beyond --max-removals (default 10% of the list, minimum 5), and reads the trigger back after saving to verify the update. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Adds a
set-callsignssubcommand that replaces the callsign list of one existing trigger with the contents of a file, updating the trigger in place.My use case: one HamAlert trigger (Source = SOTAwatch, URL action into our club's Slack) covers every member's callsign. I keep that list up to date from the Slack member list. The existing commands can't do this.
add-triggerandimport-fileonly create new triggers with callsign and mode conditions, andeditis interactive.Behavior
import-file: one callsign per line, with#and//comments skipped. Callsigns are uppercased and deduplicated.conditions.callsignchanges. It's written back in the shape it was read: a comma-separated string with the same separator, a newline-separated string, or an array. All other conditions, actions, the comment, and options are left as they were. The update goes through the existingupdate_trigger()with_id, so the trigger ID doesn't change.fullCallsigninstead ofcallsignor has no callsign condition, and if--commentmatches zero or several triggers.--max-removals(default: 10% of the current list, minimum 5). The dry run warns ahead of time when an apply would be refused.Changes
src/main.rs: the new subcommand and handler, plus pure helpers (parse_callsign_file,parse_callsign_condition,apply_callsigns,diff_callsigns,removal_limit,select_trigger) and 8 unit tests for them. As elsewhere in the repo, there are no network tests.README.mdand the bundled skill (commands.md,safety.md,workflows.md) document the new command.Testing
cargo fmt --all -- --check,cargo clippy --all-targets --all-features -- -D warnings, andcargo testall pass (49 tests).backupbefore and after) is still to do, and I'll report back here when it's done.🤖 Generated with Claude Code