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

Supporting more use cases for the log_context decorator #5866

Merged
merged 3 commits into from
Mar 11, 2025

Conversation

galvana
Copy link
Contributor

@galvana galvana commented Mar 11, 2025

Closes LJ-488

Description Of Changes

Fixing bug where positional arguments were not being captured correctly by the @log_context decorator.

Code Changes

  • Fixed positional arguments use case and added more test coverage

Steps to Confirm

  1. Submit a privacy request, you should see the privacy_request_id as extra context for the following log
fides  | 2025-03-11 01:03:19.697 | INFO     | fides.service.privacy_request.privacy_request_service:queue_privacy_request:512 - Queueing privacy request from step None | {'privacy_request_id': 'pri_003425fe-a37e-4560-967e-58b3c0182c84'}

Pre-Merge Checklist

  • Issue requirements met
  • All CI pipelines succeeded
  • CHANGELOG.md updated
    • Add a db-migration This indicates that a change includes a database migration label to the entry if your change includes a DB migration
    • Add a high-risk This issue suggests changes that have a high-probability of breaking existing code label to the entry if your change includes a high-risk change (i.e. potential for performance impact or unexpected regression) that should be flagged
  • Followup issues:
    • Followup issues created (include link)
    • No followup issues
  • Database migrations:
    • Ensure that your downrev is up to date with the latest revision on main
    • Ensure that your downgrade() migration is correct and works
      • If a downgrade migration is not possible for this change, please call this out in the PR description!
    • No migrations
  • Documentation:
    • Documentation complete, PR opened in fidesdocs
    • Documentation issue created in fidesdocs
    • If there are any new client scopes created as part of the pull request, remember to update public-facing documentation that references our scope registry
    • No documentation updates required

Copy link

vercel bot commented Mar 11, 2025

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

Name Status Preview Comments Updated (UTC)
fides-plus-nightly ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 11, 2025 7:37pm
fides-privacy-center ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 11, 2025 7:37pm

@galvana galvana marked this pull request as ready for review March 11, 2025 01:04
func("something", task_id="abc123")
func("something", "abc123")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This typo is why I missed it the first time around 😵‍💫

@galvana galvana requested a review from erosselli March 11, 2025 01:06
Copy link

codecov bot commented Mar 11, 2025

Codecov Report

Attention: Patch coverage is 82.35294% with 3 lines in your changes missing coverage. Please review.

Project coverage is 87.01%. Comparing base (728a36a) to head (34cea85).

Files with missing lines Patch % Lines
src/fides/api/util/logger_context_utils.py 82.35% 2 Missing and 1 partial ⚠️

❌ Your patch check has failed because the patch coverage (82.35%) is below the target coverage (100.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5866      +/-   ##
==========================================
- Coverage   87.02%   87.01%   -0.01%     
==========================================
  Files         407      407              
  Lines       25125    25142      +17     
  Branches     2706     2712       +6     
==========================================
+ Hits        21864    21878      +14     
- Misses       2678     2680       +2     
- Partials      583      584       +1     

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

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@erosselli erosselli left a comment

Choose a reason for hiding this comment

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

🤩 Very cool

@galvana galvana merged commit 660bd4d into main Mar 11, 2025
35 of 36 checks passed
@galvana galvana deleted the LJ-488-log-context-does-not-capture-positional-args branch March 11, 2025 22:34
Copy link

cypress bot commented Mar 11, 2025

fides    Run #12658

Run Properties:  status check passed Passed #12658  •  git commit 660bd4ddab: Supporting more use cases for the log_context decorator (#5866)
Project fides
Branch Review main
Run status status check passed Passed #12658
Run duration 00m 51s
Commit git commit 660bd4ddab: Supporting more use cases for the log_context decorator (#5866)
Committer Adrian Galvan
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 5
View all changes introduced in this branch ↗︎

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.

2 participants