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

Validate all user-provided strings that end up in pip-install commands #2003

Conversation

tcompa
Copy link
Collaborator

@tcompa tcompa commented Nov 5, 2024

Close #1999

Checklist before merging

  • I added an appropriate entry to CHANGELOG.md
  • I added logging to new code - if appropriate.
  • I merged main into the current branch.

@tcompa tcompa marked this pull request as ready for review November 5, 2024 08:47
@tcompa tcompa requested a review from mfranzon November 5, 2024 08:47
Copy link

github-actions bot commented Nov 5, 2024

Benchmark comparison

GET /api/alive/

User Time current (ms) Time main (ms) Ratio current/main Size current (Kb) Size main (Kb)
vanilla 0.8 0.8 1.00 0.0 0.0
power 0.8 0.8 1.00 0.0 0.0
dataset 0.8 0.8 1.00 0.0 0.0
project 0.9 0.8 1.12 0.0 0.0
job 0.9 0.7 1.29 0.0 0.0

GET /api/v2/dataset/

User Time current (ms) Time main (ms) Ratio current/main Size current (Kb) Size main (Kb)
vanilla 11.7 10.2 1.15 0.6 0.6
power 387.6 391.9 0.99 366.2 366.2
dataset 146.9 148.5 0.99 134.0 134.0
project 45.9 47.2 0.97 47.2 47.2
job 26.6 27.9 0.95 32.4 32.4

GET /api/v2/job/

User Time current (ms) Time main (ms) Ratio current/main Size current (Kb) Size main (Kb)
vanilla 6.6 6.6 1.00 2.2 2.2
power 138.9 141.7 0.98 652.0 652.0
dataset 138.3 140.4 0.99 904.8 904.8
project 48.9 48.1 1.02 283.7 283.7
job 37.5 38.2 0.98 224.8 224.8

GET /api/v2/project/

User Time current (ms) Time main (ms) Ratio current/main Size current (Kb) Size main (Kb)
vanilla 7.9 7.7 1.03 0.1 0.1
power 7.8 7.8 1.00 0.1 0.1
dataset 7.9 7.7 1.03 0.1 0.1
project 9.5 9.5 1.00 2.3 2.3
job 7.7 7.7 1.00 0.1 0.1

GET /api/v2/task/

User Time current (ms) Time main (ms) Ratio current/main Size current (Kb) Size main (Kb)
vanilla 6.3 6.7 0.94 0.8 0.8
power 6.1 6.3 0.97 0.8 0.8
dataset 6.5 6.6 0.98 0.8 0.8
project 6.2 6.3 0.98 0.8 0.8
job 6.1 6.4 0.95 0.8 0.8

GET /api/v2/task-group/

User Time current (ms) Time main (ms) Ratio current/main Size current (Kb) Size main (Kb)
vanilla 7.5 7.6 0.99 1.4 1.4
power 7.3 7.3 1.00 1.4 1.4
dataset 7.3 7.4 0.99 1.4 1.4
project 7.2 7.2 1.00 1.4 1.4
job 7.2 7.4 0.97 1.4 1.4

GET /api/v2/workflow/

User Time current (ms) Time main (ms) Ratio current/main Size current (Kb) Size main (Kb)
vanilla 11.8 11.9 0.99 0.8 0.8
power 25.9 25.7 1.01 29.1 29.1
dataset 19.7 19.8 0.99 16.7 16.7
project 25.5 25.3 1.01 21.0 21.0
job 11.3 11.7 0.97 0.8 0.8

POST /api/v2/project/3/dataset/402/images/query/

User Time current (ms) Time main (ms) Ratio current/main Size current (Kb) Size main (Kb)
dataset 151.6 151.4 1.00 275.1 275.1

GET /auth/current-user/

User Time current (ms) Time main (ms) Ratio current/main Size current (Kb) Size main (Kb)
vanilla 5.0 5.1 0.98 0.2 0.2
power 4.9 4.8 1.02 0.2 0.2
dataset 4.9 4.8 1.02 0.2 0.2
project 5.0 4.8 1.04 0.2 0.2
job 4.7 4.8 0.98 0.1 0.1

POST /auth/token/login/

User Time current (ms) Time main (ms) Ratio current/main Size current (Kb) Size main (Kb)
dataset 262.8 262.9 1.00 0.2 0.2

Copy link

github-actions bot commented Nov 5, 2024

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  fractal_server
  string_tools.py
  fractal_server/app/runner/executors/slurm/sudo
  executor.py
  fractal_server/app/schemas
  _validators.py
  fractal_server/app/schemas/v2
  dataset.py
  task_collection.py
Project Total  

This report was generated by python-coverage-comment-action

@tcompa tcompa merged commit 61b4b12 into main Nov 5, 2024
19 checks passed
@tcompa tcompa deleted the 1999-use-string_tools-validator-for-all-user-provided-strings-which-end-up-into-task-collection-bash-script branch November 5, 2024 09:41
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.

Use string_tools validator for all user-provided strings which end up into task-collection bash script
1 participant