Skip to content

Commit

Permalink
refactor: Split Operator in several packages (#605)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: This removes several features from the
7.x version. Required / missing features will
be added to the v8 again. As for the first
pre release, only the simple watcher and
reconciliation loop is present. No finalizer, events, leadership,
whatsoever is present in the library. The initial pre.0
release is meant to be the base for further implementations.
V8 will - hopefully - contain all required features again.

BREAKING CHANGE: The operator does not have commands
and command line executions packaged into the library.
A new dotnet tool is required for CRD generation and
other generators.

BREAKING CHANGE: All abstractions are extracted into
a KubeOps.Abstractions package.

BREAKING CHANGE: The operator is not required to have
ASP.net as default, it works with a normal console
host application as well.

BREAKING CHANGE: `master` is renamed to `main` and
maintenance and release branches are added.
  • Loading branch information
buehler authored Sep 22, 2023
1 parent 1602b1c commit caa92e3
Show file tree
Hide file tree
Showing 346 changed files with 2,628 additions and 258 deletions.
12 changes: 12 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": 1,
"isRoot": true,
"tools": {
"docfx": {
"version": "2.70.4",
"commands": [
"docfx"
]
}
}
}
13 changes: 12 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ root = true
# All files
[*]
indent_style = space
max_line_length = 120

# Xml files
[*.xml]
Expand All @@ -19,7 +20,7 @@ tab_width = 4

# New line preferences
end_of_line = crlf
insert_final_newline = false
insert_final_newline = true

#### Custom Analyzer Rules ####

Expand All @@ -45,6 +46,16 @@ dotnet_diagnostic.SA1649.severity = none
dotnet_diagnostic.RCS1029.severity = none
dotnet_diagnostic.RCS1090.severity = none

#### Custom Coding Conventions ####
resharper_csharp_space_in_singleline_accessorholder = true
resharper_csharp_space_between_accessors_in_singleline_property = true
resharper_csharp_space_in_singleline_method = true
resharper_csharp_space_in_singleline_anonymous_method = true
resharper_csharp_space_within_single_line_array_initializer_braces = true
resharper_csharp_trailing_comma_in_multiline_lists = true
resharper_csharp_place_type_attribute_on_same_line = false
resharper_csharp_place_attribute_on_same_line = false

#### .NET Coding Conventions ####
[*.{cs,vb}]

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dotnet-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: .NET Release
on:
push:
branches:
- master
- next
- main
- release

jobs:
semantic-release:
Expand Down
35 changes: 6 additions & 29 deletions .github/workflows/dotnet-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,14 @@ on:
branches:
- "**"

concurrency:
group: testing
cancel-in-progress: true

jobs:
test:
name: Execute Test ${{ matrix.project }}
name: Testing
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
include:
- project: KubeOps.KubernetesClient.Test
kubernetes: true
- project: KubeOps.Test
kubernetes: false
- project: KubeOps.Templates.Test
kubernetes: false
- project: KubeOps.TestOperator.Test
kubernetes: false
steps:
- uses: actions/checkout@v3

Expand All @@ -31,21 +23,6 @@ jobs:

- name: Create Kubernetes Cluster
uses: helm/[email protected]
if: ${{ matrix.kubernetes == true }}

- name: Execute Tests
run: dotnet test --configuration Release tests/${{ matrix.project }}

result:
if: ${{ always() }}
runs-on: ubuntu-latest
name: Final Results
needs: [test]
steps:
- run: |
result="${{ needs.test.result }}"
if [[ $result == "success" || $result == "skipped" ]]; then
exit 0
else
exit 1
fi
run: dotnet test --configuration Release
51 changes: 7 additions & 44 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Deploy GitHub Pages
on:
push:
branches:
- master
- main

workflow_dispatch:

Expand All @@ -21,55 +21,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1

- run: mkdir public

- name: Build Index
uses: jaywcjlove/markdown-to-html-cli@main
with:
source: res/docs_index.md
output: public/index.html
github-corners: https://github.com/buehler/dotnet-operator-sdk

- name: Build Contribution
uses: jaywcjlove/markdown-to-html-cli@main
with:
source: CONTRIBUTING.md
output: public/contribution.html
github-corners: https://github.com/buehler/dotnet-operator-sdk

