Commit Graph

87 Commits

Author SHA1 Message Date
Noah S-C
ffb1476841
chore(bazel): re-enable remote caching of Copy{File,Directory,ToDirectory} actions (#64153)
Our remote cache is more stable now, so we may be able to avail of BwoB
better again

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

## Test plan

CI

## Changelog

<!-- OPTIONAL; info at
https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c
-->
2024-07-30 16:02:11 +00:00
Noah S-C
b7dac3b808
fix(ci): only emit bazel execlog artifact for 'test' commands (#63916)
Delivery Manifest step has started to run `bazel build` commands, in them clobbering our execlog artifacts. We should only emit it for the test buildkite jobs (at least for the time being), as it currently doesnt make sense for e.g. the image push jobs which contain multiple invocations

## Test plan

CI

## Changelog
2024-07-18 15:17:12 +01:00
William Bezuidenhout
02686b74f0
update config for workflows 5.10 (#63554)
Required change for new workflows

## Test plan
CI
<!-- REQUIRED; info at
https://docs-legacy.sourcegraph.com/dev/background-information/testing_principles
-->

## Changelog

<!-- OPTIONAL; info at
https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c
-->
2024-07-01 14:35:41 +02:00
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
Noah S-C
116d9d7526
chore(ci): emit compact executon log in CI for test + build commands only (#63451)
The "Delivery Manifest" bazel commands messing stuff up again 😔 

## Test plan

CI 


## Changelog
2024-06-25 15:19:55 +01:00
Noah S-C
7a9d2b02e4
chore(ci): emit compact executon log in CI (#63420)
Second attempt at https://github.com/sourcegraph/sourcegraph/pull/61760,
we can start using these to dig into action cache misses etc

## Test plan

CI passes green


## Changelog
2024-06-21 19:50:35 +01:00
Jean-Hadrien Chabran
e880a74850
fix(local): disable bazel remote cache (#63203)
@kritzcreek reported that the remote cache we use for local build is
excruciatingly slow, to a degree waranting instantly disabling this to
avoid disrupting everyone else flow.

## Test plan

Locally tested. 

<!-- All pull requests REQUIRE a test plan:
https://docs-legacy.sourcegraph.com/dev/background-information/testing_principles
-->
2024-06-11 14:30:29 +00:00
William Bezuidenhout
224b3e5830
bazel: rules_js rc3 and remove deprecated "exclude_declarations" option (#63095)
`exclude_declarations_from_npm_packages` is not an option anymore as
from the output
```
ERROR: @aspect_rules_js//npm:exclude_declarations_from_npm_packages :: Unrecognized option: @aspect_rules_js//npm:exclude_declarations_from_npm_packages
```

Also upgraded to `rc3` while diagnosing this.

Closes https://github.com/sourcegraph/devx-support/issues/1005
## Test plan
Tested locally + CI
```
sg bazel test //internal/appliance/reconciler:reconciler_test
INFO: Invocation ID: 70da4295-36f2-43a8-a71e-9b11ae489657
WARNING: Build option --modify_execution_info has changed, discarding analysis cache (this can be expensive, see https://bazel.build/advanced/performance/iteration-speed).
INFO: Analyzed target //internal/appliance/reconciler:reconciler_test (0 packages loaded, 17313 targets configured).
INFO: Found 1 test target...
Target //internal/appliance/reconciler:reconciler_test up-to-date:
  bazel-bin/internal/appliance/reconciler/reconciler_test_/reconciler_test
Aspect @@rules_rust//rust/private:rustfmt.bzl%rustfmt_aspect of //internal/appliance/reconciler:reconciler_test up-to-date (nothing to build)
Aspect @@rules_rust//rust/private:clippy.bzl%rust_clippy_aspect of //internal/appliance/reconciler:reconciler_test up-to-date (nothing to build)
INFO: Elapsed time: 1.210s, Critical Path: 0.11s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
//internal/appliance/reconciler:reconciler_test                 (cached) PASSED in 19.2s
```

## Changelog
- remove deprecated option `exclude_declarations_from_npm_packages` from
local.bazelrc
- update to rc3 of rules_js
2024-06-05 10:33:37 +02:00
Greg Magolan
a3afa08161
chore(bazel): bump to aspect_bazel_lib 2.7.7 (#63012) 2024-05-31 23:08:52 +01:00
Greg Magolan
f7a2d5e380
bazel: bump to latest aspect_rules_js, rules_nodejs, aspect_bazel_lib, aspect_rules_ts, aspect_rules_swc (#62874) 2024-05-23 10:14:30 +02:00
James McNamara
5022b91a43
chore(localenv): disable tsc declaration files (#62680)
* try enabling flag to disable tsc declaration files

* enable flag locally

* enable flag for local dev

* remove flag
2024-05-17 10:40:14 +02:00
Noah S-C
4e02a3d862
chore: remove overridden repository cache flag from bazelrc (#62539)
Misleading, this flag is overwritten by aspect workflows rosetta

## Test plan

CI
2024-05-08 14:08:34 +00:00
Noah S-C
2519301e81
ci: don't emit bep for non-test commands (#62339)
Rebase mistake reintroduced the BEP file in `common` 🤦 b5cf7b8ab4

## Test plan

Undoing change reintroduced by mistake
2024-05-01 13:44:18 +01:00
Jean-Hadrien Chabran
71eaa813f1
chore(bzl): disable experimental flag async RC (#62248) 2024-04-29 20:03:53 +02:00
Jean-Hadrien Chabran
d6e053ab3d
chore(sg): sg bazel uses remote cache by default (unless in CI) (#62245) 2024-04-29 18:56:18 +02:00
Noah S-C
b5cf7b8ab4
ci: don't remotely cache copy{dir,file} operations (#62152) 2024-04-25 16:32:33 +02:00
Noah S-C
48349d2449
ci: only emit build event protocol file for test command (#62146)
The file from the Test step was being overwritten by aquery and other commands in the Delivery Manifest step 

## Test plan

CI on main
2024-04-24 12:47:17 +00:00
Noah S-C
8d5290f827
ci: emit Bazel BEP file (#62010)
Needed for ci-obs metrics pipeline

## Test plan

See buildkite build for this PR
2024-04-23 16:27:35 +01:00
William Bezuidenhout
3ce0d48564
ci: relax the buildifier timeout (#62013) 2024-04-18 15:02:08 +00:00
Noah S-C
201f1edc30
ci: disable emitting execution log for bazel (#61783)
Causing excessive log spam 😞 

https://github.com/bazelbuild/bazel/issues/21820

## Test plan

CI
2024-04-11 13:57:59 +01:00
Noah S-C
ed1c771318
test execution log artifact (#61760)
Likely needed as part of https://github.com/sourcegraph/sourcegraph/issues/61246, but if not, it can always be used to determine why something was a cache miss 

## Test plan

Saw new artifact in CI
2024-04-11 12:04:53 +01:00
William Bezuidenhout
8ff72b9db0
ci: set timeouts - gazelle 5 min and buildifier to 2 min (#61757) 2024-04-10 14:03:32 +00:00
Bolaji Olajide
ae34b1df84
release: drop legacy release tooling (#61220)
purge legacy tooling
2024-04-09 14:29:35 -05:00
Noah S-C
e143c2a0d1
msp: look in //... for msp-deliverables, not only //cmd/... (#61550)
Got joshed, feelsbad

## Test plan

```
$ bazel query 'attr(tags, "msp-deliverable", //...)'
//cmd/msp-example:msp_deploy
//dev/build-tracker:msp_deploy
```
2024-04-03 16:00:22 +01:00
James Cotter
b19a589f4b
aspect workflows: stamp delivery targets (#61480) 2024-03-29 15:22:08 +00:00
William Bezuidenhout
1831b95772
ci: fix chromatic and add bazelrc flag (#61403)
fix chromatic and add bazelrc flag
2024-03-26 20:10:28 +02:00
Noah S-C
75947b347f
bazel: refactor percy mocha tests to js_test instead of js_run_binary + build_test (#60983)
`bazel build` on percy mocha targets (such as //client/web/src/integration:integration-tests) no longer result in actually running the test!

Originally, we used `js_run_binary` with `build_test` as `js_test` doesnt support stamping, and we need to be able to read volatile variables for percy. 
Then, we worked around https://github.com/bazelbuild/bazel/issues/16231 in https://github.com/sourcegraph/sourcegraph/pull/58505 by not explicitly depending on the stamp variables, but exploiting a bit of a hack to read them anyways (will this work with RBE?)
Now, given that we're not explicitly stamping and still using the hack, we can use `js_test` instead, to avoid having the tests run as part of `bazel build`, instead only when we run `bazel test` (as is good 😌)

It is apparently possible to work around https://github.com/bazelbuild/bazel/issues/16231 when using disk/remote caches, but only for local builds (so no remote builds) according to [the following comment](https://github.com/bazelbuild/bazel/issues/16231#issuecomment-1772835555), but we would still need: 
1. `js_test` to support stamping and
2. this workaround to also apply to remote execution (as we're considering that once its supported in Aspect Workflows)

todo: update doc/dev/background-information/bazel/web_overview.md in new docs repo

## Test plan

CI 🎉
2024-03-26 10:58:20 +00:00
Jean-Hadrien Chabran
69cba9cf41
feat/ci: when detecting changes affecting the generated docs, push them to docs repo as a PR (#61255) 2024-03-21 09:20:47 +00:00
James Cotter
5580a33056
aspect/delivery: msp-example (#61244) 2024-03-19 15:04:48 +00:00
Greg Magolan
232a1bcaae
ci: remove include_eternal_tests as it is no longer needed in Aspect Workflows 5.9.18 (#60901)
* ci: remove include_eternal_tests as it is no longer needed in Aspect Workflows 5.9.18

* test marking a test as eternal still gets executed

---------

Co-authored-by: William Bezuidenhout <william.bezuidenhout@sourcegraph.com>
2024-03-07 14:28:03 +02:00
Jean-Hadrien Chabran
9e6e4e1bc9
ci: label the integration tests properly (#60898)
* ci: label the integration tests properly

* also depend on integration test step in aspect workflows

---------

Co-authored-by: William Bezuidenhout <william.bezuidenhout@sourcegraph.com>
2024-03-06 16:42:19 +00:00
Greg Magolan
bfc6e404ee
ci: disable Workflows runner observabilty to resolve slow post-task agent health check (#60892) 2024-03-06 07:34:44 -08:00
William Bezuidenhout
edaa63120b
ci: disable posting of annotations by aspect buildkite plugin (#60888)
* disable posting of annotations by aspect buildkite plugin

* use v0.0.10-alpha version
2024-03-06 16:35:53 +02:00
Noah S-C
15146c770a
bump aspect bazel-lib to 1.40.3 (#60869)
Allows us to drop some patches 🎉 

https://sourcegraph.slack.com/archives/C04BWU1519D/p1709664254285619

## Test plan

CI
2024-03-06 13:07:24 +00:00
Greg Magolan
c725bfdf3a
ci: use .aspect/workflows/bazelrc for Aspect Workflows flags (#60866) 2024-03-05 17:16:47 +00:00
Jean-Hadrien Chabran
0d24f22744
aw: use two different jobs for e2e and normal testing (#60356)
* Run things in sep jobs

* Update .aspect/workflows/config.yaml

Co-authored-by: William Bezuidenhout <william.bezuidenhout@sourcegraph.com>

---------

Co-authored-by: William Bezuidenhout <william.bezuidenhout@sourcegraph.com>
2024-02-09 10:32:45 +00:00
Anton Sviridov
3bc52d0a24
Evaluation results snasphots (#58500)
Add infrastructure for snapshotting evaluation results created from indexing a sample project.
This PR adds a Java project (testdata/java), but extending to more languages should be trivial.
Most complex part of the build is creating SCIP indexes from test repositories using Bazel.

Refactoring and code changes:

    We don't really have any evaluation options yet, so no need to pass them around. What we do have is options that affect output
    Extract symbol formatter and path formatter into separate objects - we don't need to pass entire evaluator around if all we care about is consistent interning of symbols
    Explicitly pass around a writable interface instead of throwing everything into stderr
    Add ability to disable color output
    Make evaluation summary serializable
2024-01-26 15:14:44 +00:00
Greg Magolan
c844eaf295
build: resolved deprecation warning for aspect config.yaml tasks style (#59849) 2024-01-25 09:42:38 -08: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
de1302ac2b
bazel: remove explicit running of backend_integration_test (#59671)
they are executed automatically by bazel as part of //...
2024-01-17 16:13:33 +00:00
Jean-Hadrien Chabran
928982e0ad
bzl: add additional flags for profile for AW (#59658) 2024-01-17 10:49:15 +01:00
Erik Seliger
7e9ba142ad
Fix bazel config for backend integration tests (#59526)
Renamed this job when we got rid of HTTP because that's the only version we need to run now.

## Test plan

CI will fail if the new name is still wrong.
2024-01-11 19:39:00 +00:00
Greg Magolan
17cff22ecf
build: use small low-cost Aspect Workflows runners for buildifier, gazelle & finalization steps (#59204) 2023-12-22 10:45:15 +00:00
William Bezuidenhout
790266de08
bazel: set retry flakes to 3 (#59078)
* bazel: set retry flakes to 3

* set it in the correct bazelrc
2023-12-18 16:58:53 +02:00
Greg Magolan
b54884b136
aspect: work-around flags issue with .aspect/workflows/bazelrc (#58683) 2023-11-30 17:41:54 +00:00
Greg Magolan
afc8577b6f
build: add buildifier check to Aspect Workflows (#58566)
* build: add buildifier check to Aspect Workflows

* exclude squirrel/test_repos/starlark

* buildifier

---------

Co-authored-by: William Bezuidenhout <william.bezuidenhout@sourcegraph.com>
2023-11-27 14:58:01 +02:00
Greg Magolan
9b8d25a5fb
build: add gazelle checks to Aspect Workflows (#58568)
Co-authored-by: William Bezuidenhout <william.bezuidenhout@sourcegraph.com>
2023-11-27 11:50:46 +02:00
Greg Magolan
901f014a34
build: fix CI bazelrc settings for Aspect Workflows warming (#58550) 2023-11-24 14:31:26 +02:00
William Bezuidenhout
d9c1d287c8
aspect workflows: add initial aspect workflow yaml (#56569)
* add initial aspect workflow yaml
- try reading docker config env var
- bump both timers
- bump grpc test timout to long
- skip additional perforce test and run all tests
- bump timeouts
- more timeout bumps and skip p4 test
- bump doc:test timeout
- bump e2e_test timeout
- bump database/connections/live timeout
- tag integration tests as exclusive

* add recommended bazelrc in workflows to speed up cold builds

* disable experimental_fetch_all_coverage_outputs

* port changes from https://github.com/sourcegraph/sourcegraph/compare/aspect-trial/wb-add-initial-config...aspect-trial/wb-add-initial-config-greg

* bazel configure

* add //:postcss_config_js as data target to client/web

* remove postcss added in debug

* use node-fetch and only test codeintellify

* use testing fetch.js setup

* fix syntax in testSetup

* various fixes

revert timeout bump on repository test
re-enable git p4 test
add testing from shared deps
bazel configure

* update comments on skipped tests

* restore `is_percy_enabled` for mocha_test

* slightly increase repo cloning wait

* use process.cwd instead of __dirname

* set sizing to moderate as well for embeddings

* remove setting CI in workflows yaml

* fix sizing

* workflow yaml tweaks and bazelrc tweaks

* make bazelrc consistent with what was in workflow yaml

---------

Co-authored-by: Jean-Hadrien Chabran <jh@chabran.fr>
Co-authored-by: Greg Magolan <greg@aspect.dev>
2023-11-24 11:52:17 +02:00
Greg Magolan
706f077217
build(bazel): upgrade to lastest 1.x aspect-bazel-lib 1.38.1 (#58504)
Co-authored-by: William Bezuidenhout <william.bezuidenhout@sourcegraph.com>
2023-11-23 12:19:46 +02:00