Commit Graph

74 Commits

Author SHA1 Message Date
Varun Gandhi
2955bb6cfb
chore: Change errors.HasType to respect multi-errors (#63024)
With this patch, the `errors.HasType` API behaves similar to `Is` and `As`,
where it checks the full error tree instead of just checking a linearized version
of it, as cockroachdb/errors's `HasType` implementation does not respect
multi-errors.

As a consequence, a bunch of relationships between HasType and Is/As that
you'd intuitively expect to hold are now true; see changes to `invariants_test.go`.
2024-06-06 13:02:14 +00:00
Noah S-C
9b6ba7741e
bazel: transcribe test ownership to bazel tags (#62664) 2024-05-16 15:51:16 +01:00
Jean-Hadrien Chabran
3d36d34b3d
ci: re-enable race detection (#52776)
The previous approach to enable race detection was too radical and
accidently led to build our binaries with the race flage enabled, which
caused issues when building images down the line.

This happened because putting a `test --something` in bazelrc also sets
it on `build` which is absolutely not what we wanted. Usually folks get
this one working by having a `--stamp` config setting that fixes this
when releasing binaries, which we don't at this stage, as we're still
learning Bazel.

Luckily, this was caught swiftly. The current approach insteads takes a
more granular approach, which makes the `go_test` rule uses our own
variant, which injects the `race = "on"` attribute, but only on
`go_test`.


## Test plan

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

CI, being a main-dry-run, this will cover the container building jobs,
which were the ones failing.

---------

Co-authored-by: Alex Ostrikov <alex.ostrikov@sourcegraph.com>
2023-06-05 20:41:47 +02:00
Dave Try
321e0e9d01
ci: enable bazel builds for docker images (#51241)
Reintroduces the same changes as
https://github.com/sourcegraph/sourcegraph/pull/51104 minus
syntax-highlighter which we're unable to compile with the right
toolchain at the moment.

Tested as a full main-dry-run, as well as running the stack with compose
and checking indexing and syntax-highlighting.

Executors are also built correctly. 


## Test plan

CI + manual test via compose.

---------

Co-authored-by: Jean-Hadrien Chabran <jh@chabran.fr>
2023-04-28 10:41:13 +02:00
Dave Try
c5d638bfda
ci: revert bazel builds (#51190)
revert bazel changes due to errors with syntax-highlighter

## Test plan

CI
2023-04-26 23:19:36 +00:00
Dave Try
5b198be1b4
bazel: build all binaries with bazel for inclusion in docker images (#51104)
Build docker images with bazel compiled binaries

---------

Co-authored-by: Jean-Hadrien Chabran <jh@chabran.fr>
2023-04-26 14:18:05 -05:00
Vincent
9a2904203c
dep: resolve CVE-2023-0464 in base image 2/2 (#50261)
This PR updates the base images for our docker files to a version of
Alpine without vulnerabilities.

## Test plan
Pipelines from https://github.com/sourcegraph/sourcegraph/pull/50248
indicate that there are no vulnerabilities in the base image.

<!-- All pull requests REQUIRE a test plan:
https://docs.sourcegraph.com/dev/background-information/testing_principles
-->
2023-04-02 18:24:34 +02:00
Vincent
ee981a6c2c
dep: use new docker base (#49706)
Use the new docker image as the base image for our images. This is uses
the newly released `curl` version.

## Test plan
- [x] ci tests

<!-- All pull requests REQUIRE a test plan:
https://docs.sourcegraph.com/dev/background-information/testing_principles
-->
2023-03-20 18:15:21 +01:00
Dave Try
2b8fa079f0
bazel: fix buf files (#49444)
fix protoc-gen-go version
2023-03-15 20:21:38 +00:00
Dave Try
293385d5dd
bazel: update timeouts to suppress warnings (#49399)
Updates all of the BUILD fields with timeouts to suppress warnings and
reduce log spam.


## Test plan

Green CI
2023-03-15 15:04:16 +02:00
Vincent
b3ba5ec9b4
Use new base image with curl from edge/main (#48144)
Use latest `curl` in our base-images
2023-02-23 19:40:07 +00:00
Vincent
e4fe8cf9c2
Resolve SSL issues in containers (#48042)
Replace the old base image with the new updated one. Resolving the SSL
issues in new container builds.
2023-02-22 14:34:32 +00:00
Vincent
ef114ac72b
Use newer alpine base-image (#47265) 2023-02-01 14:16:49 +00:00
Jean-Hadrien Chabran
bc5490c4bb
bazel: introduce build files for Go (#46770) 2023-01-23 14:00:01 +01:00
Vincent
61d5544660
Use new alpine base image (#45937) 2022-12-22 19:57:05 +01:00
Keegan Carruthers-Smith
f885c53472
all: update alpine image (#43655)
This updates the alpine image we use to the one built in 84d1e240bb.
This is to update libxml2 for CVE-2022-40303 CVE-2022-40304.

Test Plan: CI
2022-10-31 10:35:37 +02:00
Keegan Carruthers-Smith
db6c4cd841
all: update Dockerfile to use latest alpine-3.14 (#42259)
We updated sourcegraph/alpine-3.14 today in 3b3879b9 to remove a bunch
of CVEs in bind-tools. This commit makes it so we use the new image.

Test Plan: CI works and has far less security reports.
2022-09-28 20:05:50 +00:00
Andre Eleuterio
1a2c0f5f2b
Update alpine consumers (#40279)
Update base alpine images
2022-08-11 17:03:24 -03:00
Andre Eleuterio
7c8315ca77
Bump alpine base image (#38423)
* Bump curl version

* Update base alpine image

* Bump base alpine images
2022-07-07 13:01:37 -03:00
Andre Eleuterio
46f57624bd
Update base images (#37132)
* Update migrator base image

* upgrade images

* lint

* add lint skips
2022-06-14 00:49:53 +02:00
Keegan Carruthers-Smith
18f487ccaa
all: use any instead of interface{} (#35102)
Now that we require go1.18, we can use a builtin type alias for
"interface{}": "any". I've updated all code except lib, which can be
imported by external modules. That is currently pinned at go1.16.
Additionally I had to rerun generate since rewriting generated go code
will fail CI.

  find -name '*.go' | xargs gofmt -s -r 'interface{} -> any' -w
  git checkout lib
  go generate ./...

Test Plan: CI will exercise that the code still compiles. Otherwise this
is a noop.
2022-05-09 10:59:39 +02:00
Keegan Carruthers-Smith
fa6a244424
all: use alpine-3.14 (#34508)
We have a 3.14 image available, but when we introduced it we ran into problems
using it. This updates all images to use the newer version of alpine.

  ruplacer --go \
    sourcegraph/alpine-3.12:142406_2022-04-14_8836ac3499f4@sha256:4681a48d1fb9a73fef1b540c08b3411f797351bbeda749f5dca21213a1e71526 \
    sourcegraph/alpine-3.14:142406_2022-04-14_8836ac3499f4@sha256:2a2d1cbaec78882661fe1aa5b0a4af0c23a37be2ea9ff8aadc2da5b80852c233

I also had to pin postgresql in the server image since we can't upgrade it
otherwise customer upgrades fail (incompatible on disk data). Additionally we
had to include libstc++ and libgcc for tree sitter.

Risks: I am relying on our CI to catch problems with this upgrade. The main
risks here are us not testing things which exercise non-go binaries that rely
on shared libraries. What comes to mind is things like p4 and tree-sitter, I
am unsure if they get properly exercised. However, I think now is a good time
to land a change like this since we have a lot of time until branch cut.

Test Plan: main dry run on CI to test docker image building and integration
testing.
2022-05-04 11:41:54 +02:00
Ryan Slade
dd4c805e5b
Replace os.MkdirTemp in tests with t.TempDir() (#34590)
That way we don't need to worry about cleaning up the temp directory ourselves.
2022-04-27 16:08:29 +00:00
Andre Eleuterio
d7f2d1dce0
Update base alpine images (#33938)
* Upgrade base alpine

* Upgrade base alpine 3.14
2022-04-14 17:37:12 -03:00
Kevin Wojkovich
938f4497bf
security: patch openssl libs against CVE 2022-0778 (#32720)
* security: patch openssl libs against CVE 2022-0778

* docker: patch alpine-3.12 dependant images

* docker: patch alpine-3.14 dependant images

* docker: update libxslt for cve-2021-30560 fix

* docker: patch redis images against CVE-2022-0778

* fix typo
2022-03-17 09:15:07 -05:00
Kevin Wojkovich
dc15c520d9
docker: update alpine base image (#32622)
* docker: update alpine base image

* minio: update to latest version
2022-03-16 06:35:07 -05:00
Thorsten Ball
8d3e231322
golangci-lint: enable unparam linter (#31856)
Team work makes the linter dream work.

Co-authored-by: Varun Gandhi <varun.gandhi@sourcegraph.com>
2022-02-28 15:31:44 +01:00
Eric Fritz
7148009913
errors: Introduce internal package (#30558) 2022-02-07 15:03:45 +00:00
Robert Lin
9233e2cd9b
images: update dependencies to always use >= (#29493)
Alpine packages only keep the most recent few releases, with older releases being dropped on a regular basis. We enforce versions, it seems, mostly to ensure the inclusion of particular security patches. Since not upgrading will only break our builds, and when we run into issues we just upgrade anyway, we should just only ever pin minimum versions.

To make this the new standard, also adds a hadolint.yaml to disable DL3018 by default
2022-01-06 15:54:09 -08:00
Stefan Hengl
efde103cd9
docker: bump alpine to 3.12.9 (#28790)
This bumps our alpine base image from 3.12.8 to 3.12.9.
2021-12-09 18:15:13 +01:00
davejrt
88414525e3
update alpine tags (#27528)
* update image tag with latest internal alpine build

* patch cadvisor image

* patch codeinsight-db image
2021-11-12 15:29:16 -05:00
davejrt
dbac772e1a
Revert "update to latest internal alpine image (#27519)" (#27527)
This reverts commit 008094b028.
2021-11-12 17:59:53 +00:00
davejrt
008094b028
update to latest internal alpine image (#27519) 2021-11-12 11:31:07 -05:00
Geoffrey Gilmore
0c0e07b985
docker images: update version of base alpine to one that has wget (#26823) 2021-10-29 00:14:01 +00:00
Erik Seliger
47a0340d78
Release arm versions of src-expose (#26265)
No customer asked for these, but I figured it can't hurt. Also setting the GOARCH explicitly makes it safer that the amd64 labeled binaries actually are amd64.
2021-10-19 15:11:36 +02:00
Geoffrey Gilmore
21220c5653
update sourcegraph/alpine tag for all images (#25912) 2021-10-12 15:54:38 -07:00
Stefan Hengl
c61b0f1a7b
all: /bin/bash -> /usr/bin/env bash (#23673)
I ran into issues setting up Sourcegraph on NixOS, because NixOS, like
some other distros, doesn't have a /bin/bash. We already use /usr/bin/env
in many of our scripts, so this improves consistency, too.
2021-08-06 12:02:43 +02:00
Eric Fritz
abdf10d285
dx: Vet use of errors (#22704) 2021-07-12 19:51:38 +00:00
Eric Fritz
07a025836d
dx: Use cockroachdb/errors over stdlib errors (#22684) 2021-07-08 14:55:34 -05:00
Geoffrey Gilmore
33b68efa6f
Dockerfiles: switch to use pinned sourcegraph/alpine-3.12 (#22077) 2021-06-14 21:09:16 +00:00
Indradhanush Gupta
a1075bf6b8
all: Replace github.com/pkg/errors with github.com/cockroachdb/errors (#21684)
In this commit, along with moving to
github.com/cockroachdb/errors, we update a few tests and some
error checks in non-test code.

List of files that have code changes apart from changes in the
error package import:

    enterprise/internal/batches/sources/gitlab.go
    enterprise/internal/batches/sources/gitlab_test.go
    internal/conf/client.go
    internal/store/store_test.go

Co-authored-by: ᴜɴᴋɴᴡᴏɴ <joe@sourcegraph.com>
2021-06-11 13:49:21 +05:30
Ryan Slade
ef76c4a285
chore: Deprecate usage of ioutil package (#21796)
The package was deprecated in Go 1.16:
https://golang.org/doc/go1.16#ioutil

A CI check was also added so that we don't import it again in the future.
2021-06-07 14:33:02 +02:00
Andre Eleuterio
2c1f77eb56
Update sourcegraph/alpine base images to latest (#20705)
Co-authored-by: Sourcegraph <batch-changes@sourcegraph.com>
2021-05-06 14:10:37 -03:00
Stephen Gutekanst
9137c3a57b
all: update alpine 3.10 -> 3.12 (#13248)
* all: update alpine 3.10 -> 3.12

* Update cmd/frontend/Dockerfile
2020-08-21 16:29:48 -07:00
Keegan Carruthers-Smith
b773625e95
dev: support switching our default branch to main (#11453)
This mostly updates our dev CI/helpers which hardcoded master to instead
hardcode main. In the case of CI we treat both main and master as the
default branch.
2020-08-05 09:44:51 +02:00
Keegan Carruthers-Smith
d0d94c904a
src-expose: disable background updates in tests (#12361)
We could complicate the design of Serve such that we wait for background
updates to stop. However, this would be for the benefit of tests
only. Instead we just disable background updates in tests.
2020-07-21 10:54:21 +02:00
Nick Snyder
26456f6ed6
Disable TestIgnoreGitSubmodules because it is flaky (#12352) 2020-07-21 08:30:51 +02:00
Keegan Carruthers-Smith
08e13f12ca
src-expose: avoid git update-server-info in request path (#12342)
We now only run git update-server-info if a repository has not been
configured.

This change exposed a bug in our hook setting being incorrect. This wasn't
visible before since we would always run update-server-info when listing
repos.
2020-07-20 22:21:00 +02:00
Keegan Carruthers-Smith
99b661b5b7
src-expose: debug log on serve if verbose (#11735)
Debug logs for now contain which directories we search which are not
repository roots. This will help debug performance issues where a
customer may unintentionally be crawling a very large tree.
2020-06-26 11:19:09 +02:00
Keegan Carruthers-Smith
37927f7ff3
src-expose: clearer warning log message (#11443)
If you see this log message you may think something is broken. We still
want to show it because it may contain useful information if a setup is
misconfigured.
2020-06-12 07:58:56 +02:00