ENG-2491 - Add Connection Metadata for D&D#7283
Conversation
Few things here, the API experience was inconsistent. Not all of the D&D-enabled integrations returned that they were D&D integrations. This fixes that inconsistency. Also adds some categories for better organization
Co-locates metadata with other ConnectionType properties (human_readable, system_type) for better discoverability and maintainability.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
81d2990 to
cd5613d
Compare
Greptile OverviewGreptile SummaryThis PR adds structured metadata to connection types that support data discovery and detection monitors, exposing category, tags, and enabled features through the connection types API endpoint. What Changed:
Key Insights:
Confidence Score: 5/5
Important Files Changed
|
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
This comment was marked as resolved.
This comment was marked as resolved.
bc1fe50 to
73f43db
Compare
adamsachs
left a comment
There was a problem hiding this comment.
this generally looks good and fills an important gap we've had!
i've got a few things to think about, i don't think these are blockers, but they're probably worth us digging into while we're here, because realistically it may be a while before anyone returns!
- my main concern with a static map like this is that someone will forget to update it if/when they add a new connection type. can you think of a mechanism or a tweak so that we can ensure a metadata mapping is defined if/when someone adds a new
ConnectionType? ideally this lives as far upstream as possible: via a static check is best (but that can be difficult here/and in python generally), next best would be somewhere in the app code that throws a runtime error on module initialization so that server startup would fail, and then last fallback would be a test that fails. i know you have some test coverage for this functionality, but i don't think it'd actually fail if a new connection type was added and no mapping was provided - right? (apologies if i've missed a safeguard you already have in place for this!) - generally it'd be nice for us to leverage this API response in the FE, so that we don't have multiple sources of truth across the codebase. that's probably a bigger LOE than we want to take on in this particular PR, but can we make a followup task for this and/or get some buy-in from the FE team on this being a sound approach?
- as noted in the inline comments, seems like we may want some additional annotations for
enabled_features? maybe i've misunderstood how that field is meant to work though
let me know if you've got questions!
| # Identity Providers (discovery only) | ||
| ConnectionType.okta: ConnectionTypeMetadata( | ||
| category=ConnectionCategory.IDENTITY_PROVIDER, | ||
| tags=["Discovery"], |
There was a problem hiding this comment.
nit/maybe doesn't belong here, since i know this is already represented as "Discovery" in the UI...but on the original definitions of 'detection' and 'discovery', i'd expect this to be classified only as 'detection'. 'discovery' was specifically to refer to data classification...
i'm fine keeping this as-is to be consistent with what the UI shows now, but more than anything, i think this should just prompt us to re-visit whether we really should be distinguishing between 'detection' and 'discovery' still, since i think that has always been confusing, and we've really eliminated the distinction in the action center now (there are no distinct 'detection' and 'discovery' phases for datastore monitors).
| ConnectionType.postgres: ConnectionTypeMetadata( | ||
| category=ConnectionCategory.DATABASE, | ||
| tags=["Discovery", "Detection"], | ||
| enabled_features=[IntegrationFeature.DATA_DISCOVERY], |
There was a problem hiding this comment.
question: are the integration features meant to be mutually exclusive? if not, then i'd expect to also see DSR_AUTOMATION on many of these, right?
| enabled_features=[IntegrationFeature.DATA_DISCOVERY], | |
| enabled_features=[IntegrationFeature.DATA_DISCOVERY, IntegrationFeature.DSR_AUTOMATION], |
Ticket ENG-2491
Description Of Changes
This PR adds structured metadata to connection types that support data discovery and detection monitors, exposing this information through the connection types API endpoint. This allows API consumers and automated tooling to dynamically discover which connection types support which features without maintaining hardcoded lists
Rationale:
from the connection type API endpoint, I see the following for RDS Postgres, which supports Detection & Discovery as well as Access/Erasures.
{ "identifier": "rds_postgres", "type": "database", "human_readable": "RDS Postgres", "encoded_icon": null, "authorization_required": false, "user_guide": null, "supported_actions": [ "access", "erasure" ], "category": null, "tags": null, "enabled_features": null }Here's an example of a SaaS connection (pulls this data from the yaml)
{ "identifier": "braze", "type": "saas", "human_readable": "Braze", "encoded_icon": "...", "authorization_required": false, "user_guide": "https://docs.ethyca.com/user-guides/integrations/saas-integrations/braze", "supported_actions": [ "access", "erasure" ], "category": "MARKETING", "tags": [ "API", "DSR Automation" ], "enabled_features": [ "DSR_AUTOMATION" ] },It appears as though RDS Postgres doesn't support anything, but that's only because it isn't a SaaS type connection.
Code Changes
Steps to Confirm
Pre-Merge Checklist
CHANGELOG.mdupdatedmaindowngrade()migration is correct and works