Skip to content

Introduce ignoreRevs argument to GraphQL blame query

What does this MR do and why?

Introduce ignoreRevs argument to GraphQL blame query

Gitaly now supports filtering revisions out of the blames using ignore-revisions-blob.

We will now allow the frontend to send a toggle to enable or disable this filtering.

If the file doesn't exist or is corrupt a warning will be returned to the client.

Related to #519397 (closed)

Changelog: added

References

Add an argument to BlameResolver for using igno... (#519397 - closed)

How to set up and validate locally

  1. Find a project in your GDK with commits, get the full path e.g. gitlab-org/gitlab-test
  2. Select a file with multiple commits that we want to get the blame for.
  3. Create a .git-blame-ignore-revs file and add one of the commit shas
  4. In /-/graphql-explorer enter
query {
  project(fullPath: "gitlab-org/gitlab-test") {
    id
    repository {
      blobs(paths: ["README.md"]) {
        nodes {
          id
          blame(fromLine: 1, toLine: 100, ignoreRevs: false) {
            firstLine
            groups {
              commit {
                sha
                committedDate
              }
            }
          }
        }
      }
    }
  }
}
  1. change ignoreRevs: to true and check that the returned results have changed.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports

Loading