Skip to content

Commit 7cc8e63

Browse files
committed
Merge branch 'main' into askpt/192-feature-implement-flag-metadata
2 parents 81ef36e + 7eebcdd commit 7cc8e63

File tree

15 files changed

+230
-94
lines changed

15 files changed

+230
-94
lines changed

.github/workflows/ci.yml

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Test
1+
name: CI
22

33
on:
44
push:
@@ -11,44 +11,41 @@ on:
1111
- '**.md'
1212

1313
jobs:
14-
unit-tests-linux:
15-
runs-on: ubuntu-latest
16-
steps:
17-
- uses: actions/checkout@v4
18-
with:
19-
fetch-depth: 0
14+
build:
15+
strategy:
16+
matrix:
17+
os: [ ubuntu-latest, windows-latest ]
2018

21-
- name: Setup .NET SDK
22-
uses: actions/setup-dotnet@v4
23-
with:
24-
dotnet-version: |
25-
6.0.x
26-
7.0.x
27-
28-
- name: Run Tests
29-
run: dotnet test test/OpenFeature.Tests/ --configuration Release --logger GitHubActions
19+
runs-on: ${{ matrix.os }}
3020

31-
unit-tests-windows:
32-
runs-on: windows-latest
3321
steps:
34-
- uses: actions/checkout@v4
22+
- name: Checkout
23+
uses: actions/checkout@v4
3524
with:
3625
fetch-depth: 0
26+
submodules: recursive
3727

3828
- name: Setup .NET SDK
3929
uses: actions/setup-dotnet@v4
30+
env:
31+
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4032
with:
4133
dotnet-version: |
4234
6.0.x
4335
7.0.x
36+
source-url: https://nuget.pkg.github.com/open-feature/index.json
37+
38+
- name: Restore
39+
run: dotnet restore
40+
41+
- name: Build
42+
run: dotnet build --no-restore
4443

45-
- name: Run Tests
46-
run: dotnet test test\OpenFeature.Tests\ --configuration Release --logger GitHubActions
44+
- name: Test
45+
run: dotnet test --no-build --logger GitHubActions
4746

4847
packaging:
49-
needs:
50-
- unit-tests-linux
51-
- unit-tests-windows
48+
needs: build
5249

5350
permissions:
5451
contents: read
@@ -57,14 +54,21 @@ jobs:
5754
runs-on: ubuntu-latest
5855

5956
steps:
60-
- uses: actions/checkout@v4
57+
- name: Checkout
58+
uses: actions/checkout@v4
59+
with:
60+
fetch-depth: 0
61+
submodules: recursive
6162

6263
- name: Setup .NET SDK
6364
uses: actions/setup-dotnet@v4
65+
env:
66+
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6467
with:
6568
dotnet-version: |
6669
6.0.x
6770
7.0.x
71+
source-url: https://nuget.pkg.github.com/open-feature/index.json
6872

6973
- name: Restore
7074
run: dotnet restore

.github/workflows/code-coverage.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@ on:
1212

1313
jobs:
1414
build-test-report:
15-
runs-on: ubuntu-latest
16-
env:
17-
OS: ${{ matrix.os }}
15+
strategy:
16+
matrix:
17+
os: [ ubuntu-latest, windows-latest ]
18+
19+
runs-on: ${{ matrix.os }}
1820

1921
steps:
2022
- uses: actions/checkout@v4
@@ -23,13 +25,19 @@ jobs:
2325

2426
- name: Setup .NET SDK
2527
uses: actions/setup-dotnet@v4
28+
env:
29+
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
with:
31+
dotnet-version: |
32+
6.0.x
33+
7.0.x
34+
source-url: https://nuget.pkg.github.com/open-feature/index.json
2635

2736
- name: Run Test
2837
run: dotnet test --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
2938

30-
- uses: codecov/[email protected].4
39+
- uses: codecov/[email protected].5
3140
with:
32-
env_vars: OS
3341
name: Code Coverage for ${{ matrix.os }}
3442
fail_ci_if_error: true
3543
verbose: true

