Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
e8cfbf5
WIP
PetesBreenCoding Jun 4, 2026
98eec4b
WIP
PetesBreenCoding Jun 12, 2026
0a17e0e
attempted fix
PetesBreenCoding Jun 12, 2026
bf9d5fa
fix
PetesBreenCoding Jun 12, 2026
7ae903f
fix
PetesBreenCoding Jun 12, 2026
b2948bf
fix
PetesBreenCoding Jun 12, 2026
f405dca
fix
PetesBreenCoding Jun 12, 2026
374e4b1
fix
PetesBreenCoding Jun 12, 2026
4086100
wip
PetesBreenCoding Jun 12, 2026
c296cac
fix
PetesBreenCoding Jun 12, 2026
c154e76
fix
PetesBreenCoding Jun 12, 2026
84d9c07
fizx
PetesBreenCoding Jun 12, 2026
16dd9c3
wip
PetesBreenCoding Jun 12, 2026
bd30ca6
wip
PetesBreenCoding Jun 12, 2026
77b987a
wip
PetesBreenCoding Jun 12, 2026
8cf54fe
wip
PetesBreenCoding Jun 12, 2026
2f6da0b
openapoi
PetesBreenCoding Jun 12, 2026
753b3bc
fix
PetesBreenCoding Jun 12, 2026
674eda8
fix
PetesBreenCoding Jun 12, 2026
0ad89ca
fix
PetesBreenCoding Jun 12, 2026
5e695c6
fix
PetesBreenCoding Jun 12, 2026
2806cde
fix
PetesBreenCoding Jun 12, 2026
15eaa7f
wip
PetesBreenCoding Jun 12, 2026
06e1c7e
wip
PetesBreenCoding Jun 12, 2026
3d83070
wip
PetesBreenCoding Jun 12, 2026
ec6bb00
wip
PetesBreenCoding Jun 12, 2026
c9ef56e
Update GitHub Action to use github-script@v7
PetesBreenCoding Jun 12, 2026
66754a3
wip
PetesBreenCoding Jun 12, 2026
af49921
Merge branch 'feature/initial' of https://github.com/PetesBreenCoding…
PetesBreenCoding Jun 12, 2026
4fd146b
w
PetesBreenCoding Jun 12, 2026
ae5808e
wip
PetesBreenCoding Jun 17, 2026
63b18aa
wip
PetesBreenCoding Jun 17, 2026
c974bb6
wip
PetesBreenCoding Jun 17, 2026
08362f6
wip
PetesBreenCoding Jun 17, 2026
2e8dc84
wip
PetesBreenCoding Jun 17, 2026
f693701
w
PetesBreenCoding Jun 17, 2026
d85874a
a
PetesBreenCoding Jun 17, 2026
3576b47
w
PetesBreenCoding Jun 17, 2026
e55ef1c
a
PetesBreenCoding Jun 17, 2026
0a06bd0
w
PetesBreenCoding Jun 17, 2026
e83a194
q
PetesBreenCoding Jun 17, 2026
9742468
w
PetesBreenCoding Jun 17, 2026
a1abe36
w
PetesBreenCoding Jun 17, 2026
8b5505d
a
PetesBreenCoding Jun 17, 2026
713b21f
a
PetesBreenCoding Jun 17, 2026
c87c9f1
a
PetesBreenCoding Jun 17, 2026
34bba8e
w
PetesBreenCoding Jun 17, 2026
de6c683
w
PetesBreenCoding Jun 17, 2026
04aa00c
w
PetesBreenCoding Jun 17, 2026
9bd4f31
w
PetesBreenCoding Jun 18, 2026
590d0ba
q
PetesBreenCoding Jun 18, 2026
f80c929
w
PetesBreenCoding Jun 18, 2026
34e440f
w
PetesBreenCoding Jun 18, 2026
8eceede
w
PetesBreenCoding Jun 18, 2026
6f07126
cache
PetesBreenCoding Jun 18, 2026
bf684a8
cache control
PetesBreenCoding Jun 18, 2026
60b79f8
w
PetesBreenCoding Jun 19, 2026
e79183a
wip
PetesBreenCoding Jun 19, 2026
1088f6b
security
PetesBreenCoding Jun 25, 2026
0627dba
wi[p
PetesBreenCoding Jun 25, 2026
73fbfff
wip
PetesBreenCoding Jul 1, 2026
c2306b7
wip
PetesBreenCoding Jul 1, 2026
edeabef
WIP
PetesBreenCoding Jul 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 107 additions & 0 deletions .github/workflows/pr-gatechecks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: PR Gatechecks

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
pr-gatechecks:
permissions:
pull-requests: write
name: PR Gatechecks
runs-on: ubuntu-latest

steps:
- name: 🎛️ Checkout
uses: actions/checkout@v4

- name: 🛠️ Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'

- name: 🔄 Restore
run: dotnet restore

- name: 👷 Build
run: dotnet build --no-restore --configuration Release

- name: 🔍 Analyze OpenAPI
id: analyze
uses: ApyGuard/apyguard_openapi_analysis@v1.0.9
with:
file: ${{ github.workspace }}/src/CheersDb.Api/CheersDb.Api.json
output_format: json

- name: ✏️ Comment on PR
uses: actions/github-script@v9
env:
ANALYSIS: ${{ steps.analyze.outputs.analysis }}
with:
script: |
const analysis = JSON.parse(process.env.ANALYSIS);
const categories = analysis.analysis_categories || {};
const analytics = analysis.analytics || {};
const comment = `## 🔍 OpenAPI Analysis Results
**Valid**: ${analysis.is_valid ? '✅' : '❌'}
**Total Suggestions**: ${analysis.suggestions ? Object.values(analysis.suggestions).reduce((total, suggestions) => total + suggestions.length, 0) : 0}
### 📊 Basic Metrics
- **Operations**: ${analysis.summary ? analysis.summary.operations_count : 0}
- **Paths**: ${analysis.summary ? analysis.summary.paths_count : 0}
- **Schemas**: ${analysis.summary ? analysis.summary.schemas_count : 0}
### 🎯 Advanced Analytics
- **Complexity Score**: ${analytics.complexity_score || 0}
- **Maintainability Score**: ${analytics.maintainability_score || 0}/100
### 📋 Analysis Categories
- **Security Issues**: ${categories.security || 0}
- **Performance Issues**: ${categories.performance || 0}
- **Design Pattern Issues**: ${categories.design_patterns || 0}
- **Versioning Issues**: ${categories.versioning || 0}
- **Documentation Issues**: ${categories.documentation || 0}
- **Compliance Issues**: ${categories.compliance || 0}
- **Testing Recommendations**: ${categories.testing || 0}
- **Monitoring Recommendations**: ${categories.monitoring || 0}
- **Code Generation Opportunities**: ${categories.code_generation || 0}
- **Governance Issues**: ${categories.governance || 0}
${analysis.suggestions && Object.keys(analysis.suggestions).length > 0 ?
Object.entries(analysis.suggestions).map(([category, suggestions]) =>
`### ${category} (${suggestions.length} issues)\n\n${suggestions.slice(0, 3).map(s => `- ${s}`).join('\n')}${suggestions.length > 3 ? `\n- ... and ${suggestions.length - 3} more` : ''}\n`
).join('\n') :
'### ✅ No suggestions found! Your OpenAPI specification looks great! 🎉'
}
---
*Powered by ApyGuard OpenAPI Analyzer with comprehensive best practices analysis*`;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: comment
});
- name: 🚦 OpenAPI Gatecheck
uses: actions/github-script@v9
env:
ANALYSIS: ${{ steps.analyze.outputs.analysis }}
with:
script: |
const analysis = JSON.parse(process.env.ANALYSIS);
const categories = analysis.analysis_categories || {};
const issueCount = categories.performance + categories.compliance + categories.versioning + categories.documentation;
if (analysis.is_valid && issueCount === 0) {
console.log('✔️ OpenAPI analysis passed');
process.exit(0);
} else {
console.log(`Valid: ${analysis.is_valid}`);
console.log(`Total blocking issues: ${issueCount}`);
console.error('❌ OpenAPI analysis failed');
process.exit(1);
}
7 changes: 7 additions & 0 deletions CheersDb.slnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Solution>
<Folder Name="/Solution Items/">
<File Path="Directory.build.props" />
<File Path="Directory.Packages.props" />
</Folder>
<Project Path="src/CheersDb.Api/CheersDb.Api.csproj" />
</Solution>
10 changes: 10 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project>
<PropertyGroup>
<ImplicitUsings>enable</ImplicitUsings>
<LangVersion>14.0</LangVersion>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<Nullable>enable</Nullable>
<TargetFramework>net10.0</TargetFramework>
<Version>0.0.1</Version>
</PropertyGroup>
</Project>
12 changes: 12 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="10.0.9" />
<PackageVersion Include="Microsoft.AspNetCore.OpenApi" Version="10.0.9" />
<PackageVersion Include="Microsoft.Extensions.ApiDescription.Server" Version="10.0.9" />
<PackageVersion Include="Microsoft.OpenApi" Version="2.9.0" />
<PackageVersion Include="Scalar.AspNetCore" Version="2.16.7" />
</ItemGroup>
</Project>
25 changes: 25 additions & 0 deletions src/CheersDb.Api/AppSettings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using CheersDb.Api.Http;
using Microsoft.OpenApi;

namespace CheersDb.Api;

/// <summary>
/// Represents the application settings for the CheersDb API.
/// </summary>
public class AppSettings
{
/// <summary>
/// Gets the JWT auth settings
/// </summary>
public JwtOptions? JwtAuth { get; init; }

/// <summary>
/// Gets the OpenAPI information for the API, such as title, version, and description.
/// </summary>
public OpenApiInfo? OpenApiInfo { get; init; }

/// <summary>
/// Gets the OpenAPI security scheme for the API, which defines the authentication and authorization requirements.
/// </summary>
public OpenApiSecurityScheme? OpenApiSecurityScheme { get; init; }
}
21 changes: 21 additions & 0 deletions src/CheersDb.Api/CheersDb.Api.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<OpenApiDocumentsDirectory>$(MSBuildProjectDirectory)</OpenApiDocumentsDirectory>
<OpenApiGenerateDocuments>true</OpenApiGenerateDocuments>
<OpenApiGenerateDocumentsOnBuild>true</OpenApiGenerateDocumentsOnBuild>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" />
<PackageReference Include="Microsoft.Extensions.ApiDescription.Server">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.OpenApi" />
<PackageReference Include="Scalar.AspNetCore" />
</ItemGroup>

</Project>
6 changes: 6 additions & 0 deletions src/CheersDb.Api/CheersDb.Api.http
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@CheersDb.Api_HostAddress = https://localhost:8339
@BearerToken = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJDaGVlcnNEYkFwaSIsImF1ZCI6IkNoZWVyc0RiQXBpQ2xpZW50cyIsInN1YiI6IjEyMzQ1Njc4OTAiLCJuYW1lIjoiSm9obiBEb2UiLCJpYXQiOjE1MTYyMzkwMjIsImV4cCI6MTgxMzkyOTI2M30.2GDbHeNP6iESLtZraeT4wFsNs_WB8XoSbr_WEu0Huv8

GET {{CheersDb.Api_HostAddress}}/producers/24
Accept: application/json
Authorization: Bearer {{BearerToken}}
Loading
Loading