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

Gitea Maven Package Management provides no cleanup rules for limiting the number of SNAPSHOTs kept for versions #32107

Open
JWT007 opened this issue Sep 22, 2024 · 3 comments

Comments

@JWT007
Copy link

JWT007 commented Sep 22, 2024

Description

The Gitea package cleanup rules only seem to be setup to delete old packages/versions. However, they do not seem to provide a mechanism for deleting older artifacts from SNAPSHOT builds within a versions.

We currently have a master branch where an artifact with version P.V-SNAPSHOT has almost 800 files (each build creates a JAR, JAVADOC, SOURCE, CLASSES) - each with timestamps in the name. But it seems we cannot create a rule to keep at most 3 snapshot builds, or only keep the latest, or delete all older 30 days - those rules only apply to packages and versions in their entirety.

Originally mentioned on Forum: https://forum.gitea.com/t/gitea-maven-snapshot-cleanup/9778/2

image

Gitea Version

3479ca8ec

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

unknown (hosted)

Operating System

Linux

How are you running Gitea?

Cannot answer as hosted by our DOAAS provider in-house. I don't think it is relevant to the problem, but if required, please let me know and I will get the required information.

Database

None

@tschoellhorn
Copy link

We have the same issue with our self-hosted Gitea-Site (1.2.11).

@JWT007
Copy link
Author

JWT007 commented Nov 17, 2024

@KN4CK3R any ideas how to go about implementing this... I am not a "go" developer but I would be willing to take a crack at a PR if you could give me some rough guidelines about how the current package add/edit rule might be modified for Maven snapshots or if a new mechanism should be implemented.
Important options which sort of overlap with existing rules are:

This is a massive problem for us and eating up disk space like crazy but unfortunately it is getting no attention here.

@dianaStr7
Copy link

Hi everyone! I've opened a pull request adding a cleanup process for Maven snapshot versions in Gitea. Set the number of snapshot versions you want to retain in the app.ini file, and older files will be automatically deleted. This is part of the package cleanup, which is enabled by default and runs either when the Gitea instance starts or periodically via a cron job. The default setting of -1 prevents any deletions, while 1 preserves only the latest build. Here's the link to the pull request—your feedback is welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants