-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
[ASPNETCORE] Add support for central package version management #20192
base: master
Are you sure you want to change the base?
[ASPNETCORE] Add support for central package version management #20192
Conversation
https://github.com/OpenAPITools/openapi-generator/actions/runs/12040139303/job/33660370623?pr=20192 i don't think .net 9.0 is supported by the aspnetcore generator at the moment, and we welcome PRs with such enhancement. |
That wasn't on purpose. It was left from my changes regarding .net9. I corrected it Btw. can I set a PR to squash merge? |
…sion-management-option
pushed a commit with updated samples and docs. let's see how that goes |
can you please review the build errors (e.g. https://github.com/OpenAPITools/openapi-generator/actions/runs/12092892132/job/33723209893?pr=20192) when you've time? |
Done |
do you have Windows Subsystem for Linux (WSL) installed (assuming you're using Windows)? you can try to run the script to update the samples under WSL. |
Using WSL worked |
{{#centralizedPackageVersionManagementOptOut}} | ||
<ManagePackageVersionsCentrally>false</ManagePackageVersionsCentrally> | ||
{{/centralizedPackageVersionManagementOptOut}} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we simplify this to just one option (e.g. managePackageVersionsCentrally, which is a string, not boolean)?
{{#ManagePackageVersionsCentrally}}
<ManagePackageVersionsCentrally>{{{.}}}</ManagePackageVersionsCentrally>
{{/ManagePackageVersionsCentrally}}
if it's set to false
, add another additional properties skipVersion
for below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand you correctly that would mean when setting it to false it has a different behaviour than dont setting it at all?
Personally I dont like this. As a user I would expect that if I dont set it at all it would do the same as false. If you want to have only one option though, we could use a enum with "true", "opt-out", "default". Not setting it would use the default option
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a user I would expect that if I dont set it at all it would do the same as false
we can default the option to false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could, but not having the property in the .csproj file and setting the property to false are very different things
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
we could use a enum with "true", "opt-out", "default". Not setting it would use the default option
what about having 3 values in a single option instead as you suggested earlier?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be automatic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you take a look the the last commit? I cant figure out why it doesnt validate correctly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried everything I could think of but I still cant get it to validate that the value is one of the enums. How do we procede with this pr?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll try to find time this week to address the remaining piece and then get this PR merged to move it forward.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks :)
This pr adds support for using centralized package version management.
For this two options were added:
Setting useCentralizedPackageVersionManagement true will add the
ManagePackageVersionsCentrally
property to the csproj file, set the value to true and remove explicit versions from packagesSetting useCentralizedPackageVersionManagement true will add the
ManagePackageVersionsCentrally
property to the csproj file and set the value to falseTemplate files for both kinds of projects were updated accordingly.
A sample with
useCentralizedPackageVersionManagement: true
was addedTechnical Committee mentions:
@mandrean @shibayan @Blackclaws @lucamazzanti @iBicha
PR checklist
Commit all changed files.
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*
.IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
master
(upcoming7.x.0
minor release - breaking changes with fallbacks),8.0.x
(breaking changes without fallbacks)