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

Critical Commanding Support For Enterprise #1627

Merged
merged 8 commits into from
Oct 11, 2024
Merged

Conversation

ryanmelt
Copy link
Member

No description provided.

@ryanmelt ryanmelt requested a review from jmthomas October 10, 2024 04:24
Copy link

codecov bot commented Oct 10, 2024

Codecov Report

Attention: Patch coverage is 42.46575% with 126 lines in your changes missing coverage. Please review.

Project coverage is 76.47%. Comparing base (7725769) to head (72e57ad).
Report is 13 commits behind head on main.

Files with missing lines Patch % Lines
openc3/lib/openc3/script/critical_cmd.rb 16.27% 36 Missing ⚠️
...lib/openc3/microservices/interface_microservice.rb 37.83% 23 Missing ⚠️
openc3/lib/openc3/script/script.rb 16.66% 10 Missing ⚠️
openc3/lib/openc3/topics/command_topic.rb 16.66% 10 Missing ⚠️
...mdsender/src/tools/CommandSender/CommandSender.vue 12.50% 6 Missing and 1 partial ⚠️
...smos-cmd-tlm-api/app/controllers/api_controller.rb 0.00% 6 Missing ⚠️
...riptrunner/src/tools/ScriptRunner/ScriptRunner.vue 0.00% 6 Missing ⚠️
...3-cosmos-cmd-tlm-api/app/models/messages_thread.rb 0.00% 5 Missing ⚠️
...mos-script-runner-api/app/models/running_script.rb 0.00% 4 Missing ⚠️
openc3/lib/openc3/models/scope_model.rb 85.18% 4 Missing ⚠️
... and 7 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1627      +/-   ##
==========================================
- Coverage   76.77%   76.47%   -0.31%     
==========================================
  Files         614      618       +4     
  Lines       46403    46762     +359     
  Branches      827      829       +2     
==========================================
+ Hits        35628    35760     +132     
- Misses      10683    10909     +226     
- Partials       92       93       +1     
Flag Coverage Δ
frontend 56.21% <7.14%> (+<0.01%) ⬆️
python 83.92% <ø> (-0.65%) ⬇️
ruby-api 47.59% <34.48%> (-0.04%) ⬇️
ruby-backend 82.52% <46.59%> (-0.30%) ⬇️

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.

@ryanmelt ryanmelt changed the title Critical Commanding Critical Commanding Support For Enterprise Oct 10, 2024
Copy link
Member

@jmthomas jmthomas left a comment

Choose a reason for hiding this comment

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

Fix spelling, ruby tests
Add delete microservice, python code


offsets = nil
offsets = [start_offset] if start_offset
offsets = [start_offset, "$"] if start_offset
Copy link
Member

Choose a reason for hiding this comment

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

What does the "$" do? comment?

Copy link
Member Author

Choose a reason for hiding this comment

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

Added comment.

@@ -252,6 +276,21 @@ def deploy_scopecleanup_microservice(gem_path, variables, parent)
Logger.info "Configured microservice #{microservice_name}"
end

def deploy_critical_cmd_microservice(gem_path, variables, parent)
microservice_name = "#{@scope}__CRITICALCMD__#{@scope}"
Copy link
Member

Choose a reason for hiding this comment

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

Need a corresponding model.destroy in undeploy

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch.

# or say Yes and send the command. Thus we don't care about the return value.
prompt_for_hazardous(e.target_name, e.cmd_name, e.hazardous_description)
target_name, cmd_name, cmd_params = $api_server.method_missing(cmd_no_hazardous, *args, timeout: timeout, log_message: log_message, validate: validate, scope: scope, token: token)
if log_message.nil? or log_message
Copy link
Member

Choose a reason for hiding this comment

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

This is a weird check but I think it means log_message must be explicitly false for us to NOT call _log_cmd

<v-btn
type="submit"
@click.prevent="reject"
class="mx-2"
Copy link
Member

@jmthomas jmthomas Oct 11, 2024

Choose a reason for hiding this comment

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

Add outlined to match existing dialogs ... it's just an attribute not a class

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 had this originally, but it didn't respect disabled (looked exactly the same), so I dropped it.

@jmthomas
Copy link
Member

I noticed when sending a command in Command Sender you initially get the status as:
Status: Error sending INST CLEAR due to CriticalCmdError: CriticalCmdError

Even after approving the command the status doesn't change. It should say the command was sent. Not sure if you have to listen to the topic to know when this approval happens or what but we need the status to be accurate.

@jmthomas
Copy link
Member

jmthomas commented Oct 11, 2024

Updated confirmation dialog that handles errors:
Screenshot 2024-10-10 at 9 26 39 PM
Screenshot 2024-10-10 at 9 26 51 PM
Screenshot 2024-10-10 at 9 27 02 PM

Copy link

sonarcloud bot commented Oct 11, 2024

@ryanmelt ryanmelt merged commit df49ea0 into main Oct 11, 2024
27 checks passed
@ryanmelt ryanmelt deleted the critical_commanding branch October 11, 2024 18:09
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