From 3bdcf771852407ea461359333eac5c947171b2e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20Kj=C3=A6r=20Henneberg?= Date: Fri, 15 Mar 2024 04:22:24 +1300 Subject: [PATCH 1/6] ci: Generate SBOM (#245) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## This PR Generates Software Bill of Materials (SBOM) as described in #159. Once https://github.com/NuGet/Home/issues/12497 is implemented, the SBOM file(s) should be embedded in the published nuget packages. Until then, I've added the SBOM as an asset under the release. ### Known issue The SBOM file lists the dependences for all target frameworks combined. Once the above [NuGet ](https://github.com/NuGet/Home/issues/12497)issue is implemented, it should be changed, so there is one sbom created for each target framework with only the applicable references included. ### Related Issues Fixes #159 ### How to test Unfortunately, this is somewhat cumbersome to test, as the logic in question only kicks in upon a release from the main branch. I've tested it myself this way: - Create new fork of this repo - Merge this branch to main in the new repo - Create a release in the new repo Signed-off-by: Jens Henneberg Co-authored-by: AndrΓ© Silva <2493377+askpt@users.noreply.github.com> --- .github/workflows/release.yml | 39 +++++++++++++++++++++++++++++------ 1 file changed, 33 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 859a9078..899c3049 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,7 +6,7 @@ on: - main jobs: - release-package: + release-please: runs-on: ubuntu-latest steps: @@ -16,14 +16,21 @@ jobs: command: manifest token: ${{secrets.GITHUB_TOKEN}} default-branch: main + outputs: + release_created: ${{ steps.release.outputs.release_created }} + release_tag_name: ${{ steps.release.outputs.tag_name }} + release: + runs-on: ubuntu-latest + needs: release-please + if: ${{ needs.release-please.outputs.release_created }} + + steps: - uses: actions/checkout@v4 - if: ${{ steps.release.outputs.releases_created }} with: fetch-depth: 0 - name: Setup .NET SDK - if: ${{ steps.release.outputs.releases_created }} uses: actions/setup-dotnet@v4 env: NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -34,13 +41,33 @@ jobs: source-url: https://nuget.pkg.github.com/open-feature/index.json - name: Install dependencies - if: ${{ steps.release.outputs.releases_created }} run: dotnet restore - name: Pack - if: ${{ steps.release.outputs.releases_created }} run: dotnet pack --no-restore - name: Publish to Nuget - if: ${{ steps.release.outputs.releases_created }} run: dotnet nuget push "src/**/*.nupkg" --api-key "${{ secrets.NUGET_TOKEN }}" --source https://api.nuget.org/v3/index.json + + sbom: + runs-on: ubuntu-latest + needs: release-please + continue-on-error: true + if: ${{ needs.release-please.outputs.release_created }} + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Install CycloneDX.NET + run: dotnet tool install CycloneDX + + - name: Generate .NET BOM + run: dotnet CycloneDX --json --exclude-dev -sv "${{ needs.release-please.outputs.release_tag_name }}" ./src/OpenFeature/OpenFeature.csproj + + - name: Attach SBOM to artifact + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + run: + gh release upload ${{ needs.release-please.outputs.release_tag_name }} bom.json From ab34c16b513ddbd0a53e925baaccd088163fbcc8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 27 Mar 2024 09:03:23 -0400 Subject: [PATCH 2/6] chore(deps): update dependency coverlet.collector to v6.0.2 (#247) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [coverlet.collector](https://togithub.com/coverlet-coverage/coverlet) | `6.0.1` -> `6.0.2` | [![age](https://developer.mend.io/api/mc/badges/age/nuget/coverlet.collector/6.0.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/nuget/coverlet.collector/6.0.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/nuget/coverlet.collector/6.0.1/6.0.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/nuget/coverlet.collector/6.0.1/6.0.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
coverlet-coverage/coverlet (coverlet.collector) ### [`v6.0.2`](https://togithub.com/coverlet-coverage/coverlet/releases/tag/v6.0.2) ##### Fixed - Threshold-stat triggers error [#​1634](https://togithub.com/coverlet-coverage/coverlet/issues/1634) - Fixed coverlet collector 6.0.1 requires dotnet sdk 8 [#​1625](https://togithub.com/coverlet-coverage/coverlet/issues/1625) - Type initializer errors after updating from 6.0.0 to 6.0.1 [#​1629](https://togithub.com/coverlet-coverage/coverlet/issues/1629) - Exception when multiple exclude-by-attribute filters specified [#​1624](https://togithub.com/coverlet-coverage/coverlet/issues/1624) ##### Improvements - More concise options to specify multiple parameters in coverlet.console [#​1624](https://togithub.com/coverlet-coverage/coverlet/issues/1624) [Diff between 6.0.1 and 6.0.2](https://togithub.com/coverlet-coverage/coverlet/compare/v6.0.1...v6.0.2)
--- ### Configuration πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. πŸ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/open-feature/dotnet-sdk). Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 324bf73e..b683b9e7 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -14,7 +14,7 @@ - + From 79def47106b19b316b691fa195f7160ddcfb9a41 Mon Sep 17 00:00:00 2001 From: Weihan Li Date: Thu, 28 Mar 2024 08:03:21 +0800 Subject: [PATCH 3/6] chore(deps): Project file cleanup and remove unnecessary dependencies (#251) ## This PR - simplify the `InternalsVisibleTo` usage - cleanup msbuild condition - remove unnecessary dependencies --------- Signed-off-by: Weihan Li Co-authored-by: Benjamin Evenson <2031163+benjiro@users.noreply.github.com> --- build/Common.props | 4 ++-- src/OpenFeature/OpenFeature.csproj | 15 ++++----------- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/build/Common.props b/build/Common.props index 8468f7d2..b1857e0d 100644 --- a/build/Common.props +++ b/build/Common.props @@ -18,8 +18,8 @@ - - + + diff --git a/src/OpenFeature/OpenFeature.csproj b/src/OpenFeature/OpenFeature.csproj index da82b999..9e272ba2 100644 --- a/src/OpenFeature/OpenFeature.csproj +++ b/src/OpenFeature/OpenFeature.csproj @@ -7,21 +7,14 @@ - - + - - <_Parameter1>OpenFeature.Benchmarks - - - <_Parameter1>OpenFeature.Tests - - - <_Parameter1>OpenFeature.E2ETests - + + + From b4a24094a282e0f7cb26c0c70ff7cf09e8e08991 Mon Sep 17 00:00:00 2001 From: Todd Baert Date: Tue, 9 Apr 2024 08:26:47 -0400 Subject: [PATCH 4/6] chore: support v1 publishing Signed-off-by: Todd Baert --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 899c3049..b4a6a917 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,7 +3,7 @@ name: Run Release Release on: push: branches: - - main + - v1 jobs: release-please: @@ -15,7 +15,7 @@ jobs: with: command: manifest token: ${{secrets.GITHUB_TOKEN}} - default-branch: main + default-branch: v1 outputs: release_created: ${{ steps.release.outputs.release_created }} release_tag_name: ${{ steps.release.outputs.tag_name }} From bd4c6cc8024dc34a8fcb299216cd4199c54c5956 Mon Sep 17 00:00:00 2001 From: Todd Baert Date: Tue, 9 Apr 2024 08:38:17 -0400 Subject: [PATCH 5/6] fix: Add missing error message when an error occured (#258) Backport of https://github.com/open-feature/dotnet-sdk/pull/256 Signed-off-by: Thomas Poignant Co-authored-by: Thomas Poignant --- src/OpenFeature/OpenFeatureClient.cs | 2 +- test/OpenFeature.Tests/OpenFeatureClientTests.cs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/OpenFeature/OpenFeatureClient.cs b/src/OpenFeature/OpenFeatureClient.cs index 56fc518f..8c4dbdd5 100644 --- a/src/OpenFeature/OpenFeatureClient.cs +++ b/src/OpenFeature/OpenFeatureClient.cs @@ -262,7 +262,7 @@ private async Task> EvaluateFlag( { this._logger.LogError(ex, "Error while evaluating flag {FlagKey}", flagKey); var errorCode = ex is InvalidCastException ? ErrorType.TypeMismatch : ErrorType.General; - evaluation = new FlagEvaluationDetails(flagKey, defaultValue, errorCode, Reason.Error, string.Empty); + evaluation = new FlagEvaluationDetails(flagKey, defaultValue, errorCode, Reason.Error, string.Empty, ex.Message); await this.TriggerErrorHooks(allHooksReversed, hookContext, ex, options).ConfigureAwait(false); } finally diff --git a/test/OpenFeature.Tests/OpenFeatureClientTests.cs b/test/OpenFeature.Tests/OpenFeatureClientTests.cs index 86c61f83..3c2384cf 100644 --- a/test/OpenFeature.Tests/OpenFeatureClientTests.cs +++ b/test/OpenFeature.Tests/OpenFeatureClientTests.cs @@ -177,6 +177,7 @@ public async Task OpenFeatureClient_Should_Return_DefaultValue_When_Type_Mismatc var evaluationDetails = await client.GetObjectDetails(flagName, defaultValue); evaluationDetails.ErrorType.Should().Be(ErrorType.TypeMismatch); + evaluationDetails.ErrorMessage.Should().Be(new InvalidCastException().Message); _ = mockedFeatureProvider.Received(1).ResolveStructureValue(flagName, defaultValue, Arg.Any()); From 3ff98b5e28fac84efdc3bde20a9a332dd09c3257 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 9 Apr 2024 14:45:08 +0200 Subject: [PATCH 6/6] chore(v1): release 1.5.1 (#259) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit :robot: I have created a release *beep* *boop* --- ## [1.5.1](https://github.com/open-feature/dotnet-sdk/compare/v1.5.0...v1.5.1) (2024-04-09) ### πŸ› Bug Fixes * Add missing error message when an error occured ([#258](https://github.com/open-feature/dotnet-sdk/issues/258)) ([bd4c6cc](https://github.com/open-feature/dotnet-sdk/commit/bd4c6cc8024dc34a8fcb299216cd4199c54c5956)) ### 🧹 Chore * **deps:** Project file cleanup and remove unnecessary dependencies ([#251](https://github.com/open-feature/dotnet-sdk/issues/251)) ([79def47](https://github.com/open-feature/dotnet-sdk/commit/79def47106b19b316b691fa195f7160ddcfb9a41)) * **deps:** update dependency coverlet.collector to v6.0.2 ([#247](https://github.com/open-feature/dotnet-sdk/issues/247)) ([ab34c16](https://github.com/open-feature/dotnet-sdk/commit/ab34c16b513ddbd0a53e925baaccd088163fbcc8)) * support v1 publishing ([b4a2409](https://github.com/open-feature/dotnet-sdk/commit/b4a24094a282e0f7cb26c0c70ff7cf09e8e08991)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .release-please-manifest.json | 2 +- CHANGELOG.md | 14 ++++++++++++++ README.md | 4 ++-- build/Common.prod.props | 2 +- version.txt | 2 +- 5 files changed, 19 insertions(+), 5 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index dd8fde77..e20d7e81 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.5.0" + ".": "1.5.1" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 929d2c66..1dce653e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## [1.5.1](https://github.com/open-feature/dotnet-sdk/compare/v1.5.0...v1.5.1) (2024-04-09) + + +### πŸ› Bug Fixes + +* Add missing error message when an error occured ([#258](https://github.com/open-feature/dotnet-sdk/issues/258)) ([bd4c6cc](https://github.com/open-feature/dotnet-sdk/commit/bd4c6cc8024dc34a8fcb299216cd4199c54c5956)) + + +### 🧹 Chore + +* **deps:** Project file cleanup and remove unnecessary dependencies ([#251](https://github.com/open-feature/dotnet-sdk/issues/251)) ([79def47](https://github.com/open-feature/dotnet-sdk/commit/79def47106b19b316b691fa195f7160ddcfb9a41)) +* **deps:** update dependency coverlet.collector to v6.0.2 ([#247](https://github.com/open-feature/dotnet-sdk/issues/247)) ([ab34c16](https://github.com/open-feature/dotnet-sdk/commit/ab34c16b513ddbd0a53e925baaccd088163fbcc8)) +* support v1 publishing ([b4a2409](https://github.com/open-feature/dotnet-sdk/commit/b4a24094a282e0f7cb26c0c70ff7cf09e8e08991)) + ## [1.5.0](https://github.com/open-feature/dotnet-sdk/compare/v1.4.1...v1.5.0) (2024-03-12) diff --git a/README.md b/README.md index 6cb3c35c..a7a49f56 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,8 @@ [![Specification](https://img.shields.io/static/v1?label=specification&message=v0.7.0&color=yellow&style=for-the-badge)](https://github.com/open-feature/spec/releases/tag/v0.7.0) [ - ![Release](https://img.shields.io/static/v1?label=release&message=v1.5.0&color=blue&style=for-the-badge) -](https://github.com/open-feature/dotnet-sdk/releases/tag/v1.5.0) + ![Release](https://img.shields.io/static/v1?label=release&message=v1.5.1&color=blue&style=for-the-badge) +](https://github.com/open-feature/dotnet-sdk/releases/tag/v1.5.1) [![Slack](https://img.shields.io/badge/slack-%40cncf%2Fopenfeature-brightgreen?style=flat&logo=slack)](https://cloud-native.slack.com/archives/C0344AANLA1) [![Codecov](https://codecov.io/gh/open-feature/dotnet-sdk/branch/main/graph/badge.svg?token=MONAVJBXUJ)](https://codecov.io/gh/open-feature/dotnet-sdk) diff --git a/build/Common.prod.props b/build/Common.prod.props index 2431a810..0538422c 100644 --- a/build/Common.prod.props +++ b/build/Common.prod.props @@ -9,7 +9,7 @@ - 1.5.0 + 1.5.1 git https://github.com/open-feature/dotnet-sdk OpenFeature is an open standard for feature flag management, created to support a robust feature flag ecosystem using cloud native technologies. OpenFeature will provide a unified API and SDK, and a developer-first, cloud-native implementation, with extensibility for open source and commercial offerings. diff --git a/version.txt b/version.txt index bc80560f..26ca5946 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.5.0 +1.5.1