1
0
mirror of https://codeberg.org/crowci/crow.git synced 2025-06-12 22:02:01 +03:00
Commit Graph

12 Commits

Author SHA1 Message Date
4475f762e2 chore: update mocks 2025-03-10 13:58:57 +01:00
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
53c8eb44fb chore: remove go generate mockery 2025-02-19 15:46:17 +01:00
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
7673d5253f refactor: migrate import paths from github to codeberg 2025-01-31 14:57:57 +01:00
db61cd3f23 refactor: recreate all mocks 2025-01-19 20:51:22 +01:00
9d1a35c012 refactor: update mock package names 2025-01-19 20:16:56 +01:00
29f9ea7dc2 refactor: rename crow-go package to crow 2025-01-19 17:22:24 +01:00
4c4c01e6f5 refactor: more env var changes and renamings 2025-01-19 16:22:04 +01:00
f262ab5c08 refactor: add CROW_ vars (#21) 2025-01-19 13:01:18 +01:00
56616315e1 fix: fully rename go module 2025-01-18 01:36:09 +01:00
ab1c935ef7 refactor: rename to crow-go 2025-01-18 01:27:10 +01:00