Skip to content

graphql: Add option to query event logs by source

Administrator requested to merge ps/query-event-logs-by-source into main

Created by: philipp-spiess

Part of: #30843 (closed)

We only want to show the VSCE CTA when a user does not already have this CTA installed. One way of doing this is to query event logs for the presence of any logs from VS Code (here is some context in Slack).

I also verified that we do have an index on the source field: Screenshot 2022-02-25 at 16 42 41

Alternatives

  • Instead of querying events using this eventLogs API, we could also store a pre-computed value (e.g. "has_vsce") on the user model. I wrote about this approach in Slack.
    • The benefit here is that we would avoid this query since the user is already loaded in these cases. The obvious downside is that we have to parse every incoming event payload and need to do extra work to backfill the data.

Test plan

Screenshot 2022-02-25 at 17 12 07

Merge request reports

Loading