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 some openapi warnings #897

Merged
merged 8 commits into from
Oct 9, 2024
Merged

Conversation

hmpf
Copy link
Contributor

@hmpf hmpf commented Oct 8, 2024

Test by visiting "/api/v1/schema/swagger-ui/" and "/api/v2/schema/swagger-ui/" without and with these commits, the list of warnings dumped to the terminal should be shorter.

Does not fix:

I have no idea where to start on the first, as for the last, I cannot figure out where drf-spectacular finds something to interpret as EventTypesEnum. There is also TypeEnum with the same contents. Setting ENUM_NAME_OVERRIDES does nothing.

Also does not fix (#903):

  • src/argus/filter/filters.py: Warning [IncidentViewSet > IncidentFilter]: Exception raised while trying resolve model field for django-filter field "tags". Defaulting to string (Exception: 'tags')
  • src/argus/filter/filters.py: Warning [SourceLockedIncidentViewSet > SourceLockedIncidentFilter]: Exception raised while trying resolve model field for django-filter field "tags". Defaulting to string (Exception: 'tags')
  • src/argus/filter/filters.py: Warning [IncidentViewSetV1 > IncidentFilter]: Exception raised while trying resolve model field for django-filter field "tags". Defaulting to string (Exception: 'tags')
  • src/argus/filter/filters.py: Warning [SourceLockedIncidentViewSetV1 > SourceLockedIncidentFilter]: Exception raised while trying resolve model field for django-filter field "tags". Defaulting to string (Exception: 'tags')

I'm thinking fixing one of the above will yield the solution for all four.

@hmpf hmpf self-assigned this Oct 8, 2024
@hmpf hmpf added documentation Improvements or additions to documentation API Affects Argus' REST API API v2 Ideas for API v2, backwards incompatible OK refactor labels Oct 8, 2024
@hmpf hmpf requested review from a team October 8, 2024 08:58
@hmpf hmpf marked this pull request as draft October 8, 2024 09:19
@hmpf hmpf force-pushed the fix-some-openapi-warnings branch from ad2c7a9 to 0abfb59 Compare October 8, 2024 10:00
@codecov-commenter
Copy link

codecov-commenter commented Oct 8, 2024

Codecov Report

Attention: Patch coverage is 82.75862% with 5 lines in your changes missing coverage. Please review.

Project coverage is 84.18%. Comparing base (1849ec9) to head (988f957).
Report is 9 commits behind head on master.

Files with missing lines Patch % Lines
src/argus/site/serializers.py 64.28% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #897      +/-   ##
==========================================
- Coverage   84.20%   84.18%   -0.03%     
==========================================
  Files          89       90       +1     
  Lines        4040     4065      +25     
==========================================
+ Hits         3402     3422      +20     
- Misses        638      643       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@hmpf hmpf marked this pull request as ready for review October 8, 2024 10:22
Copy link
Collaborator

@elfjes elfjes left a comment

Choose a reason for hiding this comment

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

I'm not sure how to review this. I think it looks fine. Doensn't seem to impact us. Always good to fix warnings

Copy link
Contributor

@podliashanyk podliashanyk left a comment

Choose a reason for hiding this comment

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

Tested it manually and it does what it promises.
This one probably needs a changelog fragment, and there is an unused import that can be removed

src/argus/auth/urls.py Show resolved Hide resolved
@hmpf hmpf force-pushed the fix-some-openapi-warnings branch from 0abfb59 to 14a37c0 Compare October 9, 2024 12:09
@hmpf hmpf force-pushed the fix-some-openapi-warnings branch from 14a37c0 to 988f957 Compare October 9, 2024 12:35
Copy link

sonarcloud bot commented Oct 9, 2024

@hmpf hmpf merged commit 140d45a into Uninett:master Oct 9, 2024
8 of 9 checks passed
@hmpf hmpf deleted the fix-some-openapi-warnings branch October 9, 2024 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API v2 Ideas for API v2, backwards incompatible OK API Affects Argus' REST API documentation Improvements or additions to documentation refactor
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants