Commit Graph

14 Commits

Author SHA1 Message Date
Erik Seliger
c917330d6b
authz: Drop requirement for installing authz providers in every service (#63743)
This is a register call that is easy to forget. When forgotten, all queries against the repo store will block forever.

In addition, this adds a hard-dependency on conf to every services startup, plus a busy loop. With multi-tenant, this will not work great because authz providers would be a global, and we instead want most things to be ephemeral so they're per-provider. This is a step toward that, but doesn't yet remove the providers global variable.

Good news, it turns out that we don't actually need to register the providers in every service! The reason they were required was to check if zero providers are configured, or if authzbypass mode is enabled.

Authz bypass mode is usually ON, except when there are problems with the authz providers, meaning some authz providers might not be able to sync permissions. Bypassing of permissions is only ever happening if there are ALSO zero providers configured.

So this is basically an optimization for the case where an instance has zero authz configured so that the SQL queries are a bit simpler. This also helps in tests because with bypass mode on and no providers configured, authz enforcement is effectively off in the repo store.
This makes it so that in tests we need to do slightly more work, but also makes for a more realistic test vs at runtime setup. Also, it's highly recommended to use mocks for DB wherever possible in more high-level components to keep tests fast.

To never have a scenario where we accidentally mess up here and enable bypass mode erroneously, this PR drops that entirely. Authz is always enforced, but when a code host connection is unrestricted (i.e., will not spawn a provider) the repos are still visible, so this should be no change over before.

## Test plan

The stack starts and works, and all CI tests are still passing. Code review should help as well.
2024-07-31 01:23:34 +02:00
Varun Gandhi
e4bb0b5ce6
chore: Remove client construction from SignUp/In funcs (#62789)
These functions are used in test code, which makes it tricker to
pass in loggers for checking requests and responses. Instead, make
the API method-based. This introduces slightly more boilerplate
since Client construction is fallible, but it allows calling code
to pass in loggers more easily for debugging test failures.
2024-05-21 15:18:58 +02:00
Noah S-C
9b6ba7741e
bazel: transcribe test ownership to bazel tags (#62664) 2024-05-16 15:51:16 +01:00
William Bezuidenhout
e14b473027
ci: call Aspect Agent Health check before doing rc gen (#61216)
* call Aspect Agent Health check before doing rc gen

* run aspect health check on aspect agents
2024-03-18 15:24:27 +02:00
William Bezuidenhout
f97a0bac73
ci: make executor registry configurable (#61200)
* make executor registry configurable

* Update dev/ci/internal/ci/images_operations.go
2024-03-18 14:16:23 +01: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
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
Noah S-C
06ea78ee9d
ci: use ci bazelrc flags everywhere (#59667)
Differences in flags are causing a lot of analysis cache discarding in CI due to differences.

We mightnt see the results for this until every branch has these changes, as bazel only keeps one analysis cache around.

But also sometimes builds are very fast even when analysis cache is busted 🙃 so who knows

## Test plan

👁️ Observing sourcegraph & aspect pipelines 👁️
2024-01-17 12:15:22 +00: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
Erik Seliger
8b52422e1a
Fixup script path after move (#57398)
Was moved out of enterprise/, so this is no longer correct.
2023-10-05 21:27:42 +00:00
Erik Seliger
432fa3555b
Fixup script path after move (#57397)
Was moved out of enterprise/, so this is no longer correct.
2023-10-05 20:52:14 +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