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

Add cosmos validate to check plugins #1675

Merged
merged 3 commits into from
Jun 7, 2022
Merged

Add cosmos validate to check plugins #1675

merged 3 commits into from
Jun 7, 2022

Conversation

jmthomas
Copy link
Contributor

@jmthomas jmthomas commented Jun 6, 2022

closes #1337

@jmthomas jmthomas requested review from a user June 6, 2022 18:37
@@ -36,5 +36,7 @@ task :build => [:require_version] do
if platform == 'mswin32' or platform == 'mingw32'
puts "Warning: Building gem on Windows will lose file permissions"
end
# Build the widgets in the src directory
system("yarn run build")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can see that we're already doing this via the docker-package-build script but that only happens in the cosmos-init Dockerfile. As an example for other plugins, I think this command should also be here.

system = update_store(temp_dir)
deploy_microservices(gem_path, variables, system)
# Build a System for just this target
system = System.new([@name], temp_dir)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is where most of the validation takes place ... all the targets and their cmd/tlm

@codecov
Copy link

codecov bot commented Jun 6, 2022

Codecov Report

Merging #1675 (e0f5104) into master (b475170) will increase coverage by 7.70%.
The diff coverage is n/a.

❗ Current head e0f5104 differs from pull request most recent head a4350a4. Consider uploading reports for the commit a4350a4 to get more accurate results

@@            Coverage Diff             @@
##           master    #1675      +/-   ##
==========================================
+ Coverage   70.67%   78.37%   +7.70%     
==========================================
  Files          27      207     +180     
  Lines        1272    16924   +15652     
==========================================
+ Hits          899    13265   +12366     
- Misses        373     3659    +3286     
Impacted Files Coverage Δ
app/controllers/completed_script_controller.rb
config/initializers/process_manager.rb
app/channels/application_cable/channel.rb
config/initializers/cors.rb
app/channels/application_cable/connection.rb
config/application.rb
config/initializers/cts.rb
config/environment.rb
app/controllers/application_controller.rb
app/controllers/reaction_controller.rb
... and 224 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b475170...a4350a4. Read the comment docs.

plugin_hash = Cosmos::PluginModel.install_phase1(plugin_file_path, variables, scope: scope, validate_only: true)
Cosmos::PluginModel.install_phase2(plugin_hash['name'], plugin_hash['variables'], scope: scope, validate_only: true,
gem_file_path: plugin_file_path)
if ENV['COSMOS_NO_STORE'] == 'validate_plugin'
Copy link

Choose a reason for hiding this comment

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

This is unnecessary. ENV does not persist

@@ -308,6 +328,9 @@ if not ARGV[0].nil? # argument(s) given
when 'rake'
puts `rake #{ARGV[1..-1].join(' ')}`

when 'validate'
Copy link

Choose a reason for hiding this comment

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

I was thinking "dryrun" when I read this, but I think validate is ok too. Thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think validate is clearer plus that's what someone else used to describe this.

@jmthomas jmthomas merged commit d786600 into master Jun 7, 2022
@jmthomas jmthomas deleted the validate_plugin branch June 7, 2022 17:07
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.

How to validate the contents of the COSMOS text files
1 participant