Skip to content

bitbucketserver: Set Repo.Archived if repository has archived label

Warren Gifford requested to merge core/archived into master

Created by: keegancsmith

A convention some of our customers use is to add the label "archived" to repositories which should be treated as archived. By setting "Repo.Archived", the customers will be able to filter out these repositories in our search.

Bitbucket Server does not include the labels for a repository in its responses. So instead we add support to our client for the labeled endpoint. We query this endpoint for the list of "archived" repos, then use the information to set archived on the repositories returned by the bitbucket server configuration.

Note: The labeled endpoint documents that it requires the REPO_ADMIN permission. However, this sounds unusual and in our testing this permission was not required.

Fixes https://github.com/sourcegraph/sourcegraph/issues/5494

Merge request reports

Loading