Skip to content

Adds pipeline sha to etag store

Laura Montemayor requested to merge lm-add-pl-sha-etag-cache into master

What does this MR do?

For issue #324628 (closed). We're update the polling implementation for the pipeline status in the Pipeline Editor to use etag caching.

This is the backend, pair this with the frontend changes in !59672 (merged) for proper testing.

  • For backend changes, this adds the ETag path for pipeline sha and passes an updated commitPipelinePath to the frontend when the CommitCreate mutation is triggered.

Mutation:

mutation commitCIFile(
  $action: CommitActionMode!
  $projectPath: ID!
  $branch: String!
  $startBranch: String
  $message: String!
  $filePath: String!
  $lastCommitId: String!
  $content: String
) {
  commitCreate(
    input: {
      projectPath: $projectPath
      branch: $branch
      startBranch: $startBranch
      message: $message
      actions: [
        { action: $action, filePath: $filePath, lastCommitId: $lastCommitId, content: $content }
      ]
    }
  ) {
    commit {
      sha
    }
    commitPipelinePath
    errors
  }
}

Response:

{
  "data": {
    "commitCreate": {
      "commit": {
        "sha": "709d1a7752a7c5a14a5c633ea0d250ab59927533"
      },
      "commitPipelinePath": "/api/graphql:pipelines/sha/709d1a7752a7c5a14a5c633ea0d250ab59927533",
      "errors": []
    }
  }
}

Screenshots

Instead of getting a bunch of 200s when getPipeline is polled, we should now see a bunch of 304s while the pipeline status hasn't changed.

Before After
Normal Polling Cached Responses

Does this MR meet the acceptance criteria?

Conformity

Related to #324628 (closed)

Edited by Mireya Andres

Merge request reports