1
0
mirror of https://codeberg.org/crowci/crow.git synced 2025-08-06 09:22:46 +03:00
Commit Graph

212 Commits

Author SHA1 Message Date
pat-s
4475f762e2 chore: update mocks 2025-03-10 13:58:57 +01:00
Robert Kaussow
2e43d2fe76 fix: Add migration to fix zero forge_id in orgs table (#4924) 2025-03-10 10:09:22 +01:00
pat-s
901a614246 feat: add log purge setting as repo setting (#34)
follow-up #10 (which was a git hickup)

![image](/attachments/a7655406-b492-4912-873b-d3d6f692be9e)

![image](/attachments/fe365dce-65dd-40cc-aeb8-3d9ca95a52ad)

## Behaviour

Log purging is attempted in an asynchronous process before a new pipeline of a specific repo is started.
It does so by

1. Getting all existing pipelines
2. Filtering by `keepMin` and `keepDuration` settings
3. Calling `LogDelete` for all remaining pipelines

Deleting only logs instead of the full pipeline (which `crow-cli pipeline purge` does) is preferred to keep historic pipeline information. Storing this in the DB is just a single line and doesn't contain much content (in contrast to logs).

## Defaults

- No minimum count is kept (`CROW_DEFAULT_LOGS_PIPELINES_KEEP_MIN`)
- All pipelines of the last 90 days (per repo) are kept (`CROW_DEFAULT_LOGS_KEEP_DURATION`)

## Todo

- [x] implement purge call during pipeline start
- [x] add settings to DB column and repo settings
- [x] tests
- [x] think about defaults
- [x] Currently the purge happens on all pipelines in scope, including ones which have already been cleared. To avoid these unnecessary calls, which also will add up for repos with many pipelines, an indicator is needed which allows filtering these pipelines out.

fix #9

Co-authored-by: crowci-bot <admin@crowci.dev>
Reviewed-on: https://codeberg.org/crowci/crow/pulls/34
Co-authored-by: pat-s <patrick.schratz@gmail.com>
Co-committed-by: pat-s <patrick.schratz@gmail.com>
2025-02-19 21:19:13 +00:00
pat-s
53c8eb44fb chore: remove go generate mockery 2025-02-19 15:46:17 +01:00
Anbraten
74b0cc2d13 Fix org assign on login (#4817)
Co-authored-by: qwerty287 <qwerty287@posteo.de>
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
2025-02-19 15:03:20 +01:00
pat-s
cecfb22099 refactor: mocking (#38)
- `mockery` can now be run in one call instead of multiple ones
- Use the recommended "packages" approach which will be the new default moving forward
- Enforce consistent naming of mock files
- Remove warnings when invoking `mockery`
- Get rid of *many* linter warnings 🎉️

Reviewed-on: https://codeberg.org/crowci/crow/pulls/38
Co-authored-by: pat-s <patrick.schratz@gmail.com>
Co-committed-by: pat-s <patrick.schratz@gmail.com>
2025-02-15 10:23:47 +00:00
Patrick Schratz
323a1e2463 Unsanitize user and org names in DB (#4762)
Co-authored-by: Robert Kaussow <mail@thegeeklab.de>
Co-authored-by: Anbraten <6918444+anbraten@users.noreply.github.com>
Co-authored-by: Anbraten <anton@ju60.de>
2025-02-12 23:48:31 +01:00
Lauris BH
b829fc2f3b feat: Optimize repository list loading to return also latest pipeline info (#4814) 2025-02-10 10:43:12 +01:00
pat-s
7673d5253f refactor: migrate import paths from github to codeberg 2025-01-31 14:57:57 +01:00
pat-s
0bd5202468 chore: revert tab - spaces migration due to test errors 2025-01-20 22:00:29 +01:00
pat-s
5797d2c420 chore: editorconfig fixes 2025-01-20 15:34:57 +01:00
Robert Kaussow
434d6f4825 fix: sql identifier escaping in datastore feed 2025-01-20 14:24:51 +01:00
pat-s
4c4c01e6f5 refactor: more env var changes and renamings 2025-01-19 16:22:04 +01:00
Patrick Schratz
f262ab5c08 refactor: add CROW_ vars (#21) 2025-01-19 13:01:18 +01:00
Patrick Schratz
35903bfa8c refactor: use alpine-golang images (#10) 2025-01-17 17:04:10 +01:00
Patrick Schratz
5e0dc2688f refactor: use own import paths (#5) 2025-01-17 00:36:19 +01:00
qwerty287
9d8eed46a0 Fix org creation (#4722) 2025-01-14 09:30:20 +01:00
Patrick Schratz
628c0e8faa Don't fail user creation if org exists (#4687) 2025-01-10 18:12:21 +01:00
qwerty287
afa6dee30b Migrate away from goblin (#4624)
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Robert Kaussow <mail@thegeeklab.de>
2024-12-30 08:08:53 +02:00
qwerty287
fdfabe6368 Support Git as only VCS (#4346)
Co-authored-by: Patrick Schratz <patrick.schratz@gmail.com>
2024-12-27 22:49:19 +01:00
qwerty287
81b74025d4 Update Go imports paths (#4605)
Co-authored-by: Robert Kaussow <mail@thegeeklab.de>
2024-12-22 10:44:34 +01:00
Robert Kaussow
7fa474c5c3 Ignore blocked pipelines for badge rendering (#4582) 2024-12-18 08:58:08 +01:00
Robert Kaussow
e8216bc123 Remove related pipeline logs during pipeline deletion (#4572) 2024-12-17 09:09:03 +01:00
6543
6e18a44880 Set new default approval mode based on repo visibility (#4456)
Co-authored-by: Patrick Schratz <patrick.schratz@gmail.com>
Co-authored-by: Anbraten <6918444+anbraten@users.noreply.github.com>
2024-12-05 09:16:25 +01:00
Robert Kaussow
289239d1b3 Add status filter to list pipeline API (#4494) 2024-12-01 05:35:05 +01:00
6543
52fb493495 Add filter to list repository pipelines API (#4416) 2024-11-28 22:33:52 +01:00
qwerty287
6f7f7692e1 Rename token fields (#4471)
Co-authored-by: Anbraten <6918444+anbraten@users.noreply.github.com>
2024-11-28 10:27:28 +02:00
qwerty287
5bb7cef08b Allow to set custom trusted clone plugins (#4352)
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Thomas Anderson <127358482+zc-devs@users.noreply.github.com>
Co-authored-by: Anbraten <6918444+anbraten@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-11-26 14:27:05 +01:00
Anbraten
53d6421940 Support github refresh tokens (#3811) 2024-11-22 19:12:43 +01:00
qwerty287
5c2204716c Fix migration sorting (#4408) 2024-11-18 20:48:51 +02:00
Anbraten
5e2fa8164b Extend approval options (#3348) 2024-11-18 14:49:12 +01:00
6543
07baae28af address review lint issues (#4354) 2024-11-11 15:25:31 +01:00
6543
5139401b53 Inline model types for migrations (#4293) 2024-11-09 16:05:32 +01:00
6543
4fa3a8e578 Add migration to autofix corrupted users.org_id entrys in db (#4307) 2024-11-06 14:51:12 +02:00
6543
6e38a950cd Add options to controll the database connections (open,idle,timeout) (#4212) 2024-11-05 15:03:22 +01:00
qwerty287
29474fc7d9 Split repo trusted setting (#4025) 2024-11-01 21:37:31 +01:00
6543
f8cfda1ea9 Report custom labels set by agent admins back (#4141) 2024-10-06 17:13:41 +02:00
6543
febb8c5276 Implement org/user agents (#3539) 2024-09-30 12:33:16 +01:00
hg
276b279b7f Process workflow logs in batches (#4045) 2024-09-18 16:29:56 +02:00
qwerty287
c45e0885ac Require upgrade from 2.x (#4112)
Remove old DB migrations and require users to upgrade to 2.x first.
2024-09-16 21:09:42 +02:00
6543
4dd4d9755d Use session for ServerConfigSet to make it atomic (#4116) 2024-09-16 15:20:47 +03:00
qwerty287
84c1b92899 Fix migration registries table (#4111) 2024-09-14 14:41:14 +03:00
qwerty287
67a9c7991c Fix cron migration (#4020) 2024-08-10 21:32:21 +02:00
qwerty287
2081ca85db Refactor JSON and SDK fields (#3968) 2024-08-07 10:49:03 +02:00
qwerty287
c864f24ae4 Migrate to maintained cron lib and remove seconds (#3785)
Co-authored-by: Patrick Schratz <patrick.schratz@gmail.com>
2024-08-06 19:22:28 +02:00
qwerty287
8a277e7bd9 Improve cron list (#3947) 2024-07-20 18:15:38 +02:00
6543
757f5a58e2 Gracefully shutdown server (#3896) 2024-07-14 01:46:01 +02:00
Anbraten
b12d676546 Allow login using multiple forges (#3822) 2024-07-13 01:41:35 -07:00
6543
bc02d376b2 Sort users by login (#3891) 2024-07-12 20:27:37 +02:00
Lauris BH
40b496f13b Fix helper functions for MySQL syntax (#3874) 2024-07-12 18:18:55 +02:00