Skip to content

FIDES-1977: Overhaul fides-privacy-center logging (JSON logging, configurable log levels) and add option to throw error when server-side experience lookup fails#6133

Merged
tvandort merged 38 commits intomainfrom
FIDES-1977
May 21, 2025

Conversation

@tvandort
Copy link
Copy Markdown
Contributor

@tvandort tvandort commented May 8, 2025

Closes FIDES-1977

Description Of Changes

Allow different empty experience fallback mechanisms.
Improve logging in Privacy Center.

Steps to Confirm

  1. Use cookiehouse while the Fides API isn't running with the following set:
FIDES_PRIVACY_CENTER__MISSING_EXPERIENCE_BEHAVIOR=throw
FIDES_PRIVACY_CENTER__LOG_LEVEL=debug

Observe that the PC 500s and logs per retry are listed.

  1. Use cookiehouse with the Fides API running with the following set:
FIDES_PRIVACY_CENTER__MISSING_EXPERIENCE_BEHAVIOR=throw

Observe that everything works as it used to but

  1. Use cookiehouse with Fides API running with the following set:
FIDES_PRIVACY_CENTER__MISSING_EXPERIENCE_BEHAVIOR=empty_experience

Observe that an empty experience is returned.

  1. Use cookiehouse while Fides API is not running with the following set:
FIDES_PRIVACY_CENTER__MISSING_EXPERIENCE_BEHAVIOR=empty_experience

Observe that an empty experience is returned.

  1. Adjust the log level to info and observe that there are no debug logs.

  2. Observe that each log made during a HTTP request logs a request ID that is the same across messages.

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
    • Updates unreleased work already in Changelog, no new entry necessary
  • Followup issues:
    • Followup issues created
    • 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

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 8, 2025

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

Name Status Preview Comments Updated (UTC)
fides-privacy-center ❌ Failed (Inspect) May 21, 2025 7:22pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
fides-plus-nightly ⬜️ Ignored (Inspect) Visit Preview May 21, 2025 7:22pm

Comment thread clients/fides-js/src/services/api.ts
Comment thread clients/privacy-center/pages/api/fides-js.ts
Comment thread clients/privacy-center/pages/api/fides-js.ts Outdated
Copy link
Copy Markdown
Contributor

@lucanovera lucanovera left a comment

Choose a reason for hiding this comment

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

Good work! I left 1 suggestions for simplifying the code and a recommendation for using a library to handle the retry functionality.

Comment thread clients/fides-js/src/services/api.ts
Comment thread clients/privacy-center/app/server-utils/loadEnvironmentVariables.ts
Comment thread clients/privacy-center/pages/api/fides-js.ts Outdated
Copy link
Copy Markdown
Contributor

@NevilleS NevilleS left a comment

Choose a reason for hiding this comment

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

Ugh, I apologize for this "request changes", knowing that we're piling QoL asks onto a request that was originally fairly simple 👍

Comment thread clients/privacy-center/app/server-utils/loggerContext.ts Outdated
Copy link
Copy Markdown
Contributor

@NevilleS NevilleS left a comment

Choose a reason for hiding this comment

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

This is great - we have some issues with the fides-privacy-center Vercel deployment, but that's almost certainly a red herring.

@tvandort tvandort merged commit 7b61d77 into main May 21, 2025
16 of 17 checks passed
@tvandort tvandort deleted the FIDES-1977 branch May 21, 2025 19:35
@cypress
Copy link
Copy Markdown

cypress Bot commented May 21, 2025

fides    Run #12938

Run Properties:  status check passed Passed #12938  •  git commit 7b61d77cb0: FIDES-1977: Overhaul fides-privacy-center logging (JSON logging, configurable lo...
Project fides
Branch Review main
Run status status check passed Passed #12938
Run duration 00m 50s
Commit git commit 7b61d77cb0: FIDES-1977: Overhaul fides-privacy-center logging (JSON logging, configurable lo...
Committer Tom Van Dort
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.

3 participants