Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script apis #1803

Merged
merged 20 commits into from
Jan 28, 2025
Merged

Script apis #1803

merged 20 commits into from
Jan 28, 2025

Conversation

jmthomas
Copy link
Member

No description provided.

@jmthomas jmthomas requested a review from ryanmelt December 30, 2024 22:55
Copy link

codecov bot commented Dec 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.44%. Comparing base (6de3c5c) to head (66b3ac8).
Report is 21 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1803      +/-   ##
==========================================
- Coverage   79.49%   79.44%   -0.05%     
==========================================
  Files         521      523       +2     
  Lines       40813    40866      +53     
==========================================
+ Hits        32445    32468      +23     
- Misses       8368     8398      +30     
Flag Coverage Δ
python 83.98% <ø> (-0.18%) ⬇️
ruby-api 48.42% <ø> (-0.16%) ⬇️
ruby-backend 82.60% <ø> (+0.07%) ⬆️

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

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

@jmthomas jmthomas requested a review from ryan-pratt January 26, 2025 03:49
@details[:state] = @state
@details[:line_no] = @current_line_number
@details[:update_time] = Time.now.to_s
OpenC3::StoreQueued.set("running-script:#{@id}", @details.as_json(:allow_nan => true).to_json(:allow_nan => true))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the as_json needed here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so ... I was following the pattern in spawn. as_json converts the symbol keys to strings and then to_json converts the entire thing to a json string. Not sure if as_json is explicitly required but it doesn't hurt.

openc3/lib/openc3/script/script_runner.rb Outdated Show resolved Hide resolved
@@ -51,6 +51,7 @@ def index
else
limit = ((stop - start) / 60).to_i # 1 event every minute ... shouldn't ever be more than this!
end
puts "activities index limit:#{limit}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove debug code.

@@ -54,6 +54,7 @@ def delete
if running_script
target_name = running_script['name'].split('/')[0]
return unless authorization('script_run', target_name: target_name)
ActionCable.server.broadcast("cmd-running-script-channel:#{params[:id]}", "stop")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is missing script_api: at the beginning of the stream name...?

Copy link

@jmthomas jmthomas merged commit cbbd238 into main Jan 28, 2025
29 of 30 checks passed
@jmthomas jmthomas deleted the script_apis branch January 28, 2025 17:22
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.

3 participants