.github/workflows/e2e.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,13 @@ jobs:
2525

2626
- name: Setup .NET SDK
2727
uses: actions/setup-dotnet@v4
28+
env:
29+
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2830
with:
2931
dotnet-version: |
3032
6.0.x
3133
7.0.x
34+
source-url: https://nuget.pkg.github.com/open-feature/index.json
3235

3336
- name: Initialize Tests
3437
run: |

.github/workflows/release.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,13 @@ jobs:
2525
- name: Setup .NET SDK
2626
if: ${{ steps.release.outputs.releases_created }}
2727
uses: actions/setup-dotnet@v4
28+
env:
29+
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2830
with:
2931
dotnet-version: |
3032
6.0.x
3133
7.0.x
34+
source-url: https://nuget.pkg.github.com/open-feature/index.json
3235

3336
- name: Install dependencies
3437
if: ${{ steps.release.outputs.releases_created }}

CONTRIBUTING.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,3 +155,38 @@ dotnet restore
155155
dotnet build --configuration Release --output "./release" --no-restore
156156
dotnet release/OpenFeature.Benchmarks.dll
157157
```
158+
159+
## Consuming pre-release packages
160+
161+
1. Acquire a [GitHub personal access token (PAT)](https://docs.github.com/github/authenticating-to-github/creating-a-personal-access-token) scoped for `read:packages` and verify the permissions:
162+
```console
163+
$ gh auth login --scopes read:packages
164+
165+
? What account do you want to log into? GitHub.com
166+
? What is your preferred protocol for Git operations? HTTPS
167+
? How would you like to authenticate GitHub CLI? Login with a web browser
168+
169+
! First copy your one-time code: ****-****
170+
Press Enter to open github.com in your browser...
171+
172+
✓ Authentication complete.
173+
- gh config set -h github.com git_protocol https
174+
✓ Configured git protocol
175+
✓ Logged in as ********
176+
```
177+
178+
```console
179+
$ gh auth status
180+
181+
github.com
182+
✓ Logged in to github.com as ******** (~/.config/gh/hosts.yml)
183+
✓ Git operations for github.com configured to use https protocol.
184+
✓ Token: gho_************************************
185+
✓ Token scopes: gist, read:org, read:packages, repo, workflow
186+
```
187+
2. Run the following command to configure your local environment to consume packages from GitHub Packages:
188+
```console
189+
$ dotnet nuget update source github-open-feature --username $(gh api user --jq .email) --password $(gh auth token) --store-password-in-clear-text
190+
191+
Package source "github-open-feature" was successfully updated.
192+
```

Directory.Packages.props

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<Project>
2+
3+
<PropertyGroup>
4+
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
5+
</PropertyGroup>
6+
7+
<ItemGroup Label="src">
8+
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
9+
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="2.0.0" />
10+
<PackageVersion Include="System.Collections.Immutable" Version="1.7.1" />
11+
<PackageVersion Include="System.Threading.Channels" Version="6.0.0" />
12+
</ItemGroup>
13+
14+
<ItemGroup Label="test">
15+
<PackageVersion Include="AutoFixture" Version="4.17.0" />
16+
<PackageVersion Include="BenchmarkDotNet" Version="0.13.1" />
17+
<PackageVersion Include="coverlet.collector" Version="3.1.2" />
18+
<PackageVersion Include="coverlet.msbuild" Version="3.1.2" />
19+
<PackageVersion Include="FluentAssertions" Version="6.7.0" />
20+
<PackageVersion Include="GitHubActionsTestLogger" Version="2.3.3" />
21+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
22+
<PackageVersion Include="NSubstitute" Version="5.0.0" />
23+
<PackageVersion Include="OpenFeature.Contrib.Providers.Flagd" Version="0.1.5" />
24+
<PackageVersion Include="SpecFlow" Version="3.9.74" />
25+
<PackageVersion Include="SpecFlow.Tools.MsBuild.Generation" Version="3.9.74" />
26+
<PackageVersion Include="SpecFlow.xUnit" Version="3.9.74" />
27+
<PackageVersion Include="xunit" Version="[2.4.1, 3.0)" />
28+
<PackageVersion Include="xunit.runner.visualstudio" Version="[2.4.3, 3.0)" />
29+
</ItemGroup>
30+
31+
<ItemGroup Condition="'$(OS)' == 'Unix'">
32+
<PackageVersion Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" />
33+
</ItemGroup>
34+
35+
</Project>

OpenFeature.sln

Lines changed: 61 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,61 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 17
44
VisualStudioVersion = 17.4.33213.308
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenFeature", "src\OpenFeature\OpenFeature.csproj", "{07A6E6BD-FB7E-4B3B-9CBE-65AE9D0EB223}"
6+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".", ".", "{E8916D4F-B97E-42D6-8620-ED410A106F94}"
7+
ProjectSection(SolutionItems) = preProject
8+
README.md = README.md
9+
CONTRIBUTING.md = CONTRIBUTING.md
10+
.editorconfig = .editorconfig
11+
.gitignore = .gitignore
12+
.gitmodules = .gitmodules
13+
.release-please-manifest.json = .release-please-manifest.json
14+
CHANGELOG.md = CHANGELOG.md
15+
CODEOWNERS = CODEOWNERS
16+
global.json = global.json
17+
LICENSE = LICENSE
18+
release-please-config.json = release-please-config.json
19+
renovate.json = renovate.json
20+
version.txt = version.txt
21+
EndProjectSection
722
EndProject
8-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{72005F60-C2E8-40BF-AE95-893635134D7D}"
23+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".config", ".config", "{9392E03B-4E6B-434C-8553-B859424388B1}"
924
ProjectSection(SolutionItems) = preProject
25+
.config\dotnet-tools.json = .config\dotnet-tools.json
26+
EndProjectSection
27+
EndProject
28+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{2B172AA0-A5A6-4D94-BA1F-B79D59B0C2D8}"
29+
EndProject
30+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{C4746B8C-FE19-440B-922C-C2377F906FE8}"
31+
ProjectSection(SolutionItems) = preProject
32+
.github\workflows\ci.yml = .github\workflows\ci.yml
1033
.github\workflows\code-coverage.yml = .github\workflows\code-coverage.yml
1134
.github\workflows\codeql-analysis.yml = .github\workflows\codeql-analysis.yml
12-
build\Common.prod.props = build\Common.prod.props
13-
build\Common.props = build\Common.props
14-
build\Common.tests.props = build\Common.tests.props
15-
CONTRIBUTING.md = CONTRIBUTING.md
1635
.github\workflows\dotnet-format.yml = .github\workflows\dotnet-format.yml
36+
.github\workflows\e2e.yml = .github\workflows\e2e.yml
1737
.github\workflows\lint-pr.yml = .github\workflows\lint-pr.yml
18-
.github\workflows\linux-ci.yml = .github\workflows\linux-ci.yml
19-
README.md = README.md
2038
.github\workflows\release.yml = .github\workflows\release.yml
21-
.github\workflows\windows-ci.yml = .github\workflows\windows-ci.yml
39+
EndProjectSection
40+
EndProject
41+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ISSUE_TEMPLATE", "ISSUE_TEMPLATE", "{09BAB3A2-E94C-490A-861C-7D1E11BB7024}"
42+
ProjectSection(SolutionItems) = preProject
43+
.github\ISSUE_TEMPLATE\bug.yaml = .github\ISSUE_TEMPLATE\bug.yaml
44+
.github\ISSUE_TEMPLATE\documentation.yaml = .github\ISSUE_TEMPLATE\documentation.yaml
45+
.github\ISSUE_TEMPLATE\feature.yaml = .github\ISSUE_TEMPLATE\feature.yaml
46+
EndProjectSection
47+
EndProject
48+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".vscode", ".vscode", "{4BB69DB3-9653-4197-9589-37FA6D658CB7}"
49+
ProjectSection(SolutionItems) = preProject
50+
.vscode\launch.json = .vscode\launch.json
51+
.vscode\tasks.json = .vscode\tasks.json
52+
EndProjectSection
53+
EndProject
54+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{72005F60-C2E8-40BF-AE95-893635134D7D}"
55+
ProjectSection(SolutionItems) = preProject
56+
build\Common.prod.props = build\Common.prod.props
57+
build\Common.props = build\Common.props
58+
build\Common.tests.props = build\Common.tests.props
59+
build\openfeature-icon.png = build\openfeature-icon.png
60+
build\xunit.runner.json = build\xunit.runner.json
2261
EndProjectSection
2362
EndProject
2463
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{C97E9975-E10A-4817-AE2C-4DD69C3C02D4}"
@@ -32,6 +71,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{65FBA159-2
3271
test\Directory.Build.props = test\Directory.Build.props
3372
EndProjectSection
3473
EndProject
74+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenFeature", "src\OpenFeature\OpenFeature.csproj", "{07A6E6BD-FB7E-4B3B-9CBE-65AE9D0EB223}"
75+
EndProject
3576
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenFeature.Tests", "test\OpenFeature.Tests\OpenFeature.Tests.csproj", "{49BB42BA-10A6-4DA3-A7D5-38C968D57837}"
3677
EndProject
3778
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenFeature.Benchmarks", "test\OpenFeature.Benchmarks\OpenFeature.Benchmarks.csproj", "{90E7EAD3-251E-4490-AF78-E758E33518E5}"
@@ -52,6 +93,10 @@ Global
5293
{49BB42BA-10A6-4DA3-A7D5-38C968D57837}.Debug|Any CPU.Build.0 = Debug|Any CPU
5394
{49BB42BA-10A6-4DA3-A7D5-38C968D57837}.Release|Any CPU.ActiveCfg = Release|Any CPU
5495
{49BB42BA-10A6-4DA3-A7D5-38C968D57837}.Release|Any CPU.Build.0 = Release|Any CPU
96+
{90E7EAD3-251E-4490-AF78-E758E33518E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
97+
{90E7EAD3-251E-4490-AF78-E758E33518E5}.Debug|Any CPU.Build.0 = Debug|Any CPU
98+
{90E7EAD3-251E-4490-AF78-E758E33518E5}.Release|Any CPU.ActiveCfg = Release|Any CPU
99+
{90E7EAD3-251E-4490-AF78-E758E33518E5}.Release|Any CPU.Build.0 = Release|Any CPU
55100
{7398C446-2630-4F8C-9278-4E807720E9E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
56101
{7398C446-2630-4F8C-9278-4E807720E9E5}.Debug|Any CPU.Build.0 = Debug|Any CPU
57102
{7398C446-2630-4F8C-9278-4E807720E9E5}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -63,7 +108,14 @@ Global
63108
GlobalSection(NestedProjects) = preSolution
64109
{07A6E6BD-FB7E-4B3B-9CBE-65AE9D0EB223} = {C97E9975-E10A-4817-AE2C-4DD69C3C02D4}
65110
{49BB42BA-10A6-4DA3-A7D5-38C968D57837} = {65FBA159-23E0-4CF9-881B-F78DBFF198E9}
111+
{90E7EAD3-251E-4490-AF78-E758E33518E5} = {65FBA159-23E0-4CF9-881B-F78DBFF198E9}
66112
{7398C446-2630-4F8C-9278-4E807720E9E5} = {65FBA159-23E0-4CF9-881B-F78DBFF198E9}
113+
{C4746B8C-FE19-440B-922C-C2377F906FE8} = {2B172AA0-A5A6-4D94-BA1F-B79D59B0C2D8}
114+
{09BAB3A2-E94C-490A-861C-7D1E11BB7024} = {2B172AA0-A5A6-4D94-BA1F-B79D59B0C2D8}
115+
{72005F60-C2E8-40BF-AE95-893635134D7D} = {E8916D4F-B97E-42D6-8620-ED410A106F94}
116+
{9392E03B-4E6B-434C-8553-B859424388B1} = {E8916D4F-B97E-42D6-8620-ED410A106F94}
117+
{2B172AA0-A5A6-4D94-BA1F-B79D59B0C2D8} = {E8916D4F-B97E-42D6-8620-ED410A106F94}
118+
{4BB69DB3-9653-4197-9589-37FA6D658CB7} = {E8916D4F-B97E-42D6-8620-ED410A106F94}
67119
EndGlobalSection
68120
GlobalSection(ExtensibilityGlobals) = postSolution
69121
SolutionGuid = {41F01B78-FB06-404F-8AD0-6ED6973F948F}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public async Task Example()
8080
|| [Shutdown](#shutdown) | Gracefully clean up a provider during application shutdown. |
8181
|| [Extending](#extending) | Extend OpenFeature with custom providers and hooks. |
8282

83-
_Implemented: ✅ | In-progress: ⚠️ | Not implemented yet: ❌_
83+
> Implemented: ✅ | In-progress: ⚠️ | Not implemented yet: ❌
8484
8585
### Providers
8686

build/Common.props

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,12 @@
1414
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
1515
</PropertyGroup>
1616

17-
<PropertyGroup Label="Package versions used in this repository">
18-
<!--
19-
Please sort alphabetically.
20-
Refer to https://docs.microsoft.com/nuget/concepts/package-versioning for semver syntax.
21-
-->
22-
<MicrosoftBclAsyncInterfacesVer>[8.0.0,)</MicrosoftBclAsyncInterfacesVer>
23-
<MicrosoftExtensionsLoggerVer>[2.0,)</MicrosoftExtensionsLoggerVer>
24-
</PropertyGroup>
25-
2617
<ItemGroup>
27-
<PackageReference Include="System.Collections.Immutable" Version="[1.7.1,)" />
28-
<PackageReference Include="System.Threading.Channels" Version="[6.0.0,)" />
18+
<PackageReference Include="System.Collections.Immutable" />
19+
<PackageReference Include="System.Threading.Channels" />
2920
</ItemGroup>
3021

3122
<ItemGroup Condition="'$(OS)' == 'Unix'">
32-
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="all" />
23+
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" PrivateAssets="all" />
3324
</ItemGroup>
3425
</Project>

build/Common.tests.props

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,6 @@
1616
</ItemGroup>
1717

1818
<ItemGroup>
19-
<PackageReference Include="GitHubActionsTestLogger" Version="$(GitHubActionsTestLoggerVer)" />
19+
<PackageReference Include="GitHubActionsTestLogger" />
2020
</ItemGroup>
21-
22-
<PropertyGroup Label="Package versions used in this repository">
23-
<!--
24-
Please sort alphabetically.
25-
Refer to https://docs.microsoft.com/nuget/concepts/package-versioning for semver syntax.
26-
-->
27-
<AutoFixtureVer>[4.17.0]</AutoFixtureVer>
28-
<BenchmarkDotNetVer>[0.13.1]</BenchmarkDotNetVer>
29-
<CoverletCollectorVer>[3.1.2]</CoverletCollectorVer>
30-
<FluentAssertionsVer>[6.7.0]</FluentAssertionsVer>
31-
<GitHubActionsTestLoggerVer>[2.3.3]</GitHubActionsTestLoggerVer>
32-
<MicrosoftNETTestSdkPkgVer>[17.2.0]</MicrosoftNETTestSdkPkgVer>
33-
<NSubstituteVer>[5.0.0]</NSubstituteVer>
34-
<XUnitRunnerVisualStudioPkgVer>[2.4.3,3.0)</XUnitRunnerVisualStudioPkgVer>
35-
<XUnitPkgVer>[2.4.1,3.0)</XUnitPkgVer>
36-
</PropertyGroup>
3721
</Project>

0 commit comments

Comments
 (0)