Skip to content

Conversation

@eseliger
Copy link
Member

@eseliger eseliger commented Feb 26, 2023

'src codeowners' is a tool that manages ingested code ownership data in a Sourcegraph instance.

Usage:

        src codeowners command [command options]

The commands are:

        get     returns the codeowners file for a repository, if exists
        create  create a codeowners file
        update  update a codeowners file
        delete  delete a codeowners file

Use "src codeowners [command] -h" for more information about a command.

Requires https://github.com/sourcegraph/sourcegraph/pull/48584.

Closes https://github.com/sourcegraph/sourcegraph/issues/47823.

Test plan

Verified with the new backend endpoints.

This requires some backend changes that I proposed on the schema PR, but it might help with testing the implementation.
@eseliger eseliger marked this pull request as ready for review March 2, 2023 22:16
@eseliger eseliger requested review from cbart and leonore March 2, 2023 22:16
Copy link
Contributor

@leonore leonore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spotted a mismatch with main!

Comment on lines +46 to +54
query := `mutation DeleteCodeownersFile(
$repoName: String!,
) {
deleteCodeownersFiles(repositories: [{
repoName: $repoName,
}]) {
alwaysNil
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this isn't up to date with main anymore, it takes a slice (just in case we wanted an admin UI with it)

go run ./cmd/src codeowners delete -repo 'github.com/leonore/sourcegraph-test'
GraphQL errors: 2 errors occurred:
	* {
  "locations": [
    {
      "column": 24,
      "line": 4
    }
  ],
  "message": "Unknown argument \"repositories\" on field \"deleteCodeownersFiles\" of type \"Mutation\"."
}
	* {
  "locations": [
    {
      "column": 2,
      "line": 4
    }
  ],
  "message": "Field \"deleteCodeownersFiles\" argument \"repositoryIDs\" of type \"[Int!]!\" is required but not provided."
}
exit status 1

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@leonore leonore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested on latest main!

@eseliger eseliger merged commit 241050b into main Mar 6, 2023
@eseliger eseliger deleted the es/codeowners-cli branch March 6, 2023 11:30
scjohns pushed a commit that referenced this pull request Apr 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update src-cli to plugin to codeownership ingestion graphQL

3 participants