Commit graph

44 commits

Author SHA1 Message Date
2b763833d4
fc-common: add extended BuildStatus enum with new status code
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: If00cae8b2f7d4a7ad2d64bfe70a5c4186a6a6964
2026-02-16 13:02:21 +03:00
a5768d46eb
fc-common: allow configuring url schemes to allow for testing
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I99912d7c45f1a4664d4823ddd793b5af6a6a6964
2026-02-16 00:08:23 +03:00
b745550011
various: tiny cleanup
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I312766a6178be3898b51c2863f502bb06a6a6964
2026-02-15 23:37:53 +03:00
f7081317ee
various: reuse HTTP client; eliminate intermediate string allocations; add tests
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I18b89e1aae78a400a89c9d89423ce1da6a6a6964
2026-02-15 23:37:52 +03:00
38ed7faee2
various: replace silent error discards with logged warnings
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I465d760b5330980270b64b4a89abc09f6a6a6964
2026-02-15 23:37:51 +03:00
aa4ebf2f5b
various: harden input validation; add SSRF protection; fix default API key role
Default API key role was "admin", which was something that I forgot to fix during testing. We
change it to "read-only". 

Additionally repository URLs now reject `file://` scheme (another testing artifact) localhost,
private IP ranges, and cloud metadata endpoints. Nix expressions reject path traversal (`..`)
and absolute paths. Validation is called at the evaluator endtrypoint before command construction.

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I35729c6aa9ec4ff8d1ea19bd57ea93646a6a6964
2026-02-15 23:37:49 +03:00
a2b638d4db
nix: attempt to fix VM tests; general cleanup
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I65f6909ef02ab4599f5b0bbc0930367e6a6a6964
2026-02-15 23:37:49 +03:00
537fa823a7
fc-server: add timeseries API endpoints for visualisation
Adds:

- `build_stats_timeseries()` for build counts over time
- `duration_percentiles_timeseries()` for P50/P95/P99
- `system_distribution()` for per-system counts

