spotify / lighthouse-audit-service

Apache License 2.0
96 stars 30 forks source link

integration with Backstage catalog service #35

Open fastfrwrd opened 4 years ago

fastfrwrd commented 4 years ago

Problem

At Spotify, we need the Lighthouse audits to tightly integrate with Backstage's catalog service, particularly when used with the Backstage plugin.


Proposed Solution

Note: This solution could be a path forward for many of the services we open source which have a hard dependency on the currently internal catalog service @ Spotify.

I would propose that lighthouse-audit-service continue to work without a catalog id, but rather add a kubernetes-like metadata field to every entry. This could be a JSON field in the postgres DB, and you could look up items by their metadata. We could support nuanced operators to allow for startsWith, endsWith lookups.

# obviously, this would be url encoded; not encoding for the sake of readability
http://lighthouse/v1/audits?metadata={"foo": { "op": "=", "value": "bar" }}

Then, when Lighthouse audits are created via Backstage, we would create them with the catalog entry's id as metadata.

In the Backstage plugin, we'd still have the top-level view, but we would also add component-level and things-l-own-level views for viewing audits and their trends.

stefanalund commented 4 years ago

Awesome to see you are starting to think about this!