Skip to content

Update mutation for google cloud logging configuration

Harsimar Sandhu requested to merge 409422-google-cloud-update-mutation into master

What does this MR do and why?

Describe in detail what your merge request does and why.

Update mutation for google cloud logging configuration

This commits add update mutation for google cloud logging configuration, which will be used to stream audit events to google cloud logging service

EE: true Changelog: added

How to set up and validate locally

  1. Run below GraphQL mutation to create google cloud logging config
mutation createGoogleCloudLoggingConfiguration {
  googleCloudLoggingConfigurationCreate(
    input: {
      groupPath: "GROUP_PATH", 
      googleProjectIdName: "testing-id", 
      logIdName: "somelogId", 
      clientEmail: "test@example.com", 
      privateKey: "someencryptedkey"}
  ) {
    googleCloudLoggingConfiguration {
      id
      googleProjectIdName
      logIdName
      privateKey
      clientEmail
    },
    errors,
  }
}
  1. Now update a field using the below mutation

mutation updateGoogleCloudLoggingConfiguration {
  googleCloudLoggingConfigurationUpdate(input: {
    id: "gid://gitlab/AuditEvents::GoogleCloudLoggingConfiguration/ID",
    googleProjectIdName: "testing-id-36",
  }){
    errors,
    googleCloudLoggingConfiguration {
      id,
      logIdName,
      privateKey,
      googleProjectIdName,
    },
  }
}
  1. Check the fields are correctly updated.

  2. This MR also adds google cloud logging configuration type into group type so we can query group to check present gc configs

query seeGoogleCloudLoggingConfigurations{
  group(fullPath:"GROUP_PATH"){
    id
    googleCloudLoggingConfigurations{
      nodes{
        id
        logIdName
        googleProjectIdName
        privateKey
      }
    }
  }
}

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #409422 (closed)

Edited by Harsimar Sandhu

Merge request reports