Skip to content
Snippets Groups Projects

Cache `IntrospectionQuery` results"

Merged Roy Zwambag requested to merge 409448-rz-introspection-cache into master
All threads resolved!

What does this MR do and why?

Caches IntrospectionQuery results, since this is called rather often and takes a lot of time (often 5+ seconds, which triggers an 'error' in the error budget). Since the results are always the same for every deploy, we cache it, and reset the cache on restart

How to set up and validate locally

  1. Enable cache_introspection_query FF
  2. go to http://gdk.test:3000/-/graphql-explorer
  3. run query multiple times, first time it should be slow, next times cached and very fast:
query IntrospectionQuery {
  __schema {
    queryType {
      name
    }
    mutationType {
      name
    }
    subscriptionType {
      name
    }
    types {
      ...FullType
    }
    directives {
      name
      description
      locations
      args {
        ...InputValue
      }
    }
  }
}

fragment FullType on __Type {
  kind
  name
  description
  fields(includeDeprecated: true) {
    name
    description
    args {
      ...InputValue
    }
    type {
      ...TypeRef
    }
    isDeprecated
    deprecationReason
  }
  inputFields {
    ...InputValue
  }
  interfaces {
    ...TypeRef
  }
  enumValues(includeDeprecated: true) {
    name
    description
    isDeprecated
    deprecationReason
  }
  possibleTypes {
    ...TypeRef
  }
}

fragment InputValue on __InputValue {
  name
  description
  type {
    ...TypeRef
  }
  defaultValue
}

fragment TypeRef on __Type {
  kind
  name
  ofType {
    kind
    name
    ofType {
      kind
      name
      ofType {
        kind
        name
        ofType {
          kind
          name
          ofType {
            kind
            name
            ofType {
              kind
              name
              ofType {
                kind
                name
              }
            }
          }
        }
      }
    }
  }
}

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

