Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Commit

Permalink
repo-updater: ignore bitbucket servers which do not support lab… (#8889)
Browse files Browse the repository at this point in the history
Bitbucket Server labels were only released in version 5.13. However, we always
query for the "archived" label when syncing. This leads us to failing to sync
on versions before 5.13. We now handle the 404. Example error message:

  External service updated, but we encountered a problem while validating the
  external service: failed to list repos with archived label: Bitbucket API
  HTTP error: code=404
  url="https://example-bitbucket.com/rest/api/1.0/labels/archived/labeled?REPOSITORY=&limit=1000"
  body="404null for uri:
  https://example-bitbucket.com/rest/api/1.0/labels/archived/labeled?REPOSITORY=&limit=1000"
  • Loading branch information
keegancsmith committed Mar 11, 2020
1 parent 46c08e9 commit b3322ae
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@ All notable changes to Sourcegraph are documented in this file.

- Zoekt's watchdog ensures the service is down upto 3 times before exiting. The watchdog would misfire on startup on resource constrained systems, with the retries this should make a false positive far less likely. [#7867](https://github.com/sourcegraph/sourcegraph/issues/7867)
- A regression in repo-updater was fixed that lead to every repository's git clone being updated every time the list of repositories was synced from the code host. [#8501](https://github.com/sourcegraph/sourcegraph/issues/8501)
- The default timeout of indexed search has been increased. Previously indexed search would always return within 3s. This lead to broken behaviour on new instances which had yet to tune resource allocations. [#8720](https://github.com/sourcegraph/sourcegraph/pull/8720)
- Bitbucket Server older than 5.13 failed to sync since Sourcegraph 3.12. This was due to us querying for the `archived` label, but Bitbucket Server 5.13 does not support labels. [#8883](https://github.com/sourcegraph/sourcegraph/issues/8883)

### Removed

## 3.13.1

### Fixed

- To reduce the chance of users running into "502 Bad Gateway" errors an internal timeout has been increased from 60 seconds to 10 minutes so that long running requests are cut short by the proxy in front of `sourcegraph-frontend` and correctly reported as "504 Gateway Timeout". [#8606](https://github.com/sourcegraph/sourcegraph/pull/8606)
- Sourcegraph instances that are not connected to the internet will no longer display errors when users submit NPS survey responses (the responses will continue to be stored locally). Rather, an error will be printed to the frontend logs. [#8598](https://github.com/sourcegraph/sourcegraph/issues/8598)
- Showing `head>` in the search results if the first line of the file is shown [#8619](https://github.com/sourcegraph/sourcegraph/issues/8619)
- A regression in repo-updater was fixed that lead to every repository's git clone being updated every time the list of repositories was synced from the code host. [#8501](https://github.com/sourcegraph/sourcegraph/issues/8501)
Expand Down
5 changes: 4 additions & 1 deletion cmd/repo-updater/repos/bitbucketserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,10 @@ func (s *BitbucketServerSource) listAllLabeledRepos(ctx context.Context, label s
for next.HasMore() {
repos, page, err := s.client.LabeledRepos(ctx, next, label)
if err != nil {
if bitbucketserver.IsNoSuchLabel(err) {
// If the instance doesn't have the label then no repos are
// labeled. Older versions of bitbucket do not support labels, so
// they too have no labelled repos.
if bitbucketserver.IsNoSuchLabel(err) || bitbucketserver.IsNotFound(err) {
// treat as empty
return ids, nil
}
Expand Down

0 comments on commit b3322ae

Please sign in to comment.