Add an option to omit health checks for some repositories #704

Closed
opened 2025-11-02 03:33:41 -06:00 by GiteaMirror · 10 comments
Owner

Originally created by @tobyp on GitHub (May 12, 2017).

Description

I keep a mirror of cpython on my gitea for convenience. A health check (git fsck) on it would take approximately 10 minutes. As this is a mirror, it is also completely unnecessary. I also don't want to raise the health check timeout that high.

It would be great to have an option to skip the health check for such repositories so my system notices and journal don't fill up so fast, possibly making me miss more important problems. This might be accomplished by:

  • An option in app.ini, under the existing cron.repo_health_check section
  • An option on the repository
Originally created by @tobyp on GitHub (May 12, 2017). - Gitea version (or commit ref): 1.1.0 - Git version: 2.12.2 - Operating system: Arch Linux - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [x] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [ ] Not relevant - [x] No idea, I can't see the System Notices; check out https://try.gitea.io/frankenstein/cpython - Log gist: https://gist.github.com/tobyp/5ea4b74b8a2b4684fed971130187a066 ## Description I keep a mirror of cpython on my gitea for convenience. A health check (git fsck) on it would take approximately 10 minutes. As this is a mirror, it is also completely unnecessary. I also don't want to raise the health check timeout that high. It would be great to have an option to skip the health check for such repositories so my system notices and journal don't fill up so fast, possibly making me miss more important problems. This might be accomplished by: - An option in app.ini, under the existing cron.repo_health_check section - An option on the repository
GiteaMirror added the type/enhancement label 2025-11-02 03:33:41 -06:00
Author
Owner

@tobyp commented on GitHub (May 12, 2017):

I would be happy to work on this myself if you let me know whether such a feature is acceptable, and where it should be implemented.

@tobyp commented on GitHub (May 12, 2017): I would be happy to work on this myself if you let me know whether such a feature is acceptable, and where it should be implemented.
Author
Owner

@lunny commented on GitHub (May 12, 2017):

@tobyp please send a PR

@lunny commented on GitHub (May 12, 2017): @tobyp please send a PR
Author
Owner

@tobyp commented on GitHub (May 19, 2017):

I'm currently testing a patch for this. Took me a while to get Go and Drone set up correctly.

@tobyp commented on GitHub (May 19, 2017): I'm currently testing a patch for this. Took me a while to get Go and Drone set up correctly.
Author
Owner

@bkcsoft commented on GitHub (May 19, 2017):

Mirrors should probably default to "off" ? 🙂

@bkcsoft commented on GitHub (May 19, 2017): Mirrors should probably default to "off" ? 🙂
Author
Owner

@aswild commented on GitHub (Feb 28, 2018):

After writing an app.ini implementation, I agree with reviewers that it'd be nicer to have this as a repo setting. I'll work on an implementation for that.

The main question: should this setting be only available for admin users? I think the answer should be yes. With that in mind, here's my idea

  • Add a new IsFsckEnabled bool field to the Repository struct (default true), with an appropriate DB migration
  • Add a new Admin Settings section on the main options page between Advanced Settings and Danger Zone, visible only to admin users, containing an option to toggle the new fsck enabled field.
    • If setting.Cron.RepoHealthCheck.Enable is false, should the UI option be disabled, or just print a warning that health check is disabled and the setting will have no effect?
@aswild commented on GitHub (Feb 28, 2018): After writing an `app.ini` implementation, I agree with reviewers that it'd be nicer to have this as a repo setting. I'll work on an implementation for that. The main question: *should this setting be only available for admin users?* I think the answer should be yes. With that in mind, here's my idea * Add a new `IsFsckEnabled` bool field to the `Repository` struct (default true), with an appropriate DB migration * Add a new Admin Settings section on the main options page between Advanced Settings and Danger Zone, visible only to admin users, containing an option to toggle the new fsck enabled field. * If `setting.Cron.RepoHealthCheck.Enable` is false, should the UI option be disabled, or just print a warning that health check is disabled and the setting will have no effect?
Author
Owner

@Pofilo commented on GitHub (Feb 28, 2018):

In the same time, would it be a good idea to add an option to voluntary do the health checks ?
I don't know if such a feature exists.

@Pofilo commented on GitHub (Feb 28, 2018): In the same time, would it be a good idea to add an option to voluntary do the health checks ? I don't know if such a feature exists.
Author
Owner

@aswild commented on GitHub (Feb 28, 2018):

@Pofilo do you mean an option to manually trigger the health checks rather than waiting for cron to do it? I added an Admin Dashboard option for that to my personal fork (31de6a93af), it could be cherry-picked upstream but I'd consider that a separate issue/PR.

@aswild commented on GitHub (Feb 28, 2018): @Pofilo do you mean an option to manually trigger the health checks rather than waiting for cron to do it? I added an Admin Dashboard option for that to my personal fork (https://github.com/aswild/gitea/commit/31de6a93aff325fad2a809be52a6ef717aeea247), it could be cherry-picked upstream but I'd consider that a separate issue/PR.
Author
Owner

@lafriks commented on GitHub (Mar 1, 2018):

@aswild yes, please do submit PR about that ;)

@lafriks commented on GitHub (Mar 1, 2018): @aswild yes, please do submit PR about that ;)
Author
Owner

@stale[bot] commented on GitHub (Feb 7, 2019):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale[bot] commented on GitHub (Feb 7, 2019): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
Author
Owner

@techknowlogick commented on GitHub (Feb 7, 2019):

This now exists. Closing issues.

@techknowlogick commented on GitHub (Feb 7, 2019): This now exists. Closing issues.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#704