1
0
mirror of https://codeberg.org/crowci/crow.git synced 2025-07-31 12:44:30 +03:00
Commit Graph

155 Commits

Author SHA1 Message Date
4475f762e2 chore: update mocks 2025-03-10 13:58:57 +01:00
6276ebf9e4 chore: include forge type in netrc (#4908) 2025-03-10 10:10:31 +01:00
638b703c44 Fix unique constraint for orgs (#4923) 2025-03-10 09:57:42 +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
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
b829fc2f3b feat: Optimize repository list loading to return also latest pipeline info (#4814) 2025-02-10 10:43:12 +01:00
7673d5253f refactor: migrate import paths from github to codeberg 2025-01-31 14:57:57 +01:00
5e0dc2688f refactor: use own import paths (#5) 2025-01-17 00:36:19 +01:00
97d24ee1c9 Remove deprecated API field (#4676) 2025-01-08 16:40:53 +01:00
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
fdfabe6368 Support Git as only VCS (#4346)
Co-authored-by: Patrick Schratz <patrick.schratz@gmail.com>
2024-12-27 22:49:19 +01:00
81b74025d4 Update Go imports paths (#4605)
Co-authored-by: Robert Kaussow <mail@thegeeklab.de>
2024-12-22 10:44:34 +01:00
289239d1b3 Add status filter to list pipeline API (#4494) 2024-12-01 05:35:05 +01:00
52fb493495 Add filter to list repository pipelines API (#4416) 2024-11-28 22:33:52 +01:00
6f7f7692e1 Rename token fields (#4471)
Co-authored-by: Anbraten <6918444+anbraten@users.noreply.github.com>
2024-11-28 10:27:28 +02:00
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
53d6421940 Support github refresh tokens (#3811) 2024-11-22 19:12:43 +01:00
5e2fa8164b Extend approval options (#3348) 2024-11-18 14:49:12 +01:00
066926f952 Fix avatar column type (#4340) 2024-11-09 08:23:26 +02:00
29474fc7d9 Split repo trusted setting (#4025) 2024-11-01 21:37:31 +01:00
f8cfda1ea9 Report custom labels set by agent admins back (#4141) 2024-10-06 17:13:41 +02:00
febb8c5276 Implement org/user agents (#3539) 2024-09-30 12:33:16 +01:00
6ad20ced5b Move docker resource limit settings from server to agent (#3174)
so you can set it per agent and not per server
2024-09-26 16:56:59 +01:00
41b2127e04 Don't expose task data via api (#4108) 2024-09-14 22:40:12 +02:00
21f6039bc9 Add indices to repo table (#4087) 2024-09-06 11:04:05 +03:00
2081ca85db Refactor JSON and SDK fields (#3968) 2024-08-07 10:49:03 +02:00
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
ceb14cadc5 Fix deploy task env (#3878) 2024-07-07 13:43:07 +02:00
28e982fffb Global and organization registries (#1672)
Co-authored-by: Anbraten <6918444+anbraten@users.noreply.github.com>
2024-07-03 06:33:11 -07:00
918985c508 Add timestamp for last work done by agent (#3844) 2024-07-01 10:34:47 -07:00
2fa9432ef8 Cleanup state reporting (#3850) 2024-07-01 11:20:55 +02:00
92cd0d04a3 Unify DB tables/columns (#3806)
Co-authored-by: Anbraten <6918444+anbraten@users.noreply.github.com>
2024-06-27 09:32:06 +02:00
fbb96ff8f5 Add api for forges (#3733) 2024-06-20 13:08:54 +02:00
91b122e1ce Native forgejo support (#3684)
Co-authored-by: Robert Kaussow <xoxys@rknet.org>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
2024-06-01 11:23:19 +02:00
5527d9bf86 Cleanup server env settings (#3670)
Co-authored-by: Robert Kaussow <mail@thegeeklab.de>
Co-authored-by: Robert Kaussow <xoxys@rknet.org>
2024-05-15 15:45:08 +02:00
89e100cfd1 Add godot linter to harmonitze toplevel comments (#3650) 2024-05-13 22:58:21 +02:00
e6bda2c2b3 Support github deploy task (#3512)
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
2024-05-02 18:56:19 +02:00
9972c24924 Add filter options to GetPipelines API (#3645)
Separate this change from
https://github.com/woodpecker-ci/woodpecker/pull/3506

I would like to get at least this change into v2.5.0 if possible.

---------

Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
2024-04-25 09:37:42 +02:00
d494b6a959 Use forge from db (#1417)
This is the first step towards support for multiple forges (#138). It
inserts a forge using the currently existing env varaibles into db and
uses this forge from db later on in all places of the code.

closes #621

addresses #138 

# TODO
- [x] add forges table
- [x] add id of forge to repo
- [x] use forge of repo
- [x] add forge from env vars to db if not exists
- [x] migrate repo.ForgeID to the newly generated forge
- [x] support cache with forge from repo
- [x] maybe add forge loading cache? (use LRU cache for forges, I expect
users to have less than 10 forges normally)

---------

Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
2024-04-16 08:04:55 +02:00
00f0fcd416 Rework addons (use rpc) (#3268)
Co-authored-by: Anbraten <6918444+anbraten@users.noreply.github.com>
2024-04-15 10:04:21 +02:00
eaf10611eb Allow to disable deployments (#3570)
…but if they're enabled, allow for all events. Also add warning that you
should only enable it if you trust the users with push access.

closes #3559

---------

Co-authored-by: Robert Kaussow <xoxys@rknet.org>
2024-04-02 22:03:37 +02:00
a779eed3df Enable golangci linter gomnd (#3171) 2024-03-15 18:00:25 +01:00
cb3efd2cd9 Simplify store interfaces (#3437)
Use `store.Store` interface if possible.
2024-02-25 10:37:10 +01:00
82e1ce937c Refactor internal services (#915) 2024-02-11 18:42:33 +01:00
e1521ef460 Set correct link for commit (#3368)
Closes https://github.com/woodpecker-ci/woodpecker/issues/2657
Closes https://github.com/woodpecker-ci/woodpecker/issues/906
2024-02-11 10:44:50 +01:00
9df572ef31 Add release event trigger (#3226)
Supersedes #764 

Bitbucket does not support release webhooks.

---------

Co-authored-by: Patrick Schratz <patrick.schratz@gmail.com>
2024-01-30 17:39:00 +01:00
2eec1ce909 Fix agent updating (#3287) 2024-01-28 12:29:56 +01:00
94b882fb95 Add spellcheck config (#3018)
Part of #738 

```
pnpx cspell lint --gitignore '{**,.*}/{*,.*}'
```

---------

Co-authored-by: Anbraten <anton@ju60.de>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: 6543 <6543@obermui.de>
2024-01-27 21:15:10 +01:00
0b5eef7d1e Improve secret availability checks (#3271) 2024-01-27 20:59:44 +01:00
5e2f7d81b3 Clean up models (#3228) 2024-01-22 07:56:18 +01:00