-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Initial Haskell support #8187
Comments
Thanks @pbrisbin for the proposal. Logically here's how we'd approach an implementation: DatasourcesIs there a need to access new APIs to retrieve versions of packages? In this case it seems like Hackage is needed. It would go into VersioningDoes Haskell use its own syntax to define versions or constraints/ranges? I'm seeing "pinned" versions with digests in your examples so maybe our "loose" versioning would work fine for things like ManagerThe minimum you need to implement is a manager (e.g. Is there any separate "artifacts" files that need updating, e.g. checksum or lock files? ChangelogCurrently our changelog only supports github and gitlab sources, but it sounds like they are published to the registry itself for Hackage? Do any packages also publish to a changelog file in their github source? |
It does, called the PVP. In short, it defines a 4-part version
In case it's helpful, in my own packages, I set
Yes, a (Note that this is just one way to specify dependencies in a Haskell project, so building this support in the way I describe would only support Haskell projects that choose this tooling. I'm happy to describe other approaches, if you're interested in understanding the broader space.)
Ah yes, in fact. There is a
Sort of both:
(Project README's are handled similarly.) |
I think we'll need a new versioning to handle If there's a lock file then it means we'd want to support "artifacts" updating like quite a few other managers. For changelogs, they might "just work" if the majority of packages (a) define their source repo in metadata, and (b) include a changelog file. It doesn't look like we'll need to use the registry's changelogs. I'd recommend doing this in this order, in separate PRs:
Steps 1 & 2 won't really achieve much on their own, but it's easier to do this incrementally than all in one go. |
Awesome, thanks. Granular steps make total sense, even if the first few don't actually get us there. |
Hi there, You're requesting support for a new package manager. We need to know some basic information about this package manager first. Please copy/paste the new package manager questionnaire, and fill it out in full. Once the questionnaire is filled out we will evaluate if adding support for this manager is something we want to do. Good luck, The Renovate team |
NOTE: I'm answering this questionnaire for the feature of specifically stack-related dependencies. If we want to automatically manage version bounds in a non-Stack project, or library making use of such bounds in its New package manager questionnaireDid you read our documentation on adding a package manager?
BasicsName of package managerStack. What language does this support?Haskell. How popular is this package manager?Probably >50% of Haskell projects us it. Does this language have other (competing?) package managers?
Package File DetectionWhat type of package files and names does it use?
What fileMatch pattern(s) should be used?Can Is it likely that many users would need to extend this pattern for custom file names?
Possible, but not likely, IMO. Is the fileMatch pattern likely to get many "false hits" for files that have nothing to do with package management?No. Parsing and ExtractionCan package files have "local" links to each other that need to be resolved?Yes, Is there a reason why package files need to be parsed together (in serial) instead of independently?I can't think of one. What format/syntax is the package file in?
How do you suggest parsing the file?
Does the package file structure distinguish between different "types" of dependencies? e.g. production dependencies, dev dependencies, etc?
List all the sources/syntaxes of dependencies that can be extractedIn In the case of a path to a custom snapshot, you will find in that file a
Describe which types of dependencies above are supported and which will be implemented in futureVersioningWhat versioning scheme does the package file(s) use?Snapshots, use two formats:
Non-git
Does this versioning scheme support range constraints, e.g.
|
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as spam.
This comment was marked as spam.
Since part of this discussion is about adding a Hackage data source, I thought I'd link #31434, which contains such a data source. Since the data source is necessary for both Cabal and Stack support, maybe we can consolidate our efforts. The PR was closed because we need to discuss requirements first. @secustor requested that I discuss the manager first, so that what I am focusing on in #31493 . @rarkins Wouldn't it be ok if an initial version of the Hackage data source didn't support digests? Hash pinning is optional in @pbrisbin Are you still interested in implementing this? What do you think about the data source I drafted, do you think it could help you? |
you should start on versioning. then datasource and finally on manager. |
@viceice Your order is inconsistent with what I was suggested in #31434 (which is to discuss the manager first). Also, not everyone uses PVP. So I don't understand why versioning need to be done first. |
I read #31434 (comment) differently. It says "discuss manager first, then implement version, datasource, manager in that order in separate PRs". |
I think #32298 with PVP support might get merged soon-ish, and I have the datasource PR ready, which I will submit at that point. |
Hi there- I was trying out the Unfortunately, the logs [possibly-private link] show:
This looks great, updating 0.17.0.0 to 0.18.0.0 is exactly what I wanted renovate to do, but is there some way to solve this range strategy error? |
While searching for how to configure this, I found this PR: So I don't think this is a PVP/Haskell specific issue. When that PR is merged, EDIT: It looks like it won't actually be configurable? Not sure from reading the code whether the |
Hmm, I guess I'm just missing the context on what a range-strategy is or why it matters here. As a user, I just want renovate to replace |
The Haskell related code I wrote has three parts: manager (Cabal), datasource (Hackage) and versioning (PVP). You have a custom manager, so you're obviously not using the Cabal code. It makes sense for you to use the Hackage code, but I wrote the PVP code mainly to handle version ranges, since that is commonly used in Cabal files. Since you're not interested in any comparison of version numbers (as ranges do), maybe it would sense to swap out the versioning. The Hackage datasource should work with other versioning too, it just defaults to using PVP. For example, there is regex versioning which sounds fairly generic. All it really has to be configured to, is to recognize which component in the version has changed. If it's early in the version number, it's a major change. If it's later, it's a minor change. Another option might be loose, which sounds like it would parse a PVP version number successfully too, with no further configuration needed. If regex/loose versioning don't work, maybe this is a use case that could be better supported if I added the I'd like to hear if regex/loose work, first, though. |
Thanks for the suggestion. I changed the versioning to regex and it didn't seem to do anything. The only mention of this dep in the logs is the following DEBUG message: {
"datasourceTemplate": "hackage",
"depNameTemplate": "fourmolu",
"deps": [
{
"currentValue": "0.17.0.0",
"datasource": "hackage",
"depName": "fourmolu",
"packageName": "fourmolu",
"replaceString": "ENV FOURMOLU_VERSION=0.17.0.0\n",
"skipReason": "invalid-value",
"versioning": "regex:^(?<major>[0-9]+\\.[0-9]+)\\.(?<minor>[0-9]+)\\.(?<patch>[0-9]+).$",
"warnings": [],
"updates": []
}
],
"matchStrings": [
"ENV FOURMOLU_VERSION=(?<currentValue>.*?)\\n"
],
"packageFile": "fourmolu/Dockerfile",
"versioningTemplate": "regex:^(?<major>[0-9]+\\.[0-9]+)\\.(?<minor>[0-9]+)\\.(?<patch>[0-9]+).$"
}, I assume This is likely nothing to do with your code though? EDIT: trying |
OK, So fair enough, I can run with that in this case. However, I still think there's a gap in the PVP
The error I got was,
So the missing support is not for any of those, it's for Perhaps its confirmation bias, but this makes sense to me. When used in this context of a custom matcher, there just is no ranges involved. So if some interface somewhere requires one, it passes
|
I think the |
That makes sense, but are you saying "usable with a custom manager" isn't a realistic scenario to support? Can I ask why? |
"Realistic" was a bad word to use. For me, it's really more a question of the expected popularity of the proposed feature. Are you proposing that we expand the PVP range strategy support such that people won't need to specify Custom managers is an advanced use case. It's not something that is used out of the box, it's something you explicitly have to enable and configure. As you have found out, it seems that you need to override versioning in addition to specifying the data source. I don't think this is a horrible user experience, as people using custom managers are already into the weeds of Renovate. As I see it, your use case is already supported in Renovate, it just has to be configured. Previously, I used the wording "fails with an alternative range strategy". I don't think PVP is failing with an alternative range strategy. The reason is that PVP isn't even the right choice when no ranges are involved. As you previously said, things seem to work when configuring The Cabal manager, on the other hand, is enabled by default and works without any configuration. The default range strategy for the Cabal manager is I am trying to address the most pressing issues I see in the Haskell ecosystem. I have spent a lot of time ensuring that packages stay in Stackage Nightly. That's why I added this code to Renovate. I've added documentation to the haskell-action maintained by Andreas Abel, to help Renovate achieve wider adoption. If we can, in addition, get Haskell-CI to nudge users in the direction of Renovate, even more future repos could get automatic dependency bumping out of the box. That's something I see as having a larger potential impact. I need to talk to Oleg (the maintainer of Haskell-CI) about this... I hope that this clarifies some of what motivates me. I am trying not to sound too grumpy, not sure if I am succeeding. I don't own this code, so of course anybody can submit PRs, and I might even help reviewing. |
Thanks for the detailed reply, as someone who also maintains software I understand wanting complexity to be properly motivated by a common enough use-case. And I don't think you sound grumpy. If it seems like I'm pushing back, it's not because I think you're being unreasonable or that I think you're judging some complexity trade-off incorrectly, it's just because I'm still confused as to why certain range support is the complexity required for the user-facing outcome I want, which is just for PVP to work in a custom manager -- where there are no ranges to be found. You're right, tactically speaking. If making PVP specifically support something only needed so it can be used in a custom manager helps 10% of users, then efforts should go elsewhere. The only thing I would say is that I'm trying to raise (poorly) a more strategic and architectural issue here, that could be higher value. Why does use in a custom manager require range support? I just feel like, if a renovate user is configuring a dependency anywhere for any reason, and that dependency in reality uses some versioning that renovate supports, but they can't use that versioning for some technical reason, that's a problem with the technical design. Maybe that problem truly only impacts the intersection of custom managers and PVP, but maybe it's broader, maybe it has knock-on effects, maybe it's a smell worth listening it. 🤷 I realize we've been sort of, "arguing in the mentions" of the project where you don't own these areas of design, so I have no expectations of this going anywhere, I just find it all interesting to discuss. So thanks for engaging, and your continued Haskell work, it's been very helpful to me keeping these dependencies up to date. |
The problem with all of these blue sky ideas is that they span across Renovate, which means they'd need a massive amount of investment to get anywhere. And I am not even sure that developers are philosophically on board. |
What would you like Renovate to be able to do?
I would like renovate-bot to support Haskell, specially Stackage-based projects using an LTS resolver and extra dependencies from Hackage:
Resolver
An overall configuration point in a Stackage-based Haskell project is the
resolver
. For example,resolver: lts-major.minor
. I would like renovate-bot to find this and suggest an update to (for example)resolver: lts-major.(minor + 1)
when it becomes available. There are more resolvers than these LTS versions, but this is our initial use-case.Hackage
While choosing a resolver defines a strict set of exact versions available, you can make additional dependencies available via
extra-deps
:I would like renovate-bot to compare this to what's available on Hackage and suggest updates accordingly. There are other kinds of dependencies that can be specified here, and the
sha256
verification is optional, but this is our initial use-case.Did you already have any implementation ideas?
Yaml configuration can be declared directly in a file, named
stack.yaml
by default:(This path can be changed by configuration, so renovate-bot would have to support that)
Or
stack.yaml
can point to a different file, with slightly different keys:We would need renovate-bot to:
stack.yaml[resolver]
, probably limit things to only work withlts-.*
OR<filepath>
resolver
andpackages
resolver
andexra-deps
directly in this filepackages
/extra-deps
resolver = lts-16.25
,hackage = [bugsnag-haskell, 0.0.4.1]
https://www.stackage.org/lts?_accept=application/json
lts-16.27
https://hackage.haskell.org/package/:name
bugsnag-haskell-0.0.4.1
A changelog can also be scraped from
https://hackage.haskell.org/package/{name}-{version}/changelog
, and thehttps://www.stackage.org/lts?_accept=application/json
response includes any changed dependencies, for which changelogs can also be scraped. It would be amazing to include these changelog details in the renovate PR. We have a project that does some of this work here.I'm willing to try and contribute this support, but I'm having trouble navigating the project enough to know where to add all the moving parts. Would you be able to offer some guidance, given the information above?
The text was updated successfully, but these errors were encountered: