I’m trying to get together some GraphQL queries for our runbooks. One thing I’m stumped by is how do I find modifications for the teams that have permissions on the pipeline. This feels like an important event to keep track of just to know what’s going on around our infrastructure, but am kind of stumped on how to filter the events for a given pipeline. The query I’m starting with is
query auditEventsForPipeline($orgSlug: ID!) {
organization(slug: $orgSlug) {
auditEvents(first: 500, type: TEAM_PIPELINE_CREATED) {
edges {
node {
type
occurredAt
actor {
name
}
subject {
id
name
type
uuid
}
data
}
}
}
}
}
and I can see the events, but the subject appears to be, without knowing what’s going on, the row in the join table between teams and pipelines?
Is there a way to filter the events for a specific pipeline? Or, if I’m interested in a specific pipeline, do I just have to crawl all audit entries of type TEAM_PIPELINE_CREATED? Or maybe I’m looking at the wrong event type?
Hey! Unfortunately that doesn’t seem to work for specifically the TEAM_PIPELINE_CREATED since the subject who’s GraphQL ID I need is… the join table row? At the least what I can see from my side is that using the pipeline’s GraphQL ID as the subject results in an empty result for a pipeline which does have a team associated with it. I’ve tried getting the GraphQL ID from both the Pipeline’s settings, as well as from the query you sent
Thanks that makes sense. The part I’m still unfortunately having trouble with is combining the two answers. I can get the relevant audit events of team pipeline associations, and relevant events for a specific pipeline updates. But I cannot get team-pipeline association changes for a specific pipeline, because the subject for the team_pipeline related audit events is completely opaque to users? This feels like this should be a doable operation as it seems like a very reasonable thing to want to know when a team was granted/ungranted access to a specific pipeline?