feat(limits): add delete_limits_set API#3493
Open
jmthomas wants to merge 1 commit into
Open
Conversation
Add delete_limits_set(name) to remove a limits set from all telemetry items, the limits_sets hash, and current_limits_settings. Guards against deleting the DEFAULT and currently active sets. Batches the current_limits_settings cleanup into a single hmset to avoid a Redis round trip per item. Adds Ruby and Python implementations, script disconnect wrappers, JS API binding, docs, and tests. Closes #3464 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3493 +/- ##
==========================================
- Coverage 79.25% 79.24% -0.01%
==========================================
Files 689 689
Lines 57293 57358 +65
Branches 728 728
==========================================
+ Hits 45406 45452 +46
- Misses 11809 11828 +19
Partials 78 78
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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
delete_limits_set(name)API (Ruby + Python) to remove a limits set, as requested in #3464.Cleanup performed:
TargetModelpackets<scope>__current_limits_settingshdelthe set from<scope>__limits_setsopenc3_limits_eventsneeds no cleanup (append-only, capped at 1000)Guards: refuses to delete
DEFAULT, the currently active set, or a non-existent set.Design decisions (the open questions in the issue)
TargetModelpacket item definitions too (not justcurrent_limits_settings) for a complete removal.LIMITS_DELETE_SETevent type. That would require newLimits#remove_setinfrastructure; a deleted (non-active) set lingering in a running microservice's memory is harmless and is cleared on the next restart/resync fromcurrent_limits_settings.Performance
hsetcalls).current_limits_settingscleanup is batched into a singlehmset/hset mappingrather than one Redis round trip per item — important since this hash can be large (e.g. 100 packets × 1000 items).Changes
openc3/lib/openc3/api/limits_api.rbopenc3/lib/openc3/topics/limits_event_topic.rbopenc3/lib/openc3/script/limits.rbopenc3/python/openc3/api/limits_api.pyopenc3/python/openc3/topics/limits_event_topic.pyopenc3/python/openc3/script/limits.pyopenc3-js-common/src/services/openc3Api.jsdocs.openc3.com/docs/guides/scripting-api.mdTesting
Closes #3464
🤖 Generated with Claude Code