Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

353- initial infra for fideslog integration #541

Merged
merged 20 commits into from
Jun 7, 2022

Conversation

eastandwestwind
Copy link
Contributor

@eastandwestwind eastandwestwind commented May 19, 2022

NOTICE: Upon merging, internal devs should set a new env var: FIDESOPS__ROOT_USER__ANALYTICS_ID=internal

Purpose

Adds fideslog integration to fidesops.

Changes

  • Adds new Analytics class and associated schema, so we have ability to send event data
  • Adds new env var in config for global opt in/out with default as opt out = True (we can adjust as needed in future as we implement more granular user controls)
  • Updates docs for config

Testing Steps

  1. make server with no env vars should do 2 things: 1) set a ANALYTICS_ID in fidesops.toml, and 2) send a server_start event, viewable in logs: fidesops | INFO:fidesops.analytics:Analytics event sent: server_start with client id: 5905867115b98e73c35a60a35983fbef
  2. make server with your ANALYTICS_ID in fidesops.toml. The server_start event should still be sent, and the original ANALYTICS_IDshould exist infidesops.toml`
  3. make server with FIDESOPS__ROOT_USER__ANALYTICS_ID env var set to internal should send event with client id of internal, regardless of ANALYTICS_ID config value.
  4. Running tests via make commands should not send events
  5. Running CI should not send events

Checklist

  • Update CHANGELOG.md file in appropriate sections
  • Applicable documentation updated (guides, quickstart, postman collections, tutorial, fidesdemo, database diagram.
  • If docs updated (select one):
    • documentation complete, or draft/outline provided (tag docs-team to complete/review on this branch)
    • documentation issue created (tag docs-team to complete issue separately)
  • Good unit test/integration test coverage
  • This PR contains a DB migration. If checked, the reviewer should confirm with the author that the down_revision correctly references the previous migration before merging
  • The Run Unsafe PR Checks label has been applied, and checks have passed, if this PR touches any external services

Ticket

Fixes #353

@eastandwestwind
Copy link
Contributor Author

Got some feedback from @PSalant726 on this via screenshare code review. Will work on this Monday

Copy link
Contributor

@PSalant726 PSalant726 left a comment

Choose a reason for hiding this comment

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

Notes from today's screen share so I don't forget 😅

docs/fidesops/docs/guides/configuration_reference.md Outdated Show resolved Hide resolved
fidesops.toml Outdated Show resolved Hide resolved
requirements.txt Outdated Show resolved Hide resolved
src/fidesops/analytics.py Outdated Show resolved Hide resolved
src/fidesops/core/config.py Outdated Show resolved Hide resolved
src/fidesops/schemas/analytics.py Outdated Show resolved Hide resolved
Copy link
Contributor

@PSalant726 PSalant726 left a comment

Choose a reason for hiding this comment

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

I see several of my previous comments have 👍 's or have been resolved, but I'm not seeing any code changes since those comments were left. Maybe you just haven't pushed them up yet - I just wanted to point that out.

requirements.txt Outdated Show resolved Hide resolved
src/fidesops/analytics.py Outdated Show resolved Hide resolved
src/fidesops/schemas/analytics.py Outdated Show resolved Hide resolved
@seanpreston seanpreston assigned sanders41 and PSalant726 and unassigned sanders41 Jun 1, 2022
@eastandwestwind
Copy link
Contributor Author

@PSalant726 this is ready for another pass!

Makefile Outdated Show resolved Hide resolved
run_infrastructure.py Outdated Show resolved Hide resolved
run_infrastructure.py Outdated Show resolved Hide resolved
src/fidesops/analytics.py Outdated Show resolved Hide resolved
src/fidesops/analytics.py Outdated Show resolved Hide resolved
src/fidesops/core/config.py Show resolved Hide resolved
src/fidesops/main.py Outdated Show resolved Hide resolved
src/fidesops/main.py Outdated Show resolved Hide resolved
src/fidesops/schemas/analytics.py Outdated Show resolved Hide resolved
src/fidesops/analytics.py Outdated Show resolved Hide resolved
@PSalant726 PSalant726 added documentation Improvements or additions to documentation enhancement New feature or request dependencies Pull requests that update a dependency file and removed DON'T MERGE labels Jun 2, 2022
Copy link
Contributor

@PSalant726 PSalant726 left a comment

Choose a reason for hiding this comment

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

Only one of these comments is blocking this right now - the rest are just nits. This is really close 🙏

Makefile Outdated Show resolved Hide resolved
data/config/fidesops.toml Outdated Show resolved Hide resolved
fidesops.toml Show resolved Hide resolved
run_infrastructure.py Outdated Show resolved Hide resolved
run_infrastructure.py Outdated Show resolved Hide resolved
src/fidesops/analytics.py Outdated Show resolved Hide resolved
@eastandwestwind
Copy link
Contributor Author

Thanks again for the review @PSalant726 ! Back over to you, with some need for clarification

Copy link
Contributor

@PSalant726 PSalant726 left a comment

Choose a reason for hiding this comment

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

All of my comments at this point are just nice-to-haves, nothing blocking. Thanks for sticking with this - it's looking great now 🙌

Makefile Outdated Show resolved Hide resolved
data/config/fidesops.toml Show resolved Hide resolved
run_infrastructure.py Outdated Show resolved Hide resolved
fidesops.toml Show resolved Hide resolved
fidesops.toml Show resolved Hide resolved
@eastandwestwind
Copy link
Contributor Author

Ok we're ready again @PSalant726 !

@PSalant726 PSalant726 merged commit 0296ba0 into main Jun 7, 2022
@PSalant726 PSalant726 deleted the 353-fideslog-integration branch June 7, 2022 22:00
sanders41 pushed a commit that referenced this pull request Sep 22, 2022
* 353- initial infra for fideslog integration

* adds changelog

* cr and adds storage of analytics id in config

* implement internal mode, exclude tests/CI, implement sending server start event

* remove validationerr

* format

* sort

* lint

* cr changes

* lint fixes

* Adds root_user to test toml config

* Add analytics opt out arg to parser of run_infrastructure

* implicit true when passing env var to docker-compose

* small code style changes, and updating test fidesops.toml to opt out of analytics by default

* missing comma

* spacing issue

* remove fidesctl dep
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Fideslog] Incorporate Fideslog into Fidesops
3 participants