Skip to content

Bug - Not creating .csv for one of the graphql queries in the config.toml

When running the pipeline, I'd expect 3 reports to be generated. Only report 1 and report 3 are being produced.

# Multiple instances can be created, which query different GitLab instances and each have their own reports
[[instances]]
# Instance URL, defaults to the value of the CI_SERVER_URL environment variable
url = "https://cs.gitlabdemo.cloud"

# Name of environment variable that contains the GitLab token to use, defaults to GITLAB_TOKEN
#token_variable = "METRICS_TOKEN"

# Multiple reports can be configured
[[instances.reports]]
# It is possible to disable individual reports
# disabled = true
# Each report generates one CSV, and the filename can be overriden
# filename = "myuser.csv"

# Provide a complete GraphQL query. You can get one using the GraphQL explorer: https://docs.gitlab.com/api/graphql/#interactive-graphql-explorer
query = '''
{
  currentUser {
    username
    emails {
      nodes {
        email
	confirmedAt
      }
    }
  }
}
'''

[[instances.reports]]
# If nodes is in first level of query, they will be used to split CSV lines. This example will list all groups that the owner of the token is a member of on each line, and will include the group path, group name, and group ID columns.
query = '''
{
  selfManagedAddOnEligibleUsers(
    addOnType: DUO_ENTERPRISE
    addOnPurchaseIds: "gid://gitlab/GitlabSubscriptions::AddOnPurchase/1"
    filterByAssignedSeat: "true"
  ) {
    nodes {
      id
      name
      username
      lastActivityOn
      projectCount
    } 
  }
}
'''

[[instances.reports]]
# If nodes is in first level of query, they will be used to split CSV lines. This example will list all groups that the owner of the token is a member of on each line, and will include the group path, group name, and group ID columns.
query = '''
{
  selfManagedAddOnEligibleUsers(
    addOnType: DUO_ENTERPRISE
    addOnPurchaseIds: "gid://gitlab/GitlabSubscriptions::AddOnPurchase/1"
    filterByAssignedSeat: "true"
  ) {
    count 
  }
}
'''