-
Notifications
You must be signed in to change notification settings - Fork 25
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
chore: Enable Central Package Management (CPM) #136
Closed
austindrenski
wants to merge
1
commit into
open-feature:main
from
austindrenski:central-package-management
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<Project> | ||
|
||
<PropertyGroup> | ||
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageVersion Include="ConfigCat.Client" Version="9.0.0" /> | ||
<PackageVersion Include="Flagsmith" Version="5.2.2" /> | ||
<PackageVersion Include="Google.Protobuf" Version="3.23.4" /> | ||
<PackageVersion Include="Grpc" Version="2.46.6" /> | ||
<PackageVersion Include="Grpc.Net.Client" Version="2.59.0" /> | ||
<PackageVersion Include="Grpc.Tools" Version="2.60.0" /> | ||
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" /> | ||
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" /> | ||
<PackageVersion Include="Microsoft.FeatureManagement" Version="4.0.0-preview" /> | ||
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="[1.0.0, 2.0)" /> | ||
<PackageVersion Include="OpenFeature" Version="[1.2,)" /> | ||
<PackageVersion Include="OpenTelemetry" Version="1.4.0" /> | ||
<PackageVersion Include="OpenTelemetry.Api" Version="1.4.0" /> | ||
<PackageVersion Include="OpenTelemetry.Exporter.InMemory" Version="1.4.0" /> | ||
<PackageVersion Include="System.Net.Http.WinHttpHandler" Version="8.0.0" /> | ||
<PackageVersion Include="System.Text.Json" Version="8.0.1" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageVersion Include="AutoFixture" Version="4.17.0" /> | ||
<PackageVersion Include="AutoFixture.Xunit2" Version="4.17.0" /> | ||
<PackageVersion Include="coverlet.collector" Version="3.1.2" /> | ||
<PackageVersion Include="coverlet.msbuild" Version="3.1.2" /> | ||
<PackageVersion Include="FluentAssertions" Version="6.7.0" /> | ||
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.3.2" /> | ||
<PackageVersion Include="NSubstitute" Version="5.0.0" /> | ||
<PackageVersion Include="RichardSzalay.MockHttp" Version="6.0.0" /> | ||
<PackageVersion Include="xunit" Version="[2.4.1, 3.0)" /> | ||
<PackageVersion Include="xunit.runner.visualstudio" Version="[2.4.3, 3.0)" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...ture.Contrib.Providers.ConfigCat.Test/OpenFeature.Contrib.Providers.ConfigCat.Test.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="AutoFixture.Xunit2" Version="4.17.0" /> | ||
<PackageReference Include="AutoFixture.Xunit2" /> | ||
<ProjectReference Include="..\..\src\OpenFeature.Contrib.Providers.ConfigCat\OpenFeature.Contrib.Providers.ConfigCat.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
A potential downside of this is that "provider-unique" dependencies like this "ConfigCat.Client" are now centrally maintained. That's not ideal, particularly for such cases because it doesn't benefit from the ownerships defined here.
Before this change, owners of the provider that uses
ConfigCat.Client
would be responsible for that dependency, and alerted to automated updates pertaining to it.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.
Hmmm, that's an interesting point!
I don't have a pre-canned solution, but I bet we could add a workflow that reacts to
dependabot
/renovate
PRs and tags component owners if the dependency being updated is referenced by their component'scsproj
.Assuming we can live with a minor coverage gap for a little while, I'll see if I can hack something together this weekend.
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.
For such cases we can omit the specific package from the
Directoty.Packages.props
and keep the reference only in the project file.The only difference is the use of
VersionOverride
instead ofVersion
.So for ConfigCat provider, we would have this line in the csproj.
I don't know how bots will behave with such config though.
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.
Very interesting and valid point. @austindrenski I remember playing around with the CPM and as far as I remember all projects within the solution needed to be using CPM as soon as it was enabled. Please correct me if I'm wrong.
Due to the nature of this repository, perhaps makes sense to keep the package versions managed by the project rather than a central place.
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.
For dependencies like
ConfigCat.Client
, is there any reason we can't leave them only in the package that uses them, while maintaining only the common, less-specific deps centrally? This is basically what we do with the pom.xml setup in the java contrib.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 we leave only the specific packages in each project, this PR adds no value, as we already have
Common.props
controlling versions centrally.Is it worth moving to CPM?
I don't see any specific project referencing the same package outside
Common.props
.We would have value if more projects started to use common packages, but not all of them. Even though those packages are not supposed to be used together, having different dependency versions could be fine.
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.
Pretty sure they've added relief valves to make it less of an all-or-nothing, one such being the
VersionOverride="..."
mentioned by @luizbon, so I don't think the answer is to pull back from CPM, just a matter of tweaking a few things.My order of preferences here would be:I started writing up a couple of options, but after typing up the alternatives, I think there's one solution that'll cover all of our bases/concerns:
Directory.Packages.props
remains the authoritative source for dependency versions<ItemGroup>
's for component-specific dependenciesVersionOverride="..."
remains available for use as a relief valveDirectory.Packages.props
; if a common/shared dependency is used by two or more components and there's a version conflict, the lower of the versions is pinned where necessary withVersionOverride="..."
(with the goal being to keep dependencies up to date and discourage long-term pinning)gh
andgrep
) toLabel
attr from the dependency's parent<ItemGroup>
.github/component_owners.yml
using the key from (1)gh pr edit "$PR_NUMBER" --add-assignee "$(gh pr view "$PR_NUMBER" --json author --jq .author.login)"
So in practice, here's what the
Directory.Packages.props
would look like today (i.e. as of this PR):then we'd wire up the reviews using something like:
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.
@luizbon wrote (emphasis added):
Didn't see this before posting my previous reply, but wanted to respond to this specifically:
I hear where you're coming from on this, but when it comes to repo engineering, I think there's value in using standard mechanisms whenever possible, even if they don't necessarily provide "more" than what our custom mechanism does.
So a couple of years ago, I would've been all for the
Common.props
pattern, because it definitely beats tracking versions in eachcsproj
, but in a post-CPM world, I have a growing preference for just using the built-in features where possible/practical.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.
This is a good discussion @austindrenski.
Either approach will achieve the goal.
However, I don't see the use of
Common.props
as a non-standard way of tracking package versions. It is a supported solution to stop the repetition across projects, and the version is one of them.Indeed, CPM is a more elegant/modern solution for package control, but this specific project structure adds more complexity than solves the problem.
Adding more customisation to the workflow is proof of that.
Sorry to say, but I still don't see value in adding CPM to this repo.
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.
Closing the loop here: yes, you are all correct, and I'm afraid I just outright misunderstood the governance of this repo 🤦🤦🤦
Given that this repo is for co-hosting/-locating contributor-maintained projects that should be able to evolve and release independently, this PR is indeed the wrong approach.
Thanks for your patience while I caught up with what you were saying @luizbon and @toddbaert 🙇🙇🙇