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: update openapi schema for rule audits to include filter params #1194

Merged
merged 5 commits into from
Jan 22, 2025

Conversation

Dostonbek1
Copy link
Member

@Dostonbek1 Dostonbek1 commented Jan 21, 2025

  • define all the non-related, non-foreign-key fields in AuditRule, AuditAction and AuditEvent serializers as acceptable query params in openapi schema
  • create a reusable util function to achieve this

Rule Audit

image

Audit Action

image

Audit Event

image

@codecov-commenter
Copy link

codecov-commenter commented Jan 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.35%. Comparing base (4e8ad4c) to head (95b879a).

@@            Coverage Diff             @@
##             main    #1194      +/-   ##
==========================================
+ Coverage   93.33%   93.35%   +0.01%     
==========================================
  Files         261      262       +1     
  Lines       14939    14982      +43     
==========================================
+ Hits        13944    13987      +43     
  Misses        995      995              
Flag Coverage Δ
unit-int-tests-3.11 93.29% <100.00%> (+0.01%) ⬆️
unit-int-tests-3.12 93.35% <100.00%> (+0.01%) ⬆️

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

Files with missing lines Coverage Δ
src/aap_eda/api/views/rulebook.py 97.56% <100.00%> (ø)
src/aap_eda/utils/openapi.py 100.00% <100.00%> (ø)
tests/unit/test_utils.py 100.00% <100.00%> (ø)

@Dostonbek1
Copy link
Member Author

e2e test run with updated client: https://github.com/ansible/eda-server/actions/runs/12896272262

@Dostonbek1 Dostonbek1 marked this pull request as ready for review January 22, 2025 14:43
@Dostonbek1 Dostonbek1 requested a review from a team as a code owner January 22, 2025 14:43
Alex-Izquierdo
Alex-Izquierdo previously approved these changes Jan 22, 2025
Copy link
Collaborator

@Alex-Izquierdo Alex-Izquierdo left a comment

Choose a reason for hiding this comment

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

I love the idea and it is a LGTM, but I also think that generate_query_params function should have unit tests.

ttuffin
ttuffin previously approved these changes Jan 22, 2025
Copy link
Collaborator

@Alex-Izquierdo Alex-Izquierdo left a comment

Choose a reason for hiding this comment

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

❤️

@Dostonbek1 Dostonbek1 merged commit feb782f into ansible:main Jan 22, 2025
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants