Skip to content

[Part 1 for #issues/27922] Update 'repositoryRedirect' GraphQL API to get repository by its hashed name

Created by: erzhtor

Part 1 of https://github.com/sourcegraph/sourcegraph/issues/27922. Blocks https://github.com/sourcegraph/sourcegraph/pull/28621.

Description

This PR:

  • Adds SQL migration to add a new index
  • Updates repositoryRedirect GraphQL Schema API to get repository by its hashed name securely and without side-effects (like auto-cloning)

How to test

  • Run migration: sg run migration up
  • Start Sourcegraph in DotCom mode: sg start dotcom
  • Open GraphQL API Console Locally
  • Run the following query:
  repositoryRedirect(hashedName: "any-sha256-hashed-and-hex-encoded-repository-name") {
    name
    mirrorInfo {
      cloned
    }
  }
}

Merge request reports

Loading