Skip to content

Resolve "Add feature flag to Advanced Traffic control with Canary Ingress"

What does this MR do and why?

As part of the removal of certificate-based feature, we're hiding all feature behind this FF, so that on 15.0 it's easier to remove them without actually having to remove the code.

For GraphQL it's not the simple to actually remove a mutation endpoint and bring it back with a FF as the schema is not regenerated after the FF changed. So the approach is to keep the endpoint but return an error with a comprehensible message.

Screenshots or screen recordings

With certificate_based_clusters FF enabled

Screen_Shot_2022-03-10_at_9.27.45_PM

With certificate_based_clusters FF disabled

Screen_Shot_2022-03-10_at_9.25.29_PM

How to set up and validate locally

  1. On rails console: Feature.enable(:certificate_based_clusters)
  2. On graphql-explorer run the mutation as in the image above
  3. On rails console: Feature.disable(:certificate_based_clusters)
  4. On graphql-explorer run the mutation as in the image above

Mutation sample for easy copy/paste:

mutation {
  environmentsCanaryIngressUpdate(input:{
    id: "gid://gitlab/Environment/29",              # Your Environment ID. You can get the ID from the URL of the environment page.
    weight: 45                                      # The new traffic weight. e.g. If you set `45`, 45% of traffic goes to a canary deployment and 55% of traffic goes to a stable deployment.
  }) {
    errors
  }
}

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 #351665 (closed)

Edited by João Alexandre Cunha

Merge request reports