- name: Build KubeOps
uses: jaywcjlove/markdown-to-html-cli@main
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
source: src/KubeOps/README.md
output: public/kubeops.html
github-corners: https://github.com/buehler/dotnet-operator-sdk/tree/master/src/KubeOps
dotnet-version: 7.x

- name: Build KubeOps.KubernetesClient
uses: jaywcjlove/markdown-to-html-cli@main
with:
source: src/KubeOps.KubernetesClient/README.md
output: public/kubeops-kubernetesclient.html
github-corners: https://github.com/buehler/dotnet-operator-sdk/tree/master/src/KubeOps.KubernetesClient
- run: dotnet tool restore

- name: Build KubeOps.Templates
uses: jaywcjlove/markdown-to-html-cli@main
with:
source: src/KubeOps.Templates/README.md
output: public/kubeops-templates.html
github-corners: https://github.com/buehler/dotnet-operator-sdk/tree/master/src/KubeOps.Templates

- name: Build KubeOps.Testing
uses: jaywcjlove/markdown-to-html-cli@main
with:
source: src/KubeOps.Testing/README.md
output: public/kubeops-testing.html
github-corners: https://github.com/buehler/dotnet-operator-sdk/tree/master/src/KubeOps.Testing
- run: dotnet docfx

- uses: actions/upload-pages-artifact@v1
with:
path: public
path: _site

- uses: actions/deploy-pages@v1
6 changes: 5 additions & 1 deletion .github/workflows/security-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@ name: Code Security Testing
on:
pull_request:
branches:
- master
- main
schedule:
- cron: "0 20 * * 5"

concurrency:
group: security
cancel-in-progress: true

jobs:
codeQL:
name: Analyze
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,6 @@ bld/
coverage.json
coverage.info
.vs

# Docs
_site
12 changes: 8 additions & 4 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
{
"debug": true,
"branches": [
"master",
{
"name": "next",
"prerelease": "prerelease"
}
"name": "maintenance/7.x",
"range": "7.x"
},
{
"name": "main",
"prerelease": "pre"
},
"release"
],
"plugins": [
"@semantic-release/commit-analyzer",
Expand Down
58 changes: 58 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<Project>
<PropertyGroup>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>11</LangVersion>
<Authors>Christoph Bühler</Authors>
<Owner>cbuehler</Owner>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>

<PropertyGroup>
<PackageProjectUrl>https://github.com/buehler/dotnet-operator-sdk.git</PackageProjectUrl>
<RepositoryUrl>https://github.com/buehler/dotnet-operator-sdk.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageLicense>Apache-2.0</PackageLicense>
<PackageIcon>icon.png</PackageIcon>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
</PropertyGroup>

<PropertyGroup>
<TreatWarningsAsErrors Condition="'$(Configuration)' == 'Release'">true</TreatWarningsAsErrors>
</PropertyGroup>

<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="\"/>
<None Include="$(MSBuildThisFileDirectory)\LICENSE" Pack="true" PackagePath="\"/>
<None Include="$(MSBuildThisFileDirectory)\res\icon.png">
<Pack>true</Pack>
<PackagePath>\</PackagePath>
<Visible>false</Visible>
</None>
</ItemGroup>

<ItemGroup>
<PackageReference
Include="StyleCop.Analyzers"
Version="1.2.0-beta.507"
PrivateAssets="all"
Condition="$(MSBuildProjectExtension) == '.csproj'"/>
<PackageReference
Include="SonarAnalyzer.CSharp"
Version="9.10.0.77988"
PrivateAssets="all"
Condition="$(MSBuildProjectExtension) == '.csproj'"/>
<PackageReference Include="Roslynator.Analyzers" Version="4.5.0" PrivateAssets="All"/>
</ItemGroup>

<ItemGroup>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
<_Parameter1>$(MSBuildProjectName).Test</_Parameter1>
</AssemblyAttribute>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
<!--So that internals are visible to the Moq library-->
<_Parameter1>DynamicProxyGenAssembly2</_Parameter1>
</AssemblyAttribute>
</ItemGroup>
</Project>
104 changes: 0 additions & 104 deletions DotnetOperatorSdk.sln

This file was deleted.

Loading

0 comments on commit caa92e3

Please sign in to comment.