and of course,  REST endpoints for `/api/v1/metrics/timeseries/*`. This
is a good start for data visualisation. My professors would be proud.

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I3c0b9d14592945a661af77b7edf338a86a6a6964
2026-02-14 18:08:20 +03:00
75ff45fc91
various: initial support for S3 cache upload
Not too stable yet, but might work.

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: If134e7e45aa99ce8d18df7b78b1f881b6a6a6964
2026-02-14 18:08:19 +03:00
ec5fbb453d
fc-common: add AlertConfig and AlertManager for error tracking
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Iaf2f52f6e0cf33e3275528ac13cd92046a6a6964
2026-02-14 18:08:17 +03:00
f8f9703faa
fc-common: add build_metrics table and repository
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: If6842311f49bfcba9e1b11fa8bc9748c6a6a6964
2026-02-14 18:08:16 +03:00
0dc09dbd19
various: fix auto-fisable Clippy lints
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I79a708981b5aee43eadbd48d69fb78be6a6a6964
2026-02-08 22:23:29 +03:00
3a03cf7b3e
treewide: format with nightly rustfmt; auto-fix Clippy lints
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: If4fd0511087dbaa65afc56a34d7c2f166a6a6964
2026-02-08 22:23:28 +03:00
c6c64d568f
fc-common: add advanced search functionality with filters and sorting
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ib48f9bd42eea289b9eb8b13e3bd60ed86a6a6964
2026-02-08 22:23:25 +03:00
d4d9297d96
fc-common: add declarative sync for remote builders and channels
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I3dae89f04777f6d941824606aebe34446a6a6964
2026-02-08 22:23:24 +03:00
abd16319f2
fc-common: add sync_for_project for declarative members
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ic283bf87771e82a27c4c579314a21c1d6a6a6964
2026-02-08 22:23:23 +03:00
7e6fc22ba2
fc-common: add declarative sync for webhooks and notifications
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I0b7c46feba776837158507bfe883cbfa6a6a6964
2026-02-08 22:23:22 +03:00
dead111dfb
fc-common: add upsert and sync_for_jobset for declarative jobset inputs
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I40f2724aeb9615e8c37a397187064fa66a6a6964
2026-02-08 22:23:21 +03:00
73919f2f9e
treewide: format with nightly rustfmt; auto-fix Clippy lints
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I15d9215ab506b37954468d99746098326a6a6964
2026-02-08 22:23:20 +03:00
10a118bd50
various: update tests for jobset state field changes
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ifdd7f216fcc27fface0cb16d56c5e37b6a6a6964
2026-02-08 22:23:19 +03:00
865b2f5f66
fc-common: better support declarative users with password file
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I1eac6decd68a4e59a52fecaecdd476b26a6a6964
2026-02-08 22:23:17 +03:00
1df28f6049
fc-common: add jobset state enum; add db migration"
I'm going to delete all migrations one of those days...

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I8e2e32118c2d85438a8b343614038eda6a6a6964
2026-02-08 22:23:14 +03:00
794e4a8e61
common,evaluator: add PR fields to evaluation; add jobset ordering test
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I305c988aceb8c72c65b740cb323c0ef06a6a6964
2026-02-07 22:09:28 +03:00
b6012b932f
chore: update dependencies and configuration
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I5bab99cb7e7bb2125e7410b54911021a6a6a6964
2026-02-07 22:09:24 +03:00
8c1968c863
common: improve notifications system
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I084bb95a4eb79d5a15f7c062c112124c6a6a6964
2026-02-07 22:09:23 +03:00
caadb52f64
common: enhance user repository with validation
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ic96bef36e3b4d1ea6b2db9752b26dd3a6a6a6964
2026-02-07 22:09:22 +03:00
2eae49f313
fc: initial pull request evaluation support
The migration adds PR support, models expose PR fields, webhooks handle
PR events, and tests validate it. To be honest the migrations are a bit
redundant at the moment, but I'd like to handle my old deployments so
it's nice(r) to have them. I *am* testing those on baremetal.

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I02fb4540b62d3e8159ac18b9fa63be916a6a6964
2026-02-07 22:09:20 +03:00
1c18306822
various: eliminate redundant disk check; improve error handling
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I1f37cc60380790bc1bf11f143194ad116a6a6964
2026-02-05 23:05:02 +03:00
4b375bc546
various: remove unused imports and parameters; fix clippy lints
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ia7a4438e1aa73de2ea1bc6cdf26998f06a6a6964
2026-02-05 22:45:23 +03:00
dec4753567
fc-server: add (more) advanced search API
Basically, implements a multi-entity search functionality with filters
for projects, jobsets, evaluations and builds. Also fixes COUNT query to
apply same filters as main query, and fixes an offset mismatch in
response. Some integration tests have also been added, but chances are
we'll want to write VM tests for this.

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Icdda77966a7218f54fd34b78bdc9b55c6a6a6964
2026-02-05 22:45:22 +03:00
550603c4bb
fc-common: add disk space monitoring and error handling
Adds a `DiskSpace` error variant and an `is_disk_full()` helper
alongside a `check_disk_space()` util that uses libc's `statsfs` on
unix. FC now detects disk space errors and logs recovery instructions
if applicable.

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ia6d2c472219dc9d6eed6901dc733d7bb6a6a6964
2026-02-05 22:45:20 +03:00
f5c54b1e05
fc-common: implement user management repository layer
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I020c2fd3b061b5a671fe75d50048519f6a6a6964
2026-02-05 22:45:11 +03:00
1af7b5c82e
fc-common: add user management models and DTOs
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ieac472b29092b38be1d6c0af3173e8d26a6a6964
2026-02-05 22:45:10 +03:00
a3155f54e8
fc-common: validation and roles modules
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Idc4d0743153c77b4dd915a95a603680f6a6a6964
2026-02-05 22:45:09 +03:00
c306383d27
chore: format with updated rustfmt and taplo rules
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ie9ef5fc421fa20071946cf1073f7920c6a6a6964
2026-02-05 22:45:06 +03:00
a52c61556a
crates/common: enhance notifications and GC roots handling
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I8a19eeda480672f8f22adbafb3039db66a6a6964
2026-02-02 01:49:29 +03:00
2378ff6661
crates/common: update repos for weighted scheduling and jobset inputs
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I0fe2ceb20dc6692f3315185765ea80756a6a6964
2026-02-02 01:49:28 +03:00
4c5a99d554
crates/common: add branch and scheduling_shares to jobset models
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ie19897f5ffdfb44654891511ce669d806a6a6964
2026-02-02 01:49:27 +03:00
be9caa0b61
crates/common: add bootstrap, tracing_init, and nix_probe modules
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ifbc17b000a4fb4a10e05ac9405582a366a6a6964
2026-02-02 01:49:26 +03:00
1b12be3f8a
crates: production models and repo layer
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Iceb76724c09eaca7ca5d823010db76776a6a6964
2026-02-02 01:15:05 +03:00
cbf16a7e63
common: add basic database tests; skip when DB unavailable
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I10be55f54495c07de19ed26a03c9596c6a6a6964
2026-02-02 01:15:02 +03:00
0e6d249e0f
common: initial database handling
Can be configured from the config file, and also using environment
options.

```toml
[database]
url = "postgresql://fc_ci:password@localhost/fc_ci"
max_connections = 20
min_connections = 5
connect_timeout = 30
idle_timeout = 600
max_lifetime = 1800
```

We'll want to support SQlite in the future, and better secret handling
for database credentials. For now, this is workable.

---

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I36b4c1306511052a2748ca9d5d3429366a6a6964
2026-02-02 01:15:01 +03:00
a4c3cd1517
meta: add database migrations; set up migration CLI
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I0cbc9798243134d36f788099ecc3ee5a6a6a6964
2026-02-02 01:15:00 +03:00
6203ea7f52
initial commit
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I79a875e75937ff6b3739ca36bfb0b2836a6a6964
2026-02-02 01:14:56 +03:00