Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Artifacts retention and auto clean up #26131

Merged
merged 18 commits into from Sep 6, 2023

Conversation

fuxiaohei
Copy link
Contributor

@fuxiaohei fuxiaohei commented Jul 25, 2023

Currently, Artifact does not have an expiration and automatic cleanup mechanism, and this feature needs to be added. It contains the following key points:

  • add global artifact retention days option in config file. Default value is 90 days.
  • add cron task to clean up expired artifacts. It should run once a day.
  • support custom retention period from retention-days: 5 in upload-artifact@v3.
  • artifacts link in actions view should be non-clickable text when expired.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jul 25, 2023
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 25, 2023
@silverwind silverwind added the type/feature Completely new functionality. Can only be merged if feature freeze is not active. label Jul 25, 2023
@delvh
Copy link
Member

delvh commented Jul 25, 2023

Can we somehow merge this into the package cleanup functionality?
I mean, both artifact and package deletion are pretty similar conceptually…

@puni9869
Copy link
Member

Can we somehow merge this into the package cleanup functionality? I mean, both artifact and package deletion are pretty similar conceptually…

That will be a great thing.

@wolfogre
Copy link
Member

wolfogre commented Jul 26, 2023

Can we somehow merge this into the package cleanup functionality?

I'm not sure, what if Package is disabled while Actions is enabled? Is it OK to handle this?

@lunny
Copy link
Member

lunny commented Jul 26, 2023

But they have different logic. Foe aritfacts, actions or workflows can define an expired time when uploading.

@fuxiaohei
Copy link
Contributor Author

actions clean up includes artifacts, logs, unstoppable tasks, etc. it should handle all events related to actions. it's better t make it separated with other modules.

@pull-request-size pull-request-size bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 3, 2023
@fuxiaohei fuxiaohei marked this pull request as ready for review August 4, 2023 01:11
@lunny lunny added this to the 1.21.0 milestone Aug 4, 2023
services/actions/cleanup.go Outdated Show resolved Hide resolved
models/actions/artifact.go Outdated Show resolved Hide resolved
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Sep 3, 2023
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Sep 3, 2023
services/cron/tasks_basic.go Show resolved Hide resolved
models/actions/artifact.go Outdated Show resolved Hide resolved
modules/setting/actions.go Show resolved Hide resolved
models/migrations/migrations.go Outdated Show resolved Hide resolved
routers/web/repo/actions/view.go Outdated Show resolved Hide resolved
routers/api/actions/artifacts.go Show resolved Hide resolved
@lunny lunny added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Sep 6, 2023
@lunny lunny enabled auto-merge (squash) September 6, 2023 06:38
@lunny lunny merged commit 460a2b0 into go-gitea:main Sep 6, 2023
24 checks passed
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Sep 6, 2023
zjjhot added a commit to zjjhot/gitea that referenced this pull request Sep 7, 2023
* giteaofficial/main:
  Fix schedule actions still running even if workflow disalbed (go-gitea#26939)
  Fix the missing repo count (go-gitea#26942)
  Improve SSH Key / GPG Key / Deploy Key UI (go-gitea#26949)
  [skip ci] Updated translations via Crowdin
  Update nginx recommendations (go-gitea#26924)
  docs: Update Profile README information (go-gitea#26947)
  Fix scoped label layout (go-gitea#26932)
  Move createrepository from module to service layer (go-gitea#26927)
  Add a documentation note for Windows Service (go-gitea#26938)
  allow "latest" to be used in release vTag when downloading file (go-gitea#26748)
  Extract common code to new template (go-gitea#26933)
  Show always repo count in header (go-gitea#26842)
  Show always repo count in header (go-gitea#26842)
  Artifacts retention and auto clean up (go-gitea#26131)
  Fix UI anomalies (go-gitea#26929)
  Fix the display of org level badges  (go-gitea#26504)
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Dec 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. type/feature Completely new functionality. Can only be merged if feature freeze is not active.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants