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

Fix registering device error with empty comment #2580

Merged

Conversation

johannaengland
Copy link
Contributor

Closes #2579

@johannaengland johannaengland self-assigned this Feb 22, 2023
@johannaengland johannaengland force-pushed the device-error-event-field-error branch 2 times, most recently from 451bce4 to b9dc0c4 Compare February 22, 2023 14:19
@codecov
Copy link

codecov bot commented Feb 22, 2023

Codecov Report

Merging #2580 (6cee026) into master (00e6a67) will increase coverage by 0.28%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #2580      +/-   ##
==========================================
+ Coverage   53.75%   54.03%   +0.28%     
==========================================
  Files         558      558              
  Lines       40588    40588              
==========================================
+ Hits        21819    21933     +114     
+ Misses      18769    18655     -114     
Impacted Files Coverage Δ
python/nav/web/devicehistory/views.py 43.36% <100.00%> (+14.15%) ⬆️
python/nav/ipdevpoll/pool.py 89.92% <0.00%> (+1.93%) ⬆️
python/nav/web/devicehistory/utils/error.py 78.33% <0.00%> (+60.00%) ⬆️
python/nav/web/quickselect.py 70.32% <0.00%> (+62.63%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@lunkwill42 lunkwill42 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 to me!

Older versions of Django were very lenient about what you could put into select_related calls (i.e. anything was allowed, only the arguments that represented real relations were adhered to). Django changed this, and it became an error to ask for unknown relations.

This just shows that we have no automated tests that revealed this at the time Django was upgraded.

The follow-up challenge, of course, is to add a test that reveals the problem by exercising this code :-)

@github-actions
Copy link

github-actions bot commented Feb 22, 2023

Test results

     12 files       12 suites   12m 38s ⏱️
3 225 tests 3 129 ✔️   96 💤 0
9 150 runs  8 862 ✔️ 288 💤 0

Results for commit 6cee026.

♻️ This comment has been updated with latest results.

@sonarcloud
Copy link

sonarcloud bot commented Mar 3, 2023

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

@johannaengland johannaengland merged commit 7490f5a into Uninett:master Mar 3, 2023
@johannaengland johannaengland deleted the device-error-event-field-error branch March 3, 2023 07:29
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.

[BUG] Registering a device error event with an empty comment crashes with a FieldError
3 participants