Edited by Roy Zwambag

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Roy Zwambag
  • Roy Zwambag
  • Roy Zwambag
  • Roy Zwambag changed the description

    changed the description

  • Roy Zwambag added 295 commits

    added 295 commits

    Compare with previous version

    • Contributor
      Resolved by Aleksei Lipniagov

      Allure report

      allure-report-publisher generated test report!

      e2e-test-on-gdk: :exclamation: test report for d99f26d4

      expand test summary
      +-----------------------------------------------------------------------+
      |                            suites summary                             |
      +------------------+--------+--------+---------+-------+-------+--------+
      |                  | passed | failed | skipped | flaky | total | result |
      +------------------+--------+--------+---------+-------+-------+--------+
      | Create           | 8      | 0      | 1       | 0     | 9     | ✅     |
      | Framework sanity | 0      | 0      | 1       | 0     | 1     | ➖     |
      | Manage           | 1      | 0      | 0       | 0     | 1     | ✅     |
      | Govern           | 2      | 0      | 0       | 0     | 2     | ✅     |
      | Monitor          | 4      | 0      | 0       | 0     | 4     | ✅     |
      | Data Stores      | 2      | 0      | 0       | 1     | 2     | ❗     |
      | Plan             | 4      | 0      | 0       | 0     | 4     | ✅     |
      +------------------+--------+--------+---------+-------+-------+--------+
      | Total            | 21     | 0      | 2       | 1     | 23    | ❗     |
      +------------------+--------+--------+---------+-------+-------+--------+

      e2e-review-qa: :exclamation: test report for e1c62456

      expand test summary
      +-----------------------------------------------------------------------+
      |                            suites summary                             |
      +------------------+--------+--------+---------+-------+-------+--------+
      |                  | passed | failed | skipped | flaky | total | result |
      +------------------+--------+--------+---------+-------+-------+--------+
      | Manage           | 1      | 0      | 0       | 0     | 1     | ✅     |
      | Create           | 8      | 0      | 1       | 0     | 9     | ✅     |
      | Plan             | 3      | 0      | 1       | 2     | 4     | ❗     |
      | Monitor          | 4      | 0      | 0       | 0     | 4     | ✅     |
      | Framework sanity | 0      | 0      | 1       | 0     | 1     | ➖     |
      | Govern           | 2      | 0      | 0       | 1     | 2     | ❗     |
      | Data Stores      | 2      | 0      | 0       | 1     | 2     | ❗     |
      +------------------+--------+--------+---------+-------+-------+--------+
      | Total            | 20     | 0      | 3       | 4     | 23    | ❗     |
      +------------------+--------+--------+---------+-------+-------+--------+

      e2e-package-and-test: :heavy_minus_sign: test report for d99f26d4

      expand test summary
      +------------------------------------------------------------+
      |                       suites summary                       |
      +-------+--------+--------+---------+-------+-------+--------+
      |       | passed | failed | skipped | flaky | total | result |
      +-------+--------+--------+---------+-------+-------+--------+
      +-------+--------+--------+---------+-------+-------+--------+
      | Total | 0      | 0      | 0       | 0     | 0     | ➖     |
      +-------+--------+--------+---------+-------+-------+--------+
  • Roy Zwambag added 1 commit

    added 1 commit

    • 1242b803 - Cache separately on remove_deprecated param

    Compare with previous version

  • Roy Zwambag added 285 commits

    added 285 commits

    • 1242b803...7828df78 - 283 commits from branch master
    • 38a5a9d2 - Wrap introspection cache around graphql_controller.rb execute
    • cf5e426a - Cache separately on remove_deprecated param

    Compare with previous version

  • Roy Zwambag added 1 commit

    added 1 commit

    • 33eb30ce - Cache separately on remove_deprecated param

    Compare with previous version

  • Roy Zwambag added 2 commits

    added 2 commits

    Compare with previous version

  • Roy Zwambag marked this merge request as ready

    marked this merge request as ready

  • Roy Zwambag changed title from Draft: DO NOT MERGE - Resolve "Consider caching IntrospectionQuery results" to Cache IntrospectionQuery results"

    changed title from Draft: DO NOT MERGE - Resolve "Consider caching IntrospectionQuery results" to Cache IntrospectionQuery results"

  • Roy Zwambag marked the checklist item I have evaluated the MR acceptance checklist for this MR. as completed

    marked the checklist item I have evaluated the MR acceptance checklist for this MR. as completed

  • Roy Zwambag added 1 commit

    added 1 commit

    Compare with previous version

  • Roy Zwambag requested review from @alipniagov

    requested review from @alipniagov

  • Roy Zwambag added 1 commit

    added 1 commit

    • 29135967 - Use Gitlab.revision in the cache key

    Compare with previous version

  • Roy Zwambag added 762 commits

    added 762 commits

    • 29135967...87408dd1 - 758 commits from branch master
    • 9b3b80ba - Wrap introspection cache around graphql_controller.rb execute
    • e6d07973 - Cache separately on remove_deprecated param
    • 58d61202 - Use Gitlab.revision in the cache key
    • b7a08b52 - First check operationName

    Compare with previous version

  • Roy Zwambag added 1 commit

    added 1 commit

    Compare with previous version

  • Roy Zwambag added 2 commits

    added 2 commits

    • 7cce183a - Compare squished query strings
    • 1b81056c - Dont cache on fingerprint, but one cache

    Compare with previous version

  • Roy Zwambag added 1 commit

    added 1 commit

    Compare with previous version

  • Contributor

    Bundle size analysis [beta]

    This compares changes in bundle size for entry points between the commits b7d7ee2b and e1c62456

    :sparkles: Special assets

    Entrypoint / Name Size before Size after Diff Diff in percent
    average 4.13 MB 4.13 MB - 0.0 %
    mainChunk 2.97 MB 2.97 MB - 0.0 %

    Please look at the full report for more details


    Read more about how this report works.

    Generated by :no_entry_sign: Danger

  • Roy Zwambag
  • Roy Zwambag
  • Roy Zwambag added 63 commits

    added 63 commits

    • 9c246072...55446289 - 56 commits from branch master
    • f631caaf - Wrap introspection cache around graphql_controller.rb execute
    • 95ee0ca9 - Cache separately on remove_deprecated param
    • cd840200 - Use Gitlab.revision in the cache key
    • c021ba37 - First check operationName
    • 9357ee19 - Update spec
    • 165ef8d3 - Compare squished query strings
    • 3e78c2f1 - Dont cache on fingerprint, but one cache

    Compare with previous version

  • A deleted user added frontend label

    added frontend label

  • Aleksei Lipniagov
  • mentioned in issue #412457 (closed)

  • Roy Zwambag added 12 commits

    added 12 commits

    Compare with previous version

  • A deleted user added feature flag label

    added feature flag label

  • Roy Zwambag changed the description

    changed the description

  • Roy Zwambag added 5 commits

    added 5 commits

    • 00439e9c - First check operationName
    • cff87f16 - Compare squished query strings
    • 3ca80854 - Dont cache on fingerprint, but one cache
    • e15ef02a - Add Feature Flag
    • 1b635ede - Add Gitlab.revision and remove_deprecated specs

    Compare with previous version

  • Roy Zwambag requested review from @ntepluhina

    requested review from @ntepluhina

  • Natalia Tepluhina removed review request for @ntepluhina

    removed review request for @ntepluhina

  • Aleksei Lipniagov removed review request for @alipniagov

    removed review request for @alipniagov

  • Roy Zwambag added 1007 commits

    added 1007 commits

    • 1b635ede...b7faf643 - 998 commits from branch master
    • a786f5c5 - Wrap introspection cache around graphql_controller.rb execute
    • 918583ae - Cache separately on remove_deprecated param
    • 9b1ddc9a - Use Gitlab.revision in the cache key
    • c3917e37 - First check operationName
    • 9fa52e77 - Compare squished query strings
    • a328a05d - Dont cache on fingerprint, but one cache
    • ae55b050 - Add Feature Flag
    • f0de5508 - Add Gitlab.revision and remove_deprecated specs
    • df90455d - Move introspection query

    Compare with previous version

  • Roy Zwambag requested review from @alipniagov

    requested review from @alipniagov

  • Aleksei Lipniagov changed milestone to %16.1

    changed milestone to %16.1

  • added workflowin review label and removed workflowin dev label

  • Aleksei Lipniagov
  • Aleksei Lipniagov removed review request for @alipniagov

    removed review request for @alipniagov

  • Roy Zwambag added 125 commits

    added 125 commits

    • df90455d...cb8281e7 - 116 commits from branch master
    • 1805c480 - Wrap introspection cache around graphql_controller.rb execute
    • 558fb3de - Cache separately on remove_deprecated param
    • c63f44ea - Use Gitlab.revision in the cache key
    • dc5313f4 - First check operationName
    • 14faa9b5 - Compare squished query strings
    • 649256bd - Dont cache on fingerprint, but one cache
    • 26707c53 - Add Feature Flag
    • ce02d81c - Add Gitlab.revision and remove_deprecated specs
    • ad92a3c6 - Clean up method, add spec

    Compare with previous version

  • Roy Zwambag requested review from @alipniagov

    requested review from @alipniagov

  • Aleksei Lipniagov approved this merge request

    approved this merge request

  • :wave: @alipniagov, thanks for approving this merge request.

    This is the first time the merge request is approved. To ensure full test coverage, a new pipeline will be started shortly.

    For more info, please refer to the following links:

  • Aleksei Lipniagov resolved all threads

    resolved all threads

  • Aleksei Lipniagov requested review from @.luke

    requested review from @.luke

  • Aleksei Lipniagov removed review request for @alipniagov

    removed review request for @alipniagov

  • Luke Duncalfe
  • Luke Duncalfe
  • Luke Duncalfe
  • Luke Duncalfe
  • Luke Duncalfe
  • Luke Duncalfe
  • Luke Duncalfe removed review request for @.luke

    removed review request for @.luke

  • mentioned in issue #409448 (closed)

  • Roy Zwambag added 1 commit

    added 1 commit

    • 056bf7a8 - Apply 4 suggestion(s) to 1 file(s)

    Compare with previous version

  • Roy Zwambag added 369 commits

    added 369 commits

    • 056bf7a8...f2cad5b4 - 359 commits from branch master
    • faa30569 - Wrap introspection cache around graphql_controller.rb execute
    • 1154b515 - First check operationName
    • 49939925 - Compare squished query strings
    • e79fba4e - Add Feature Flag
    • b38b30bc - Add Gitlab.revision and remove_deprecated specs
    • 3634c20d - Apply 4 suggestion(s) to 1 file(s)
    • f0785617 - Add information about remove_deprecated in the cache key
    • 44d7879d - Update method names
    • d4dbaea3 - Move cached query string to a constant
    • e1c62456 - Test GraphiQL Gem Version

    Compare with previous version

  • Roy Zwambag requested review from @.luke

    requested review from @.luke

  • Luke Duncalfe
  • Luke Duncalfe
  • Luke Duncalfe
  • Luke Duncalfe
  • Luke Duncalfe removed review request for @.luke

    removed review request for @.luke

  • Roy Zwambag added 421 commits

    added 421 commits

    Compare with previous version

  • Roy Zwambag requested review from @.luke

    requested review from @.luke

  • Luke Duncalfe approved this merge request

    approved this merge request

  • Luke Duncalfe resolved all threads

    resolved all threads

  • @rzwambag Thank you for this improvement :heart:. Thank you also @alipniagov for your review. Set to merge when the pipeline succeeds :rocket:!

  • Luke Duncalfe enabled an automatic merge when the pipeline for e57660e6 succeeds

    enabled an automatic merge when the pipeline for e57660e6 succeeds

  • Luke Duncalfe
  • Luke Duncalfe resolved all threads

    resolved all threads

  • mentioned in issue #414361 (closed)

  • Luke Duncalfe resolved all threads

    resolved all threads

  • merged

  • Luke Duncalfe mentioned in commit 4c34f54b

    mentioned in commit 4c34f54b

  • Roy Zwambag mentioned in merge request !122725 (merged)

    mentioned in merge request !122725 (merged)

  • added workflowstaging label and removed workflowcanary label

  • mentioned in issue #414841 (closed)

  • David Fernandez mentioned in merge request !132647 (merged)

    mentioned in merge request !132647 (merged)

  • Please register or sign in to reply
    Loading