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: audit logs generation for feature state value #4525

Merged
merged 3 commits into from
Aug 21, 2024

Conversation

gagantrivedi
Copy link
Member

@gagantrivedi gagantrivedi commented Aug 21, 2024

Thanks for submitting a PR! Please check the boxes below:

  • I have added information to docs/ if required so people know about the feature!
  • I have filled in the "Changes" section below?
  • I have filled in the "How did you test this code" section below?
  • I have used a Conventional Commit title for this Pull Request

Changes

  • Catch ObjectDoesNotExists if the feature state is deleted
  • Don't pass null to diff_history if the prev history record does not exists

How did you test this code?

Updates test cases

- Catch ObjectDoesNotExists if the feature state is deleted
- Don't pass null to diff_history if the prev history record does not exists
@gagantrivedi gagantrivedi requested a review from a team as a code owner August 21, 2024 08:30
@gagantrivedi gagantrivedi requested review from zachaysan and removed request for a team August 21, 2024 08:30
Copy link

vercel bot commented Aug 21, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs ⬜️ Ignored (Inspect) Visit Preview Aug 21, 2024 9:59am
flagsmith-frontend-preview ⬜️ Ignored (Inspect) Visit Preview Aug 21, 2024 9:59am
flagsmith-frontend-staging ⬜️ Ignored (Inspect) Visit Preview Aug 21, 2024 9:59am

@github-actions github-actions bot added api Issue related to the REST API fix labels Aug 21, 2024
Copy link
Contributor

github-actions bot commented Aug 21, 2024

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-api-test:pr-4525 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-e2e:pr-4525 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-frontend:pr-4525 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-api:pr-4525 Finished ✅ Results
ghcr.io/flagsmith/flagsmith:pr-4525 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-private-cloud:pr-4525 Finished ✅ Results

Copy link
Contributor

github-actions bot commented Aug 21, 2024

Uffizzi Preview deployment-55413 was deleted.

Copy link

codecov bot commented Aug 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.93%. Comparing base (5cfdaba) to head (e604eb2).
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4525   +/-   ##
=======================================
  Coverage   96.92%   96.93%           
=======================================
  Files        1178     1178           
  Lines       39600    39616   +16     
=======================================
+ Hits        38384    38400   +16     
  Misses       1216     1216           

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

Comment on lines 2354 to 2355

assert response.status_code == status.HTTP_200_OK
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
assert response.status_code == status.HTTP_200_OK
# Then
assert response.status_code == status.HTTP_200_OK

@@ -692,6 +697,24 @@ def test_feature_state_value_get_skip_create_audit_log_if_environment_feature_ve
assert feature_state.feature_state_value.get_skip_create_audit_log() is True


def test_feature_state_value_get_skip_create_audit_log_for_deleted_feature_state(
Copy link
Contributor

Choose a reason for hiding this comment

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

Based on the codecov report, it looks like this isn't actually testing the codepath that you expect.

@github-actions github-actions bot added fix and removed fix labels Aug 21, 2024
@gagantrivedi gagantrivedi force-pushed the fix/fsv-audit-logs-without-history branch from 939b594 to 8d4a1b8 Compare August 21, 2024 09:16
@github-actions github-actions bot added fix and removed fix labels Aug 21, 2024
@gagantrivedi gagantrivedi added this pull request to the merge queue Aug 21, 2024
@github-actions github-actions bot added fix and removed fix labels Aug 21, 2024
Merged via the queue into main with commit af0369c Aug 21, 2024
21 of 22 checks passed
@gagantrivedi gagantrivedi deleted the fix/fsv-audit-logs-without-history branch August 21, 2024 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Issue related to the REST API fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants