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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 fixed SimcoreServiceSettingLabelEntry parsing #3052

Merged
merged 1 commit into from
May 18, 2022

Conversation

GitHK
Copy link
Contributor

@GitHK GitHK commented May 18, 2022

What do these changes do?

  • some services like iSeg are not able to start because the parsing failed.

Related issue/s

How to test

Checklist

@GitHK GitHK self-assigned this May 18, 2022
@GitHK GitHK requested a review from mguidon May 18, 2022 07:57
@codecov
Copy link

codecov bot commented May 18, 2022

Codecov Report

Merging #3052 (114d99f) into master (fdb8a04) will decrease coverage by 0.0%.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           master   #3052     +/-   ##
========================================
- Coverage    80.6%   80.5%   -0.1%     
========================================
  Files         712     712             
  Lines       30686   30686             
  Branches     4006    4006             
========================================
- Hits        24737   24727     -10     
- Misses       5099    5109     +10     
  Partials      850     850             
Flag Coverage 螖
integrationtests 66.1% <酶> (-0.1%) 猬囷笍
unittests 76.5% <酶> (-0.1%) 猬囷笍

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

Impacted Files Coverage 螖
...s/dynamic_sidecar/docker_service_specs/settings.py 64.6% <酶> (酶)
...mcore_service_webserver/garbage_collector_utils.py 79.4% <0.0%> (-3.0%) 猬囷笍
...tor_v2/modules/dynamic_sidecar/scheduler/events.py 90.6% <0.0%> (-1.1%) 猬囷笍
...webserver/computation_comp_tasks_listening_task.py 78.4% <0.0%> (-1.0%) 猬囷笍
.../src/simcore_service_webserver/director_v2_core.py 75.7% <0.0%> (-1.0%) 猬囷笍
...ector_v2/modules/dynamic_sidecar/scheduler/task.py 81.4% <0.0%> (-0.5%) 猬囷笍
.../director/src/simcore_service_director/producer.py 61.6% <0.0%> (-0.5%) 猬囷笍

Copy link
Member

@mguidon mguidon left a comment

Choose a reason for hiding this comment

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

Thanks for the hotfix!

@GitHK GitHK added this to the Croissant milestone May 18, 2022
@sonarcloud
Copy link

sonarcloud bot commented May 18, 2022

Kudos, SonarCloud Quality Gate passed!聽 聽 Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.5% 0.5% Duplication

"NanoCPUs": 0,
"MemoryBytes": 0,
"GenericResources": [],
SimcoreServiceSettingLabelEntry.parse_obj(
Copy link
Member

Choose a reason for hiding this comment

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

as @pcrespov said, using parse_obj is always more secure than the constructor.

Copy link
Member

Choose a reason for hiding this comment

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

not sure in this case makes a big difference though :-)
I think it is secure when your data is in a dict-like object but here we pass explicitly the values

Copy link
Member

Choose a reason for hiding this comment

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

Anybody an idea why this fails stochastically?

@GitHK GitHK merged commit 62c4c48 into ITISFoundation:master May 18, 2022
@GitHK GitHK deleted the fix-parsing-issue branch May 18, 2022 08:32
SimcoreServiceSettingLabelEntry.parse_obj(
dict(
name="Resources",
type="Resources",
Copy link
Member

@pcrespov pcrespov May 18, 2022

Choose a reason for hiding this comment

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

-Q: why are you not using the constructor? (curious about your decision)

-TIP: an alternative is to add Config.allow_population_by_field_name = True to SimcoreServiceSettingLabelEntry

Copy link
Contributor Author

@GitHK GitHK May 18, 2022

Choose a reason for hiding this comment

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

I think that was some very old code. I now Know we should go for the parsing instead of the constructor. I've seen that using the constructor does not trigger the validators (or some of them).

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.

None yet

4 participants