Skip to content

Dynamic target packet definition creation support. #1048

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

Merged
merged 8 commits into from
Jan 18, 2024
Merged

Conversation

ryanmelt
Copy link
Member

@ryanmelt ryanmelt commented Jan 12, 2024

Also
Improve build time to only rebuild docs tools on base change
Update docusaurus

closes #419
closes #1026
closes #1044

@ryanmelt ryanmelt requested a review from jmthomas January 12, 2024 23:15
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.

Intriguing but I'm not sure how to use it

# Attempt to remove all older versions of this same plugin before install to prevent version conflicts
# Especially on downgrades
# Leave the same version if it already exists
OpenC3::GemModel.destroy_all_other_versions(File.basename(gem_file_path))
Copy link
Member

Choose a reason for hiding this comment

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

We leave the same version ... does the install process detect this and just abort the install?

Copy link
Member Author

Choose a reason for hiding this comment

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

The same version just gets left for the install.

@items = new_items
@sorted_items = new_sorted_items
clear_config_name()
end
Copy link
Member

Choose a reason for hiding this comment

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

I don't see this being called

Copy link
Member Author

Choose a reason for hiding this comment

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

Its called by the user. See my prometheus plugin soon.

# TODO: Add TEMPLATE_ENCODED so this can always be done inline regardless of content
if @template
config << " TEMPLATE '#{@template}'"
end
Copy link
Member

Choose a reason for hiding this comment

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

I don't understand this TODO 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.

I'll write the corresponding ticket. In short we need a TEMPLATE keyword that takes base64 encoded data so a multiline string can be handled in one line of config file.

Copy link
Member Author

Choose a reason for hiding this comment

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

bucket_key = File.join(bucket_path, file['name'])
local_path = "#{base_dir}/targets/#{target_name}/cmd_tlm/#{file['name']}"
bucket.get_object(bucket: ENV['OPENC3_CONFIG_BUCKET'], key: bucket_key, path: local_path)
end
Copy link
Member

Choose a reason for hiding this comment

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

This block is pulling down the dynamically created packets back into the local target_modified directory?

Copy link
Member Author

Choose a reason for hiding this comment

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

It is pulling them down into the files used to create the System object yes.

)
end
end
end
Copy link
Member

Choose a reason for hiding this comment

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

How does this get called?

Copy link
Member Author

Choose a reason for hiding this comment

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

Called by user. See prometheus metrics plugin.

Copy link

codecov bot commented Jan 18, 2024

Codecov Report

Attention: 51 lines in your changes are missing coverage. Please review.

Comparison is base (ebe2f07) 75.35% compared to head (1157f48) 75.31%.

Files Patch % Lines
openc3/lib/openc3/packets/packet.rb 14.81% 23 Missing ⚠️
openc3/lib/openc3/models/target_model.rb 46.15% 21 Missing ⚠️
openc3/lib/openc3/system/system.rb 57.14% 3 Missing ⚠️
...os-cmd-tlm-api/app/controllers/users_controller.rb 50.00% 2 Missing ⚠️
openc3/lib/openc3/models/gem_model.rb 84.61% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1048      +/-   ##
==========================================
- Coverage   75.35%   75.31%   -0.05%     
==========================================
  Files         592      592              
  Lines       43197    43277      +80     
  Branches      746      746              
==========================================
+ Hits        32553    32592      +39     
- Misses      10565    10606      +41     
  Partials       79       79              
Flag Coverage Δ
python 83.56% <ø> (-0.05%) ⬇️
ruby-api 48.76% <50.00%> (+<0.01%) ⬆️
ruby-backend 80.37% <43.67%> (-0.09%) ⬇️

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.

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions

3.7% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

@ryanmelt ryanmelt merged commit dd31e48 into main Jan 18, 2024
@ryanmelt ryanmelt deleted the dynamic_cmd_tlm branch January 18, 2024 21:36
@mkalin2
Copy link

mkalin2 commented May 6, 2024

Is there documentation or an example somewhere of how to implement dynamic telemetry packets?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants