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

221 Commits

Author SHA1 Message Date
pat-s
4475f762e2 chore: update mocks 2025-03-10 13:58:57 +01:00
pat-s
a28c366d14 feat: add CI_COMMIT_PULL_REQUEST_TITLE env var (#80)
fix #70

Reviewed-on: https://codeberg.org/crowci/crow/pulls/80
Co-authored-by: pat-s <patrick.schratz@gmail.com>
Co-committed-by: pat-s <patrick.schratz@gmail.com>
2025-02-23 19:53:33 +00: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
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
qwerty287
db82d02b31 Replace deprecated linter (#4843) 2025-02-14 17:24:35 +01:00
pat-s
7673d5253f refactor: migrate import paths from github to codeberg 2025-01-31 14:57:57 +01:00
pat-s
db61cd3f23 refactor: recreate all mocks 2025-01-19 20:51:22 +01:00
pat-s
4c4c01e6f5 refactor: more env var changes and renamings 2025-01-19 16:22:04 +01:00
pat-s
793ec6a8ab fix: agent app name, format 2025-01-19 13:25:56 +01:00
Patrick Schratz
f262ab5c08 refactor: add CROW_ vars (#21) 2025-01-19 13:01:18 +01:00
pat-s
56616315e1 fix: fully rename go module 2025-01-18 01:36:09 +01:00
pat-s
ab1c935ef7 refactor: rename to crow-go 2025-01-18 01:27:10 +01:00
Patrick Schratz
5e0dc2688f refactor: use own import paths (#5) 2025-01-17 00:36:19 +01: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
b3c61fa47b Add client error to sdk and fix purge cli (#4574) 2024-12-16 13:05:27 +01:00
Robert Kaussow
fe11db6cd3 Replace discontinued mitchellh/mapstructure by maintained fork (#4573) 2024-12-16 07:41:49 +01:00
Robert Kaussow
ff2469ec5b Fix pipeline purge cli command (#4569) 2024-12-15 08:20:08 +02:00
qwerty287
013647340c Show client flags (#4542) 2024-12-09 15:00:21 +02: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
3c31284e7b Use pagination helper to list pipelines in cli (#4478)
Co-authored-by: 6543 <6543@obermui.de>
2024-12-01 20:39:47 +01:00
qwerty287
0f87ddc057 Sort cli commands alphabetically (#4489)
Co-authored-by: Robert Kaussow <mail@thegeeklab.de>
2024-11-30 20:11:57 +02:00
Robert Kaussow
bb1461d5d8 Fix spellcheck in purge log (#4491) 2024-11-30 18:00:11 +01:00
Robert Kaussow
57e7572b6f Unify cli commands and flags (#4481)
- Unify command and flag descriptions
- Unify logs
- Rename `woodpecker-cli [registry|ssecret|...] info` commands to `woodpecker-cli [registry|ssecret|...] show`
2024-11-30 15:23:44 +01:00
Robert Kaussow
5149d3eda4 Add pipeline purge command to cli (#4470) 2024-11-30 13:57:59 +01:00
Robert Kaussow
35f54042ce Move pipeline logs command (#4480) 2024-11-30 10:18:17 +01:00
Robert Kaussow
5cbb57bfdc Fix woodpecker-go repo model to match server (#4479) 2024-11-30 02:47:17 +02:00
Robert Kaussow
d4c0178251 Restructure cli commands (#4467) 2024-11-28 18:25:49 +01:00
Robert Kaussow
08bd52a1b1 Add pagination options to all supported endpoints in sdk (#4463) 2024-11-27 07:53:35 +01:00
Robert Kaussow
7cedda7387 Sanitize strings in table output (#4466) 2024-11-26 22:15:26 +01:00
Robert Kaussow
bf1750a291 Add PipelineListsOptions to woodpecker-go (#3652) 2024-11-26 11:50:48 +01:00
Patrick Schratz
196e2b6acf Improve project settings descriptions (#4410)
Co-authored-by: Robert Kaussow <mail@thegeeklab.de>
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
Co-authored-by: Anbraten <anton@ju60.de>
Co-authored-by: Anbraten <6918444+anbraten@users.noreply.github.com>
Co-authored-by: 6543 <6543@obermui.de>
2024-11-22 09:28:41 +01:00
renovate[bot]
78cc9eba4d fix(deps): update golang-packages (#4401)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: qwerty287 <qwerty287@posteo.de>
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
2024-11-18 19:40:45 +01:00
Anbraten
5e2fa8164b Extend approval options (#3348) 2024-11-18 14:49:12 +01:00
6543
f4d7e9f0ff Add cli lint option to treat warnings as errors (#4373)
Co-authored-by: Robert Kaussow <xoxys@rknet.org>
2024-11-13 16:28:02 +01:00
qwerty287
29474fc7d9 Split repo trusted setting (#4025) 2024-11-01 21:37:31 +01:00
Patrick Schratz
b0f52b9bc9 Correct spelling (#4279) 2024-10-29 17:43:54 +01:00
6543
2e29d43b58 Correctly init workflow metadata for cli exec (#4211) 2024-10-09 12:17:23 +02:00
6543
fcc57dfc38 Replay pipeline using cli exec by downloading metadata (#4103)
Co-authored-by: Anbraten <6918444+anbraten@users.noreply.github.com>
2024-09-25 07:20:51 +02:00
6543
1a6c8dfec6 Ensure cli exec has by default not the same prefix (#4132) 2024-09-24 22:49:36 +02:00
6543
b59533a06f cli exec: rename "--pipeline-files" to "--pipeline-changed-files" (#4142) 2024-09-24 20:29:19 +02:00
6543
352201dbbd cli exec: fix flag type and remove uneffective ones (#4129) 2024-09-24 19:08:18 +02:00
6543
4683968925 Fix regression of #4119 (#4121) 2024-09-17 07:46:31 +03:00
6543
e89a2f38fd Make cli exec metadata on pair with build in server generated metadata (#4119)
remove some old environment and add all missing options to set the whole build-in environment on `cli exec` via flags


---
*Sponsored by Kithara Software GmbH*

Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
2024-09-16 22:03:24 +02:00
6543
38ed7f9efd Remove some ci environment variables (#3846)
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
2024-09-08 08:59:58 +03:00
6543
32d1ec7cec Remove all default privileged plugins (#4053) 2024-09-02 10:41:20 +02:00
6543
3c8204a0e0 Allow alter trusted clone plugins and filter them via tag (#4074) 2024-09-01 20:41:10 +02:00
hg
37d1ca8bc1 Read long log lines from file storage correctly (#4048) 2024-08-25 22:53:04 +02:00
qwerty287
107564f54c Show error if secret name is missing (#4014) 2024-08-08 00:26:50 +02:00
smainz
c7b64e24ab Make cli plugin log purge recognize steps by name (#3953) 2024-07-21 11:36:01 +02:00