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: use repo topic as a cache #18921

Open
stevefan1999-personal opened this issue Nov 15, 2022 · 7 comments
Open

Gitea: use repo topic as a cache #18921

stevefan1999-personal opened this issue Nov 15, 2022 · 7 comments
Labels
platform:gitea Gitea or Forgejo platforms priority-4-low Low priority, unlikely to be done unless it becomes important to more people type:feature Feature (new functionality)

Comments

@stevefan1999-personal
Copy link

stevefan1999-personal commented Nov 15, 2022

What would you like Renovate to be able to do?

I want to use the autodiscovery feature but I don't want to pull the repo every single time, causing a huge spike in our potato server. I don't want to use a cache either because there can be multiple instances of Renovate running at the same time (for different Gitea servers too, including my company ones and my personal ones) and using a consolidated cache would cause some synchronization issue. We are using a K8S cronjob for this so we can't afford to update the repo every time we make a new one. Obviously, we wanted a more dynamic choice.

This would greatly reduce the need for manually configuring the repos, while still keeping a clear intention to the rest of my teammates.

If you have any ideas on how this should be implemented, please tell us here.

We can use the Gitea topic support to filter projects that are manually tagged to want to onboard, like if the repo is tagged with renovate-managed.

If the filtered repo with topic does not have the config.json/config.js, it is considered to be in onboard mode.

Say if I have a stevefan1999/foo repo tagged with renovate-managed, and Renovate only clones that, tried to scan but not see renovate.json/renovate.js, we send a Configure Renovate/onboarding PR for that.

Is this a feature you are interested in implementing yourself?

Maybe

@stevefan1999-personal stevefan1999-personal added priority-5-triage status:requirements Full requirements are not yet known, so implementation should not be started type:feature Feature (new functionality) labels Nov 15, 2022
@viceice
Copy link
Member

viceice commented Nov 15, 2022

so basically you like to use a tag to disable repos from being processed by renovate.

so this can maybe implemented like the experimental autodiscover server filter I've done recently.

@viceice viceice added platform:gitea Gitea or Forgejo platforms priority-4-low Low priority, unlikely to be done unless it becomes important to more people and removed priority-5-triage labels Nov 15, 2022
@stevefan1999-personal
Copy link
Author

@viceice Quite close -- except I want to manually cherrypick the repos I want to auto-discover on

@viceice
Copy link
Member

viceice commented Nov 15, 2022

🤔 @stevefan1999-personal Please try to describe in more detail how you think this should work.

Renovate currently does this:

  1. autodiscover repos, if enabled
  2. apply autodiscover filter
  3. append statically configured repos (filter duplicates)
  4. process each repo

@stevefan1999-personal
Copy link
Author

@viceice Yes I know, except I don't want to auto discover too much repo -- right now we have over 100 repos and I don't expect to clone them one by one because it will thwart our Gitea instance.

I want to use the topic instead to act as a filter without having to set the config.js/config.json every time to update the autodiscovery filter, since this not only would mean I have to update the Helm chart a lot (we use https://github.com/drone/charts btw), but we can't add it to the autodiscovery filter on demand sometimes due to permission issue that not all of us have RBAC permission to update the Helm chart and thus the filter while the audit team members are away.

This RBAC permission problem is specifically for us, so just think of it as a little shortcut for probing the candidates of autodiscovery targets by leveraging the topic feature to eagerly filter the search space early on.

@viceice
Copy link
Member

viceice commented Nov 15, 2022

ok, so what you like is to add a new topic1 filter here:

...(process.env.RENOVATE_X_AUTODISCOVER_REPO_SORT && {
sort: process.env.RENOVATE_X_AUTODISCOVER_REPO_SORT as RepoSortMethod,
}),
...(process.env.RENOVATE_X_AUTODISCOVER_REPO_ORDER && {
order: process.env.RENOVATE_X_AUTODISCOVER_REPO_ORDER as SortMethod,
}),

So a repo needs a specific topic to be returned if it's defined.

Footnotes

  1. https://try.gitea.io/api/swagger#/repository/repoSearch

@viceice
Copy link
Member

viceice commented Nov 15, 2022

checkout this pr for implementation details

@stevefan1999-personal
Copy link
Author

@viceice Thanks! Actually I did look up there before and know what to do but I'm gotta rest for now

@rarkins rarkins removed the status:requirements Full requirements are not yet known, so implementation should not be started label Oct 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform:gitea Gitea or Forgejo platforms priority-4-low Low priority, unlikely to be done unless it becomes important to more people type:feature Feature (new functionality)
Projects
None yet
Development

No branches or pull requests

3 participants