4 Commits
Author SHA1 Message Date
poli0981andClaude Opus 5.5 d14d64241e ci: SonarQube Cloud CI-based analysis with coverage; audit .NET tools (#26)
* ci: run SonarQube Cloud analysis in CI with coverage

- New `sonarcloud` job: SonarScanner for .NET 12.0.0 (local tool) begin, build,
  tests with Cobertura coverage and TRX results, end, which waits for the
  quality gate. It passes without analysing when SONAR_TOKEN is not available
  (fork and Dependabot pull requests).
- Coverage leaves out CaptureImage.UI and CaptureImage.App, which ui-tests and
  publish-smoke exercise out of process.
- audit: check the .NET tools in .config/dotnet-tools.json against nuget.org's
  vulnerability data (tool-audit.ps1); neither NuGet's audit nor the dependency
  graph covers them.
- Dependabot: update dotnet-sonarscanner with the dev-tools group.
- Tests: await the async File APIs inside async tests (Sonar S6966).
- Docs: CLAUDE.md, CONTRIBUTING, ARCHITECTURE, SECURITY, README badges, CHANGELOG.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* ci(sonarcloud): leave CI scripts out of coverage, skip non-main branch runs

- PR 26's gate failed only on coverage: SonarQube Cloud counts PowerShell as
  coverable code, so the 60 lines of tool-audit.ps1 were new, uncovered code.
  `.github/**` joins the coverage exclusions.
- The free plan analyses main and pull requests only; a workflow_dispatch run
  on another branch uploaded its report and then failed with "Organization is
  not allowed to access data from non main branches". Such runs now pass
  without analysing, like runs without SONAR_TOKEN.
- Icons and PNGs are project items the scanner read as UTF-8 text; exclude
  them from the analysis.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 06:19:41 +07:00
poli0981andClaude Opus 5.5 c649442a3a chore!: .NET 10 foundation, required CI quality gates, hardened release pipeline (#21)
* chore(build)!: move to .NET 10 LTS, refresh dependencies, enforce LF + SPDX headers

.NET 9 reaches end of support on 2026-11-10 and this machine only has .NET 10
SDKs, so the repo no longer built locally.

- global.json: SDK 10.0.401 (latestFeature) + Microsoft.Testing.Platform runner
- all projects retargeted to net10.0 / net10.0-windows10.0.22621.0
- Directory.Build.props: single version source (App no longer overrides it),
  TreatWarningsAsErrors everywhere, lock files + locked restore in CI,
  NuGetAudit (all, low), EnableWindowsTargeting (Dependabot evaluated every
  Windows-TFM project as "not compatible" without it), XML docs on so IDE0005
  runs in build
- packages: Microsoft.Extensions 10.0.13, Serilog 4.4.0 (+ sinks/extensions),
  CommunityToolkit.Mvvm 8.4.2, Stateless 5.20.1, Vortice 3.8.3, SkiaSharp
  4.153.1, Velopack 1.2.161 (DownloadUpdatesAsync lost ignoreDeltas;
  CheckForUpdatesAsync now honours cancellation via WaitAsync), WinAppSDK last
  1.8 patch
- security: drop SixLabors.ImageSharp 3.1.12 (GHSA-j3p4-wp97-rph4,
  GHSA-j9gm-c75j-xc9q, GHSA-jjfr-hcj7-qf5w high; GHSA-gwg2-r3hj-4w44,
  GHSA-wmxv-xphr-5c9g moderate) — TIFF now goes through the built-in WIC
  encoder (opaque, LZW)
- removed unused references: M.E.Hosting/Localization/Options/DI.Abstractions
  where unused, Serilog sinks in Infrastructure, SkiaSharp.NativeAssets.Win32
  (transitive), CsWinRT, Microsoft.Win32.Registry, H.NotifyIcon,
  Hosting.Abstractions
- tests: xunit 2 -> xunit.v3 4.0.2 (MTP v2), FluentAssertions 6 ->
  AwesomeAssertions 9 (FA >= 8 is commercially licensed), NSubstitute 6,
  coverlet -> Microsoft.Testing.Extensions.CodeCoverage; tests pass the xunit
  cancellation token
- .gitattributes: eol=lf everywhere (matches .editorconfig); .gitignore now
  ignores .idea/ and .claude/
- .editorconfig: SPDX header template (IDE0073) and IDE0161/0065/0005/0051/
  0052/0059/0060 enforced in build; headers added to every C# file, whitespace
  normalised; dead IID field and unused parameter/field removed

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* ci: required quality gates, hardened release pipeline, working Dependabot

New required checks (one job each, no path filters so they always report):
- build: locked restore, Release build with warnings as errors, tests on
  Microsoft.Testing.Platform with Cobertura coverage summarised in the job summary
- format: `dotnet format whitespace` + style subset (SPDX header, file-scoped
  namespaces, using placement, unnecessary usings)
- deadcode: JetBrains InspectCode gated on file-local dead/redundant-code rules
  (WinUI projects excluded until they are replaced)
- audit: `dotnet list package --vulnerable --include-transitive` parsed by a gate
  script (the command itself always exits 0)
- license: nuget-license allowlist for the shipped app's dependency closure
- publish-smoke: publishes the app and verifies the payload (.pri/.xbf, legal docs)
- pr-title (Conventional Commits), dependency-review (vulnerabilities of any
  severity + non-free licenses), workflow-lint (actionlint + zizmor), docs
  (markdownlint + offline lychee); weekly external link check and OpenSSF
  Scorecard are informational

Release workflow:
- version taken from the tag through env + SemVer regex (removes the
  `${{ github.event.inputs.version }}` script injection) and checked against
  Directory.Build.props; prerelease derived from the version
- vpk pinned through the tool manifest (was unpinned while the library was
  0.0.1053); full packages only, so the previous release's 100 MB package is no
  longer re-uploaded; release notes come from CHANGELOG (the in-app update page
  showed none); identical packId/title/shortcuts/mainExe
- CycloneDX SBOM, SHA256SUMS of this version's assets, build-provenance
  attestations; release is created as a draft via gh (no third-party action with
  a write token); workflow_dispatch can rebuild an existing tag or dry-run

Other workflows: every action pinned to a commit SHA; least-privilege
permissions per job; notify-ci-failure ignores fork pull requests (they could post
their commit message to Discord) and all callers pass only the secrets they need
instead of `secrets: inherit`; announce-release now fires because releases are
published with a user token; discussion-welcome pinned and lists security@.
Removed .github/scripts/discord_notify.py (unused; the reusable workflows carry
their own copy).

Dependabot: EnableWindowsTargeting fixes the "not compatible" evaluation;
dead avalonia group removed; ecosystems grouped (incl. Velopack + vpk), 3-day
cooldown, tool manifest covered; version-update PRs paused (limit 0) until the
2.0.0 release.

Repo tooling: .config/dotnet-tools.json (vpk, InspectCode, nuget-license,
ReportGenerator, CycloneDX), markdownlint + lychee configs, RuntimeIdentifiers
win-x64 for stable lock files, CLAUDE.md for AI assistants, markdown lint fixes,
and the remaining InspectCode findings in Core/Infrastructure/ViewModels fixed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* ci: fix first-run findings of the new gates

- dependency-review: drop Commons-Clause from deny-licenses (not an SPDX id)
- docs: disable markdownlint MD060 (table pipe alignment) introduced in
  markdownlint 0.41, which the CI action ships
- Dependabot cooldown 3 -> 7 days (zizmor dependabot-cooldown audit)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* ci: quote InspectCode arguments, force HTTPS for actionlint download

- PowerShell splits a dash-prefixed native argument at its first period, so
  -o=inspectcode.sarif reached InspectCode as two arguments ('Specify only one
  solution file'); arguments are now quoted
- curl in workflow-lint refuses non-HTTPS protocols and redirects (SonarCloud
  githubactions:S6506)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 08:02:41 +07:00
poli0981 acaee4a0a0 Enhance Discord notification helper with phase 2 commands and improved webhook handling 2026-05-08 20:10:16 +07:00
poli0981 33d6b0c004 Add Discord notification helper script
This script helps send notifications to Discord via webhooks for release announcements and CI failure alerts. It includes configuration for colors, truncation of messages, and handles environment variables for dynamic content.
2026-05-08 18:45:49 +07:00