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

🐛 filetypes in webserver API are case insensitive #4041

Merged
merged 5 commits into from
Mar 30, 2023

Conversation

pcrespov
Copy link
Member

@pcrespov pcrespov commented Mar 29, 2023

What do these changes do?

Searching for filetype values in the API is now case insensitive. To achieve that we enforce the values in the db (currently inserted by hand) to be uppercase and the search/comparison is done that way. Highlights:

  • Adds a check constraint to services_consume_filetypes.filetype to ensure uppercase
  • API parses and formats filetype as uppercase
  • ♻️ Update tests

Related issue/s

Based on the feedback from @ignapas after testing interaction with nih-portal

How to test

  • add some extension with lower characters to services_consume_filetypes.filetype wil raise a "CheckViolation" exception

@pcrespov pcrespov self-assigned this Mar 29, 2023
@pcrespov pcrespov changed the title 🐛 Is683/fix filetype 🐛 filetype is now case insensitive Mar 29, 2023
@pcrespov pcrespov changed the title 🐛 filetype is now case insensitive 🐛 filetypes in API are case insensitive Mar 29, 2023
@pcrespov pcrespov changed the title 🐛 filetypes in API are case insensitive 🐛 filetypes in webserver API are case insensitive Mar 29, 2023
@codecov
Copy link

codecov bot commented Mar 29, 2023

Codecov Report

Merging #4041 (ad21421) into master (3424370) will increase coverage by 5.1%.
The diff coverage is 88.8%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #4041      +/-   ##
=========================================
+ Coverage    78.5%   83.6%    +5.1%     
=========================================
  Files         751     433     -318     
  Lines       33554   22251   -11303     
  Branches      496     137     -359     
=========================================
- Hits        26354   18618    -7736     
+ Misses       7072    3584    -3488     
+ Partials      128      49      -79     
Flag Coverage Δ
integrationtests 66.7% <55.5%> (+<0.1%) ⬆️
unittests 84.8% <88.8%> (+8.2%) ⬆️

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

Impacted Files Coverage Δ
...webserver/studies_dispatcher/handlers_redirects.py 90.9% <88.8%> (-0.2%) ⬇️

... and 447 files with indirect coverage changes

@pcrespov pcrespov marked this pull request as ready for review March 29, 2023 15:02
@pcrespov pcrespov added the a:webserver issue related to the webserver service label Mar 29, 2023
@codeclimate
Copy link

codeclimate bot commented Mar 30, 2023

Code Climate has analyzed commit ad21421 and detected 0 issues on this pull request.

View more on Code Climate.

@sonarqubecloud
Copy link

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.0% 0.0% Duplication

Copy link
Contributor

@GitHK GitHK left a comment

Choose a reason for hiding this comment

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

👍

@pcrespov pcrespov merged commit 989d97f into ITISFoundation:master Mar 30, 2023
@pcrespov pcrespov deleted the is683/fix-filetype branch March 30, 2023 13:25
@pcrespov pcrespov mentioned this pull request Apr 7, 2023
15 tasks
pcrespov added a commit that referenced this pull request Apr 7, 2023
@matusdrobuliak66 matusdrobuliak66 mentioned this pull request Apr 20, 2023
26 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:webserver issue related to the webserver service
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants