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

Target Cake version #964

Open
pascalberger opened this issue Jul 3, 2023 · 6 comments
Open

Target Cake version #964

pascalberger opened this issue Jul 3, 2023 · 6 comments

Comments

@pascalberger
Copy link
Member

Version 3.6.133 of Cake.GitVersioning seems to be build against Cake 2.3, while version 3.6.128 was build against Cake 3.0 (see cake-build/website#2629). Was there a specific reason for this?

Please note that it is recommended to build against the lowest API compatible version as long as no specific features are required (which would be 2.0 & 3.0).

@KalleOlaviNiemitalo
Copy link

KalleOlaviNiemitalo commented Jul 3, 2023

The Cake 3.0 dependency was added in #867, reported as a problem in #934, and reverted in #938.

Earlier, the Cake dependency had been upgraded from 0.33 to 1.1 in #575, to 2.2 in #770, and to 2.3 in #850. I don't know if anyone requested 2.0 before.

@pascalberger
Copy link
Member Author

From a Cake perspective, if you want to support Cake 2.x best practice is to reference Cake 2.0. Expect you require some specific features only available in 2.x versions. See also Best practices for writing addins. If you reference specific Cake 2.x versions (e.g. 2.2) it might result in errors for people running earlier versions of Cake.

Please also note that Cake 3.0 is a breaking change compared to 2.x. If you reference Cake 2.x in your addin, there's no guarantee that it will work on Cake 3.0. You need to decide which version you want to support.

@KalleOlaviNiemitalo
Copy link

The source code in src/Cake.GitVersioning/ uses very little Cake API. The GitVersioningAliases class is decorated with CakeAliasCategoryAttribute, and its two methods are decorated with CakeMethodAliasAttribute and take an ICakeContext parameter; but they do not use the parameter. If these are now working OK in Cake 2.0 and 3.0, then I expect they won't break in future Cake 3.x versions.

@KalleOlaviNiemitalo
Copy link

Security Policy says Cake 2.x.x is supported. Does that mean all 2.x.x versions, or only the latest 2.x.x version? I mean, if it's only the latest, then users shouldn't run versions lower than 2.3.0, and that makes it less important to downgrade the dependency to 2.0.0.

@pascalberger
Copy link
Member Author

Which releases has nothing todo with what version an addin is compatible with. Cake 3.0 is a breaking release. It's up to you what version of Cake you want to reference. And of course you can reference Cake 2.3, but I don't see the advantage in it, compared to reference Cake 2.0. Are there issues with referencing Cake 2.3, compared to 2.0? Maybe, maybe not.

@AArnott
Copy link
Collaborator

AArnott commented Jul 5, 2023

@pascalberger We reference 2.x as @KalleOlaviNiemitalo said. Consider that our soft decision.

I don't use Cake myself. Cake support in this repo was added by a volunteer and no one has really maintained it. Dependabot suggests update which I tend to accept for Cake since I am not familiar with it. So as to the question of whether we want to support cake v2 or v3, I guess that should depend on the user count across those two versions. NB.GV should probably target whatever version of Cake will help the most users.

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

No branches or pull requests

3 participants