Skip to content

658 autonomic input validation - #3765

Open
calmonroe wants to merge 15 commits into
mainfrom
658-autonomic-input-validation
Open

658 autonomic input validation#3765
calmonroe wants to merge 15 commits into
mainfrom
658-autonomic-input-validation

Conversation

@calmonroe

Copy link
Copy Markdown
Contributor

closes https://github.com/OpenC3/cosmos-enterprise/issues/658

What changed

Added item validation to the autonomic autonomic_trigger_create method to ensure the item exists prior to creation. If the item does not exist, the user will get the following error:
RuntimeError : autonomic_trigger_create failed due to RuntimeError : autonomic_trigger_create error: invalid operand: Item 'INST HEALTH_STATUS DNE' does not exist (TargetModel)

Why it changed

Previously a user could create an autonomic trigger for an item that doesn't exist, which could delay the user being aware of potential typos or issues with the trigger

Testing strategy

Added unit testing to ensure proper coverage
Tested functionality by going into Script Runner and attempting to create a trigger for an item that doesn't exist

@calmonroe

calmonroe commented Aug 24, 2026

Copy link
Copy Markdown
Contributor Author

@codecov

codecov Bot commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.12%. Comparing base (b04eb16) to head (c206430).
⚠️ Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3765      +/-   ##
==========================================
+ Coverage   79.09%   79.12%   +0.02%     
==========================================
  Files         894      894              
  Lines       66865    66876      +11     
  Branches     2551     2599      +48     
==========================================
+ Hits        52890    52915      +25     
+ Misses      13313    13300      -13     
+ Partials      662      661       -1     
Flag Coverage Δ
frontend 66.03% <ø> (+<0.01%) ⬆️
python 79.28% <ø> (+0.02%) ⬆️
ruby-api 81.94% <100.00%> (+0.17%) ⬆️
ruby-backend 84.44% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread openc3/lib/openc3/models/trigger_model.rb Outdated
Comment thread openc3/python/openc3/script/autonomic.py Outdated
@calmonroe
calmonroe requested a review from ryan-pratt August 26, 2026 17:01
@sonarqubecloud

Copy link
Copy Markdown

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.

2 participants