Skip to content
New issue

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

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

Already on GitHub? # to your account

FI-1644: Input filtering #226

Merged
merged 5 commits into from
Jul 26, 2022
Merged

FI-1644: Input filtering #226

merged 5 commits into from
Jul 26, 2022

Conversation

Jammjammjamm
Copy link
Collaborator

@Jammjammjamm Jammjammjamm commented Jul 20, 2022

This branch filters inputs based on selected suite options. This is needed to support multiple version of the SMART IG where different input behaviors are required for the different versions. For example, PKCE is optional in SMART v1, but required in SMART v2, so the input needs to be handled differently depending on which version is being used.

Also includes the tiny fix for #228

@Jammjammjamm Jammjammjamm self-assigned this Jul 20, 2022
@codecov-commenter
Copy link

codecov-commenter commented Jul 20, 2022

Codecov Report

Merging #226 (5968eb7) into main (ece2e2c) will increase coverage by 0.05%.
The diff coverage is 97.77%.

@@            Coverage Diff             @@
##             main     #226      +/-   ##
==========================================
+ Coverage   76.38%   76.44%   +0.05%     
==========================================
  Files         184      184              
  Lines        4269     4279      +10     
  Branches      407      407              
==========================================
+ Hits         3261     3271      +10     
  Misses       1005     1005              
  Partials        3        3              
Impacted Files Coverage Δ
..._suites/dev_infrastructure_test/serializer_test.rb 100.00% <ø> (ø)
lib/inferno/entities/input.rb 100.00% <ø> (ø)
...b/inferno/apps/web/controllers/test_runs/create.rb 86.84% <75.00%> (ø)
dev_suites/dev_options_suite/options_suite.rb 96.36% <100.00%> (+0.13%) ⬆️
lib/inferno/apps/web/serializers/input.rb 100.00% <100.00%> (ø)
lib/inferno/apps/web/serializers/test.rb 100.00% <100.00%> (ø)
lib/inferno/apps/web/serializers/test_group.rb 100.00% <100.00%> (ø)
lib/inferno/apps/web/serializers/test_suite.rb 100.00% <100.00%> (ø)
lib/inferno/dsl/input_output_handling.rb 92.40% <100.00%> (-0.19%) ⬇️

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 ece2e2c...5968eb7. Read the comment docs.

Copy link
Contributor

@ms-k1ngk0ng ms-k1ngk0ng left a comment

Choose a reason for hiding this comment

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

Looks good !

lib/inferno/apps/web/serializers/test.rb Outdated Show resolved Hide resolved
lib/inferno/entities/input.rb Show resolved Hide resolved
submitted_inputs = [] if submitted_inputs.nil?

required_inputs.map(&:to_s) - submitted_inputs.map { |input| input[:name] }
required_inputs(selected_suite_options).map(&:to_s) - submitted_inputs.map { |input| input[:name] }
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm assuming the result of required_inputs can be a mix of strings and symbols -- if so, should we move the .to_s to line 96 to standardize what the method returns?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm pretty sure it doesn't matter if symbols or strings are returned. We know that the inputs from the JSON api will be strings, though, so we need to symbolize our internal input ids for comparison.

@Jammjammjamm Jammjammjamm force-pushed the fi-1644-input-filtering branch from 5968eb7 to 600c769 Compare July 26, 2022 13:47
@Jammjammjamm Jammjammjamm merged commit 500f2c5 into main Jul 26, 2022
@Jammjammjamm Jammjammjamm deleted the fi-1644-input-filtering branch July 26, 2022 14:35
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants