Commit Graph

24 Commits

Author SHA1 Message Date
Noah S-C
9b6ba7741e
bazel: transcribe test ownership to bazel tags (#62664) 2024-05-16 15:51:16 +01:00
Petri-Johan Last
0b5e7fd490
Replace all traditional for-loops (#60988) 2024-03-11 16:05:47 +02:00
William Bezuidenhout
1ae6cc6bfd
logger: update log lib and remove use of description (#57690)
* log: remove use of description paramter in Scoped

* temporarily point to sglog branch

* bazel configure + gazelle

* remove additional use of description param

* use latest versions of zoekt,log,mountinfo

* go.mod
2023-10-18 17:29:08 +02:00
Petri-Johan Last
10dca65499
[chore] Use consistent go-github versioning (#57391) 2023-10-06 10:48:18 +02:00
Petri-Johan Last
7f90642849
[github app] Add GitHub App authenticators (#50963) 2023-04-24 09:05:50 +02:00
Jean-Hadrien Chabran
bc6a791710
bazel: fix remaining backend tests (#47961)
This PR fixes the last round of backend tests that are getting in the
way.

While most fixes are pertaining to adapting the code to deal with the
sandbox, or adjusting targets in some cases, we had to ignore the tests
from the database stitch migration (see
123cb55005)
(cc @efritz) because they are making strong assumptions toward running
inside the Sourcegraph repository, which is kinda non trivial to adapt.

Another one, albeit non consequential is the disabling of some tests
peforming external requests, which I think should be deleted anyway
(c83d8ebba8)

Fix https://github.com/sourcegraph/sourcegraph/issues/46837
Fix https://github.com/sourcegraph/sourcegraph/issues/46856
Fix https://github.com/sourcegraph/sourcegraph/issues/46862
Fix https://github.com/sourcegraph/sourcegraph/issues/46864
Fix https://github.com/sourcegraph/sourcegraph/issues/46833
Fix https://github.com/sourcegraph/sourcegraph/issues/46835
Fix https://github.com/sourcegraph/sourcegraph/issues/46836
Fix https://github.com/sourcegraph/sourcegraph/issues/46847
Fix https://github.com/sourcegraph/sourcegraph/issues/46838
Fix https://github.com/sourcegraph/sourcegraph/issues/46843
Fix https://github.com/sourcegraph/sourcegraph/issues/46845
Fix https://github.com/sourcegraph/sourcegraph/issues/46849
Fix https://github.com/sourcegraph/sourcegraph/issues/46851
Fix https://github.com/sourcegraph/sourcegraph/issues/46855
Fix https://github.com/sourcegraph/sourcegraph/issues/46857
Fix https://github.com/sourcegraph/sourcegraph/issues/46858
Fix https://github.com/sourcegraph/sourcegraph/issues/46859
Fix https://github.com/sourcegraph/sourcegraph/issues/46861
Fix https://github.com/sourcegraph/sourcegraph/issues/46863
Fix https://github.com/sourcegraph/sourcegraph/issues/46865
Fix https://github.com/sourcegraph/sourcegraph/issues/46867
Fix https://github.com/sourcegraph/sourcegraph/issues/46853

## Test plan

<!-- All pull requests REQUIRE a test plan:
https://docs.sourcegraph.com/dev/background-information/testing_principles
-->

Ran locally with bazel.

---------

Co-authored-by: davejrt <davetry@gmail.com>
2023-03-01 17:03:01 +00:00
Camden Cheek
275d8638f3
Backend: replace lib/group with sourcegraph/conc (#48162)
This replaces `lib/group` with `sourcegraph/conc`, which is its
spiritual successor.

## Test plan

Existing tests. `conc` itself is extremely well tested. The APIs of the
two packages are nearly identical since `conc` is based off `lib/group`.
The only significant change is that calling `Wait()` on a pool multiple
times is an error, so I fixed the couple places we do that.
2023-02-24 14:35:54 -07:00
David Veszelovszki
f23537a669
Housekeeping: Rename variables to avoid collisions with packages (#47179) 2023-01-31 16:28:43 +01:00
Jean-Hadrien Chabran
bc5490c4bb
bazel: introduce build files for Go (#46770) 2023-01-23 14:00:01 +01:00
William Bezuidenhout
1d331cd9dd
scaletesitng: respect limit when listing repos (#46211) 2023-01-10 19:14:58 +01:00
William Bezuidenhout
be14f4fbc7
scaletesting: use config path in bitbucket copy (#46220)
* extract project key and name from repo name

* use config path if repo name in unknown format
2023-01-09 10:39:30 +02:00
Sander Ginn
00fa3c4b23
scaletesting: codehostcopy: retryable improvements (#45987)
* Break on successful git push in retryable

* Check for 502s in retryable push

* Make GitLab repo create retryable on server errors

* return error only if project is `nil` when creating gitlab repo
2022-12-28 14:25:14 +00:00
Sander Ginn
80556ba0da
scaletesting: codehostcopy: GitLab tweaks, concurrency bump, reuse origin (#45790)
* Fetch existing GitLab project on error

* remove logger from gitlab again

* Revert save repo statement to original formatting?

* Bumps concurrency

* Make maxConcurrency a config setting;

* sets new origin url instead of adding new remote
2022-12-21 14:03:13 +00:00
William Bezuidenhout
02180ef177
scaletesting: create code hosts and add cmd (#43508)
* scaletesting: create code hosts and add cmd

- create from/destination code host based on kind
- add list command to from config
- fix big in dup repos for bitbucket

* Apply suggestions from code review

* add comments and fix block output stats

* scaletesting: fetch a repo if it already exists

* set basic auth on clone urls for bitbucket

* change separator

* set the git clone dir

* bitbucket toGitURL needs to use the token

* always use the basic auth client for bitbucket

* add mirror flag for git

* cleared failed status after successful push

* add force for pushes

* Update dev/scaletesting/codehostcopy/github.go

Co-authored-by: Jean-Hadrien Chabran <jh@chabran.fr>

* Update dev/scaletesting/codehostcopy/gitlab.go

Co-authored-by: Jean-Hadrien Chabran <jh@chabran.fr>

* fix comments

* alias cue errors package in favor of our errors

* implement new interface requirements

* ensure github code host is also created

* satisfy interface for gitlab

Co-authored-by: Jean-Hadrien Chabran <jh@chabran.fr>
2022-12-16 17:16:30 +00:00
Sander Ginn
16fe217b2b
scaletesting: codehostcopy: use iterator pattern to pull and push repos concurrently for GHE as source (#45606)
* Stubs iterator on `github`

* Make `github.ListRepos` a paginated func

* Fix type signatures

* Load repos iteratively

* Concurrently fetch and create repos

* Some bugfixes. Total private owned repos returned from GH is not correct so not totally working

* Adds field to config for total repo count

* Fix pagination

* Adds sigterm handler

* Make chan buffered

* Accidentally checked in binary -_-

* Refactor Iterator into interface

* Ignore duplicate repo errors

* rename `totalRepos`

* Abstracts away pagination from `runner`

* Add comment to config

* Removes `ListRepos` from `CodeHostSource` interface
2022-12-14 11:13:14 +01:00
Jean-Hadrien Chabran
84f41a52ca
sct: fix error handling + logs in bitbucket (#45321) 2022-12-07 15:10:56 +01:00
Jean-Hadrien Chabran
c31f4a56c8
lint: re-enable depguard in golangci-lint + fix all errors (#45270) 2022-12-06 18:16:04 +01:00
William Bezuidenhout
1b664211f8
scaletesting: Allow transfering of repos with ssh (#44059)
* add ssh key handling to codehostcopy

* add some comments

* fix import

* Update dev/scaletesting/codehostcopy/github.go

* Update dev/scaletesting/codehostcopy/runner.go

Co-authored-by: Jean-Hadrien Chabran <jh@chabran.fr>

* fix var name for destOpts

Co-authored-by: Jean-Hadrien Chabran <jh@chabran.fr>
2022-11-10 14:12:47 +00:00
Jean-Hadrien Chabran
18474e84e4
sct: enable to copy user repos instead of just orgs (#43739)
Co-authored-by: William Bezuidenhout <william.bezuidenhout@sourcegraph.com>
2022-11-04 17:01:39 +00:00
William Bezuidenhout
736a5626cd
go + golangci: update to go to 1.19.3 and golanci to 1.50.1 (#43747)
* upgrade to go 1.19.3

* upgrade golangci-lint 1.50.1

* disable unused and unparam lints

* Fix all the lint errors

Co-authored-by: Jean-Hadrien Chabran <jh@chabran.fr>
Co-authored-by: Keegan Carruthers-Smith <keegan.csmith@gmail.com>
2022-11-02 15:08:25 +02:00
Bolaji Olajide
bb801b94e6
Run Prettier (#43525)
prettier
2022-10-27 09:02:53 +00:00
Jean-Hadrien Chabran
918f54d37d
scaletesting scripts: extract state into its own package (#43357) 2022-10-26 16:21:50 +02:00
William Bezuidenhout
5f2febc614
scaletesting: add bitbucket client for codehost copy (#43343)
* add bitbucket client for use in codehostcopy

* rework bitbucket client to return error

* update bitbucket client to use Token based auth

* Update dev/scaletesting/codehostcopy/main.go

Co-authored-by: Jean-Hadrien Chabran <jh@chabran.fr>
2022-10-26 14:53:23 +02:00
Jean-Hadrien Chabran
1fb74a3b66
Add a script to copy repositories from one codehost to another (#43349) 2022-10-24 17:12:00 +02:00