Support new "file sync" manager #24730
Replies: 17 comments 1 reply
-
I've actually got some experience with this use case. Scoop and Chocolatey are package managers for Windows, and both support this functionality—Scoop natively, Chocolatey with an extension. Scoop allows you to specify a URL and a regex or jsonpath. The idea being, that you run the regex against the content of the URL, and that returns a version. The script au provides similar functionality for Chocolatey. It allows you to run arbitrary scripts to get the version info (probably not the best idea for Renovate). The script I think the Scoop method of providing a URL + regex/jsonpath is the better way to go. We should also have a special case for GitHub repos, where a user can provide a GitHub URL, and Renovate knows to run against the releases page. |
Beta Was this translation helpful? Give feedback.
-
Way to go! @HonkingGoose is there anything else needed for this work to start/be prioritized? |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Hey folks, I'd be interested in picking this up - as we're looking at a way of keeping OpenAPI specifications up-to-date across repos - and wondered what the next steps would need to be to better define this? |
Beta Was this translation helpful? Give feedback.
-
We had a bit of a discussion about this on the Renovate Slack, and @TWith2Sugars and I are going to start putting some work towards this next week 🙌 |
Beta Was this translation helpful? Give feedback.
-
Tony and I have caught up, and we've come up with the following. We're thinking that - once we're happy with the below - we'll start on adding the ability to sync files via a GitHub repo, as this fits our usecase, then we can iterate over the rest of the functionality. Requirements
Expected usageUsing a new top-level {
"fileManagers": [
{
"platform": "github",
"source": "github.com/deliveroo/someapi/openapi.yml",
"destination": "my/local/openapi.yml",
// or empty for latest on the default branch
"constraint": "abcd37f323f",
// **ALTERNATIVELY**
"constraint": "commitsha:abcd37f323f",
"constraint": "branch:staging",
}
]
} The Out of scope
InspirationWe've also considered how Paket has done this |
Beta Was this translation helpful? Give feedback.
-
i though the idea was to reuse regex managers to custom managers, and add new sub types |
Beta Was this translation helpful? Give feedback.
-
@jamietanna are you proposing that Renovate commits its own "lock file" to the repo to keep track of state for such sync'd files? I would like to consider using the repository cache for this instead. e.g. we can strongly recommend the repository cache is enabled when the file manager is in use, otherwise it's very inefficient (downloads the same file to check and compare it every run) |
Beta Was this translation helpful? Give feedback.
-
Using the repository cache sounds like a good shout. The lockfile is more for a user-facing means to present some info about this, but if you think it's overkill / not appropriate we can remove that from the plan |
Beta Was this translation helpful? Give feedback.
-
@rarkins just to confirm on this, would you agree or disagree with also having a user-facing lockfile? @viceice is that in reference to #21760 ? Is there anything that would be worth confirming before we start on this? We're thinking we'll start with the new datasource |
Beta Was this translation helpful? Give feedback.
-
I prefer to avoid a user-facing lock file |
Beta Was this translation helpful? Give feedback.
This comment was marked as spam.
This comment was marked as spam.
-
He is referring to #19066 |
Beta Was this translation helpful? Give feedback.
-
Tony and I have just started looking at this, and were looking to start implementing a new datasource, when we spotted Instead of creating a new datasource, we're thinking that a better plan of action may be to start working on adding a new package manager, via docs:
We've spotted that there is a We've also spotted the Once we've done this, we'll look at adding in other functionality, such as pinning to a specific branch. |
Beta Was this translation helpful? Give feedback.
-
IMO, sounds like a good plan to use GithubTagsDatasource. Please consider GitLab support too (GitlabTagsDatasource is also available), thanks :) |
Beta Was this translation helpful? Give feedback.
-
I came across this discussion looking for a way to sync external |
Beta Was this translation helpful? Give feedback.
-
I've just seen Vendir which we support and thought that this may work for use-cases we've got, but the upstream project only seems to support Helm/Docker, which is fair Hope to maybe get around to taking a stab at this before long, but if anyone else fancies getting into it, feel free! |
Beta Was this translation helpful? Give feedback.
-
What would you like Renovate to be able to do?
Sync repository files with external sources.
Describe the solution you'd like
If a repository contains a file X and that file is "downloaded" from some external source Y (e.g. a website, or other repository, or API) then we would like Renovate to be able to keep it "in sync" with its source. The source would require manual configuration though.
I haven't thought much about the config required. We might call it the
file
package manager.It should be possible to support a remote filename different from the local filename.
How to match/sync multiple files in a repo? if we use
fileMatch
, it would be hard to correlate the files against their sources. I think we need either:What does the PR look like? e.g. PR title, etc. Do we uniquely identify the update based on a hash of the file contents? e.g.
Update file backend/Dockerfile (6e2a78)
. This would allow users to close/ignore a PR but still get a later update.Describe alternatives you've considered
Typically this would otherwise be done manually, or maybe someone wrote a complex cron script to commit, git status, git commit, etc.
Beta Was this translation helpful? Give feedback.
All reactions