Commit Graph

170 Commits

Author SHA1 Message Date
Quinn Slack
dc478c82dd
chore(ci): remove Percy visual tests (#63515)
These are more frequently erroneous than helpful.

See
https://sourcegraph.slack.com/archives/C04MYFW01NV/p1719209633005499.

This eliminates a source of frustration and flakiness in pull requests
and removes a lot of code and Bazel complexity.

If we want to revive them, we can revert this commit. Note that
`client/web-sveltekit` does not use Percy, and if we want it to, we can
always revert this commit or start over from scratch if that's easier.


<!-- PR description tips:
https://www.notion.so/sourcegraph/Write-a-good-pull-request-description-610a7fd3e613496eb76f450db5a49b6e
-->

## Test plan

CI

Co-authored-by: Jean-Hadrien Chabran <jean-hadrien.chabran@sourcegraph.com>
2024-06-27 16:20:06 +02:00
William Bezuidenhout
4b4f49b853
chore(ci): remove backcompat mitigation (#62658)
ci: remove backcompat mitigation
2024-05-14 11:00:35 +01:00
William Bezuidenhout
7a06d5724c
Revert "ci: remove softfail backcompat mitigation (#62230)" (#62414)
This reverts commit 3e441fd647.
2024-05-03 08:36:10 +00:00
William Bezuidenhout
3e441fd647
ci: remove softfail backcompat mitigation (#62230) 2024-04-29 12:03:34 +02:00
William Bezuidenhout
4f2ca0b956
ci: temporary mitigation - make backcompat soft fail on exit code 1 (#61767)
make backcompat soft fail on exit status 1
2024-04-10 22:14:16 +00:00
William Bezuidenhout
2b9ddff4a0
ci: do not fetch tags on steps that do not require it (#61156)
* use deepend so that we do not fetch all history

* only fetch tags on certain steps

* add comment on why we do not use deepen

* add links
2024-03-14 17:02:10 +02:00
William Bezuidenhout
b2ae49c778
ci: let backcompat tests run on aspect workflow agents (#61103)
* let backcompat use aspect agents

Co-authored-by: James McNamara <jamesscottmcnamara@gmail.com>
2024-03-13 17:21:55 +02:00
Jean-Hadrien Chabran
9f10c1cb3d
rfc795: new release process foundations (#60962)
---------

Co-authored-by: William Bezuidenhout <william.bezuidenhout@sourcegraph.com>
2024-03-12 17:12:22 +01:00
William Bezuidenhout
7e286bdfeb
ci: bazel do - skip adding of aspect workflows (#61026)
* only upload aspect pipeline if it is not disabled

* skip aspect-workflows on bazel-do builds

* sg bazel configure
2024-03-12 13:19:32 +02:00
William Bezuidenhout
ad97b8b4ea
Reapply "ci: use aspect workflow agents (#60317)" (#60856)" (#60860)
This reverts commit 5dee69a56a.
2024-03-06 11:37:49 +02:00
William Bezuidenhout
5dee69a56a
Revert "ci: use aspect workflow agents (#60317)" (#60856)
This reverts commit 67b2c665f1.
2024-03-05 11:13:05 +00:00
William Bezuidenhout
67b2c665f1
ci: use aspect workflow agents (#60317)
* initial change to use aspect-default and remove ifs

* use rosetta bazelrc in bazel ci scripts

* use /tmp/aspect-generated.bazelrc path everywhere

change gcp project depending on queue

* restore aspect buildkite plugin
2024-03-05 12:07:47 +02:00
William Bezuidenhout
e3fe897c1d
ci: remove ancestor commit checks (#60723)
remove ancestor commit checks
2024-02-23 13:49:21 +01:00
Jean-Hadrien Chabran
b44c8da536
ci: do not clean DBs when pipeline gen job (#60566) 2024-02-15 15:45:16 +00:00
William Bezuidenhout
0eae7526c3
ci: generate different steps depending on what pipeline we're in (#60549)
* add pipeline conditional to buildkite.yaml

* split pipeline up into two groups depending on pipeline slug

* update commit we should be after

* update pipeline for upload

* update commit step key

* remove nested group

* change workflow upload step key

* fix command

* fix group name
2024-02-15 12:44:02 +02:00
Noah S-C
06262e0936
bazel: patches to allow use_default_shell_env for e2e testing (#59675)
Another step towards https://github.com/sourcegraph/sourcegraph/issues/59155, previously `bazel test //...` would error at analysis time on `//client/web/src/end-to-end:e2e` due to it attempting to perform variable substitution for env vars e.g. `"HEADLESS": "$(E2E_HEADLESS)"`, for values not defined via `--define` (we only set these explicitly in .aspect/bazelrc/ci.sourcegraph.bazelrc and some `sg` targets).

By leveraging https://bazel.build/rules/lib/builtins/actions#run.use_default_shell_env, we can allow the test to read values from `--action_env` while _also_ having explicit values set via `env` macro parameter. Previously, setting `env` macro parameter would completely shadow any `--action_env` values. 
Unfortunately, we cant use `--test_env` for this, as `js_run_binary` is an action not a test (or something like that?).

We also cant do env renaming anymore, meaning we have to drop the `E2E_` prefix for some env vars. At least one script needed some reworking to accommodate that `e2e_test.sh` 

![image](https://github.com/sourcegraph/sourcegraph/assets/18282288/133a98c6-411d-4a10-95fd-4abd42cedb24)


## Test plan

👁️ CI once again 👁️
2024-01-24 18:50:19 -08:00
William Bezuidenhout
42adee87cf
ci: cleanup hooks and clear containers on aspect (#59293)
* ci: cleanup hooks and clear containers on aspect

* fix syntax error

* use pipeline slug instead

* export postgres user in pre-exit
2024-01-04 16:15:12 +00:00
Erik Seliger
f9ac351dc3
Remove App from codebase (#59115)
Cody no longer needs it and it is obsolete now!

Since App added a non-insignificant amount of new concepts and alternative code paths, I decided to take some time and remove it from out codebase.
This PR removes ~21k lines of code. If we ever want parts of single binary (app), the redis kv alternatives, or the release pipeline for a native mac app back, we can look back at this PR and revert parts of it, but maintaining 21k lines of code and many code paths for which I had to delete a surprisingly small amount of tests justifies this move for me very well.

Technically, to some extent SG App and Cody App both still existed in the codebase, but we don't distribute either of them anymore, so IMO we shouldn't keep this weight in our code.

So.. here we go.

This should not affect any of the existing deployments, we only remove functionality that was special-cased for app.
2023-12-21 01:07:05 +01:00
William Bezuidenhout
c5d743f1de
skip pre-command hook for aspect agent queue (#57942) 2023-10-27 12:06:52 +02:00
Quinn Slack
59c82bcfb1
disable frontend code coverage tracking (#57820)
Our tracking of frontend (TypeScript) code coverage has decayed and was no longer being used. The Codecov report at https://app.codecov.io/gh/sourcegraph/sourcegraph significantly under-counts coverage, and what coverage tasks we did have were flaky in CI and relied on old libraries that have not been updated recently to keep with modern practices (such as `@storybook/addon-storyshots` only supporting Jest with `injectGlobals`).

From https://sourcegraph.slack.com/archives/C04MYFW01NV/p1698059032863009?thread_ts=1698054092.709309&cid=C04MYFW01NV, the proposal is to remove coverage tracking for now and prioritize getting tests to run really fast and smooth locally first, including upgrading our testing infra, and then reenable code coverage tracking.
2023-10-23 21:29:40 +00:00
Bolaji Olajide
f064ec1198
update reference to #discuss-dev-experience channel (#57661) 2023-10-17 10:11:23 +00:00
Quinn Slack
dc7368e7a0
remove lighthouse (frontend auditing for perf, etc.) (#57406)
We were not using [Lighthouse](https://developer.chrome.com/docs/lighthouse/overview/) reports, but they were running (asynchronously) on each build, which caused occasional build flakes and added a moderate amount of complexity to our CI.

The reports do have value in theory, but we were not actually consulting the reports.
2023-10-06 06:46:09 +00:00
Erik Seliger
58fe87f6b5
enterprise: Move last directory out (#57392)
This is the end of the PR train to remove the enterprise directory from out repo since we have consolidated to use a single license.

Bye rough code split :)
2023-10-05 20:15:40 +00:00
William Bezuidenhout
1d2d118353
bazel: move backcompat tests to their own pipeline (#55489)
* add backcompat yaml

* mv bazel-backcompat.sh

* remove bazel files and move warning in backcompat

* ignore flakes json in prettier

* remove backcompat stuff from workspace

* remove left over comments

* fix wording

* shellcheck
2023-08-22 16:57:25 +00:00
Jean-Hadrien Chabran
5847488939
ci: report dangling containers on Sentry (#56060) 2023-08-21 16:31:03 +00:00
Dave Try
f7ed60bf61
ci: use array for running containers in preexit (#56059)
* grab some more verbose logging for exit hook

* use array
2023-08-21 10:28:31 -05:00
Dave Try
9fcc418819
ci: add check for dangling docker containers (#55683)
debug: add check to see if we have dangling docker containers from
previous tests

related to https://github.com/sourcegraph/sourcegraph/issues/55661

## Test plan

CI
2023-08-09 19:39:44 +02:00
Dave Try
89ff715de7
ci: fix pre-exit hook (#55296)
Fixes the error

```
/buildkite/builds/buildkite-agent-bazel-85dff99848-7lgqm-1/sourcegraph/sourcegraph/.buildkite/hooks/pre-exit: line 19: 0: command not found
--
  | /buildkite/builds/buildkite-agent-bazel-85dff99848-7lgqm-1/sourcegraph/sourcegraph/.buildkite/hooks/pre-exit: line 22: -gt: command not found
```
## Test plan

Check the pre-exit output on any bazel agent in this PR
2023-07-27 12:47:45 -05:00
Dave Try
aabe4ed2e1
ci: surpress pre-exit hook warnings (#54769)
Only runs the docker clean up tasks if containers or volumes are found
to stop the error messages at the end of jobs

## Test plan

Works on this feature branch in CI

---------

Co-authored-by: William Bezuidenhout <william.bezuidenhout@sourcegraph.com>
2023-07-11 18:08:56 +00:00
William Bezuidenhout
bd43215e64
ci: install asdf plugins on publish docker registery (#54085)
We normally skip install of asdf images when GROUP_KEY is `Publish
Images`, except for certains steps:

* Publish executor image in
bc0049c818

and now also Publish Docker registry image
## Test plan
BUILDKITE_GROUP_KEY="Publishimages"
BUILDKITE_STEP_KEY="packerwhitecheckmarkPublishdockerregistrymirrorimage"
.buildkite/hooks/pre-command
<!-- All pull requests REQUIRE a test plan:
https://docs.sourcegraph.com/dev/background-information/testing_principles
-->
2023-06-23 19:44:41 +00:00
Dave Try
fbc8d791b6
ci: clean all containers. clean up disk if over 85% (#53138)
Use the pre-exit hook to clean up any running containers, as well as the
disk space if it's over `85%` to ensure the following run doesn't fail


## Test plan

New commands for disk tested manually on ubuntu machine
2023-06-09 10:38:56 +02:00
William Bezuidenhout
2fb2a9e58e
app: add step for intel mac builds (#52540)
Adds intel mac builds to the release pipeline

Closes #52394

Also:
- split steps into more distinguishable groups
- ensure scripts have consistent naming
- skip install of asdf plugins / dependencies

## Test plan
 - https://buildkite.com/sourcegraph/sourcegraph-app-release/builds/1305
-
https://github.com/sourcegraph/sourcegraph/releases/tag/untagged-19720972e2aa3c849a38
<!-- All pull requests REQUIRE a test plan:
https://docs.sourcegraph.com/dev/background-information/testing_principles
-->
2023-05-29 20:21:06 +02:00
William Bezuidenhout
d2b008e1fd
app: enable updater in app bundling and generate manifest (#52318)
This enables the updater in during the tauri bundling. In particular a
signature gets generated which we need in our update manifest.
This manifest is used in conjunction with the app updater endpoint on
dotcom. The manifest is consultated to tell clients whether they can
update or not

## Test plan

[Green](https://buildkite.com/sourcegraph/sourcegraph-app-release/builds/1288#01884980-d278-433a-8e37-fb8b979be18a)
ci on `app-release/debug` branch
<!-- All pull requests REQUIRE a test plan:
https://docs.sourcegraph.com/dev/background-information/testing_principles
-->
2023-05-23 17:10:17 +00:00
William Bezuidenhout
c4a45c7af3
app: Set Github release step agent with correct syntax (#52295)
`agent` key needed a smol `s` at the end 😭 
## Test plan
Successful release on the `app-release/debug` branch:
https://buildkite.com/sourcegraph/sourcegraph-app-release/builds/1282#018847c9-1ddc-4309-ae11-2855b74e2f33
<!-- All pull requests REQUIRE a test plan:
https://docs.sourcegraph.com/dev/background-information/testing_principles
-->
2023-05-23 09:45:27 +00:00
Stephen Gutekanst
9053ffd2af
Revert "app-release: force stateless queue for github release step (#52228)" (#52275)
This reverts commit a52296cc49 - which
broke the app release pipeline:

```
$ trap 'kill -- $' INT TERM QUIT; buildkite-agent pipeline upload .buildkite/pipeline.app.yml
--
  | 2023-05-22 18:52:04 INFO   Reading pipeline config from ".buildkite/pipeline.app.yml"
  | 2023-05-22 18:52:04 INFO   Updating BUILDKITE_COMMIT to "0d43a156081ffe2fca34c912a4a575c77440c66f"
  | 2023-05-22 18:52:05 WARN   POST https://agent.buildkite.com/v3/jobs/018844cc-f041-44a4-9ceb-6863943f1473/pipelines: 422 `agent` is not a valid property on the `command` step, perhaps you meant `agents`? (Attempt 1/60 Retrying in 5s)
  | 2023-05-22 18:52:05 ERROR  Unrecoverable error, skipping retries
  | 2023-05-22 18:52:05 FATAL  Failed to upload and process pipeline: POST https://agent.buildkite.com/v3/jobs/018844cc-f041-44a4-9ceb-6863943f1473/pipelines: 422 `agent` is not a valid property on the `command` step, perhaps you meant `agents`?
  | 🚨 Error: The command exited with status 1
  | user command error: exit status 1
  |  

<br class="Apple-interchange-newline">
```

## Test plan

It worked before, so reverting.
2023-05-22 19:04:52 +00:00
William Bezuidenhout
a52296cc49
app-release: force stateless queue for github release step (#52228)
When running in a stateless agent we don't have to fetch the github
token from AWS secrets manager
## Test plan
green ci
<!-- All pull requests REQUIRE a test plan:
https://docs.sourcegraph.com/dev/background-information/testing_principles
-->
2023-05-19 15:42:17 -07:00
William Bezuidenhout
10a9525040
app: buildkite pipeline for releases (#52202)
This is mostly constrained to the `enterprise/dev/app` directory.

- [x] undo the bazel changes

- Builds the linux version on Bazel agents
- Builds arm64 version on macos
- Builds x86_64 version on macos using go - There is a fix to the bazel
scripts I have to make for this
- Bundles the linux versions on linux using Tauri
- Bundles the macos version on MacOS + Signs all the artefacts with
Apple
- Creates a GitHub release

## Future work
Currently a x86 on MacOS isn't published / bundled since we have to
install specific rust libraries for that

## Test plan

https://buildkite.com/sourcegraph/sourcegraph-app-release/builds?branch=wb%2Fapp%2Faws-macos
<!-- All pull requests REQUIRE a test plan:
https://docs.sourcegraph.com/dev/background-information/testing_principles
-->
2023-05-19 17:44:20 +00:00
William Bezuidenhout
bc0049c818
ci: install asdf deps on Publish Executor step (#51941)
`aws` is missing on `Publish Exeuctor Image` steps because the `asdf`
install step is skipped
## Test plan
```
sourcegraph on  main [$!?] via 🐹 v1.19.8 took 5s
❯ BUILDKITE_GROUP_KEY="Publishimages" BUILDKITE_STEP_KEY="packerwhitecheckmarkPublishexecutoriage" .buildkite/hooks/pre-command
~~~ Preparing asdf dependencies
publish image step: skipping asdf install

sourcegraph on  main [$!?] via 🐹 v1.19.8
❯ BUILDKITE_GROUP_KEY="Publishimages" BUILDKITE_STEP_KEY="packerwhitecheckmarkPublishexecutorimage" .buildkite/hooks/pre-command
~~~ Preparing asdf dependencies
running normal install
asdf install
fd plugin is not installed
shfmt plugin is not installed
shellcheck plugin is not installed
kubectl plugin is not installed
github-cli plugin is not installed
packer plugin is not installed
trivy plugin is not installed
kustomize plugin is not installed
awscli plugin is not installed
python plugin is not installed
rust plugin is not installed```
<!-- All pull requests REQUIRE a test plan: https://docs.sourcegraph.com/dev/background-information/testing_principles -->
2023-05-15 20:01:53 +02:00
Jean-Hadrien Chabran
911c88673e
ci: rework job labels and icons (#51772)
Based on a suggestion from @valerybugakov to make it clearer about what
was ported to Bazel or not, this reworks the jobs to make the
distinction clearer.


## Test plan

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

CI
2023-05-11 15:32:35 +02:00
Valery Bugakov
3f96298eb4
bazel: test volatile variables with Percy (#51693)
Use volatile status variables provided by stamping to inject relevant
Git information into the Percy execution process. Percy needs Git commit
and branch to create an accurate report and auto-accept changes on main.
See extensive comments in the code for implementation details.

On the high level, instead of running the Percy CLI directly from Bazel,
we wrap it into the JS script that:

1. Reads volatile status variables with Git info.
2. Creates a Percy CLI command with these variables injected.
3. Exectes the command using args received from the Bazel target.

## Test plan

1. CI
2. Locally: `bazel test //client/web/src/integration:integration-tests
--define=E2E_HEADLESS=true
--define=E2E_SOURCEGRAPH_BASE_URL="http://localhost:7080"
--define=GH_TOKEN=fake --define=XXX` — replace `XXX` with the
`PERCY_TOKEN` from our shared 1Password vault.
2023-05-11 09:20:42 +00: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
Jean-Hadrien Chabran
fd974c77a4
ci: remove unecessary post-exit hook (#51222)
Forgot to remove this previously. 

Fixes these non build failing errors at the end of a build: 

```
$ .buildkite/hooks/post-command
--
  | couldn't parse startTime of ""
  | couldn't parse startTime of ""
```

## Test plan

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

CI
2023-04-27 20:10:57 +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
Jean-Hadrien Chabran
b0af2ce0c0
ci: remove outdated ci tracing code + improve output (#51102)
The `set -x` was really messing out the output. This PR fixes it. 

I also removed along the way some ci tracing code that I forgot to drop
in my previous PR.

<img width="1161" alt="CleanShot 2023-04-25 at 18 18 32@2x"
src="https://user-images.githubusercontent.com/10151/234339839-52ef47be-4a9e-4be8-85b8-85257f164518.png">

## Test plan

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

CI
2023-04-25 16:25:38 +00:00
Jean-Hadrien Chabran
629739e4e7
Remove tracing and associated plumbing (#51001)
Buildkite now supports OTEL (see
https://buildkite.com/docs/agent/v3/tracing) so this old code is not
needed anymore.

This PR drops it, for now, as this isn't a very much used feature for
right now, especiall given how much we're focused on Bazel.

## Test plan

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

ci
2023-04-21 20:44:40 +02:00
Keegan Carruthers-Smith
1e812255aa
ci: run gen-pipeline from workspace root (#50988)
CI fails on main without this.

Test Plan: ran locally and modified gen-pipeline to confirm it prints
the correct cwd.

Co-authored-by: Jean-Hadrien Chabran <jh@chabran.fr>
2023-04-21 14:36:46 +00:00
Keegan Carruthers-Smith
2c24999c96
ci: use bazel for generate pipeline step (#50981)
Hopefully this makes this step much faster. Stole the command from
@burmudar

Test Plan: CI works for this PR
2023-04-21 13:17:15 +00:00
Valery Bugakov
6491d1838e
bazel: client e2e tests (#50330)
- Run client E2E tests in Bazel
- Fix client integration tests execution locally
- Make client integration tests work with different
`SOURCEGRAPH_BASE_URL` values
- Clean up integration tests and E2E tests logs

## Test plan

1. CI
2. `bazel test //client/web/src/integration:integration-tests`
3. `bazel test //client/web/src/end-to-end:e2e`

---------

Co-authored-by: Jason Bedard <jason@aspect.dev>
Co-authored-by: William Bezuidenhout <william.bezuidenhout@sourcegraph.com>
Co-authored-by: Jean-Hadrien Chabran <jh@chabran.fr>
Co-authored-by: davejrt <davetry@gmail.com>
2023-04-13 04:01:37 -07:00
Jean-Hadrien Chabran
aa18d8c620
ci: be more precise when tearing down test DBs (#49411)
Very small change, see code.


## Test plan

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

CI.
2023-03-16 14:46:49 +02:00