diff --git a/.forgejo/PULL_REQUEST_TEMPLATE.md b/.forgejo/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..d66185a --- /dev/null +++ b/.forgejo/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,24 @@ +## Contexte + + + +## Changements + +- [ ] ... + +## Tickets liés + +- Fixes #N / Refs #N + +## Tests + +- [ ] Build : `dotnet build -c Release` +- [ ] Tests : `dotnet test` (ou `make test`) +- [ ] CI verte (Trivy, Dependency-Check, SonarQube — politiques bloquantes) +- [ ] Release notes / versioning impacté (GitVersion central `v*` / agent `agent-v*`) + +## Checklist + +- [ ] Commits référencent le ticket (`Fixes #N`) +- [ ] Pas de secret en clair (tokens, mots de passe) +- [ ] Les CVE signalées par la CI sur cette PR sont traitées ou justifiées diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index bc2dcf9..19ac4f7 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -63,6 +63,7 @@ jobs: # SonarQube : en attente d'accès (ticket #101) — secrets sonar_token/sonar_host_url dans Vault secret/data/ci/heimdall sonar-enabled: 'false' trivy-enabled: 'true' + dependency-check-enabled: 'true' docker-images: | eltruncho/heimdall docker/Dockerfile eltruncho/heimdall-agent docker/Dockerfile.agent diff --git a/.gitignore b/.gitignore index 379d0fc..f3d8a90 100644 --- a/.gitignore +++ b/.gitignore @@ -87,6 +87,3 @@ templates/ **/.env docker/.env -# GitVersion (généré au build) -GitVersion.yml -GitVersion.Agent.yml diff --git a/GitVersion.Agent.yml b/GitVersion.Agent.yml new file mode 100644 index 0000000..5efd02f --- /dev/null +++ b/GitVersion.Agent.yml @@ -0,0 +1,10 @@ +# GitVersion.Agent.yml - Version de l'AGENT (Heimdall.Agent) +# Tags de release : agent-v* (ex. agent-v1.0.0). Config separee du central : +# l'agent a son propre cycle (tickets #95 #96 #97). +# Usage : dotnet-gitversion -config GitVersion.Agent.yml +# ATTENTION : tag-prefix personnalise + AUCUN tag agent-v* existant => GitVersion +# 6.8.1 echoue ("Failed to parse") - les workflows doivent garder un fallback. +workflow: TrunkBased/preview1 +next-version: 1.0.0 +assembly-informational-format: '{MajorMinorPatch}+{BranchName}.{ShortSha}' +tag-prefix: 'agent-v' diff --git a/GitVersion.yml b/GitVersion.yml new file mode 100644 index 0000000..d023f0d --- /dev/null +++ b/GitVersion.yml @@ -0,0 +1,8 @@ +# GitVersion.yml - Version du CENTRAL (Heimdall.Web) +# Tags de release : v* (ex. v1.0.0). Le prefix 'v' est le defaut de GitVersion, +# inutile de le declarer (bug GitVersion 6.8.1 : tag-prefix personnalise + aucun +# tag existant => "Failed to parse next-version"). L'agent utilise +# GitVersion.Agent.yml (tags agent-v*), cycle de release independant. +workflow: TrunkBased/preview1 +next-version: 1.0.0 +assembly-informational-format: '{MajorMinorPatch}+{BranchName}.{ShortSha}' diff --git a/Makefile b/Makefile index 73c28ea..25f6d3a 100644 --- a/Makefile +++ b/Makefile @@ -42,6 +42,24 @@ docker-reset: ## Stop and remove everything deploy: docker-build docker-up ## Build and deploy +# ─── Versioning / Release (GitVersion) ────────────────────────── + +version: ## Show GitVersion versions (central + agent) + @export PATH="$$PATH:$$HOME/.dotnet/tools"; \ + if ! command -v dotnet-gitversion >/dev/null 2>&1; then dotnet tool install --global GitVersion.Tool --version 6.8.1 >/dev/null; fi; \ + echo "Central (GitVersion.yml):"; \ + dotnet-gitversion -config GitVersion.yml -output json 2>/dev/null | python3 -c "import json,sys; d=json.load(sys.stdin); print(' SemVer:', d['SemVer'], '| MajorMinorPatch:', d['MajorMinorPatch'])" 2>/dev/null || echo " (erreur — pas de tag v* ?)"; \ + echo "Agent (GitVersion.Agent.yml):"; \ + dotnet-gitversion -config GitVersion.Agent.yml -output json 2>/dev/null | python3 -c "import json,sys; d=json.load(sys.stdin); print(' SemVer:', d['SemVer'], '| MajorMinorPatch:', d['MajorMinorPatch'])" 2>/dev/null || echo " (erreur — pas de tag agent-v* ? bug GitVersion tag-prefix)" + +version-tag: ## Tag la version courante (usage: make version-tag TAG=v1.0.0) + @test -n "$(TAG)" || (echo "Usage: make version-tag TAG=v1.0.0"; exit 1); \ + git tag "$(TAG)" && git push origin "$(TAG)" + +version-tag-agent: ## Tag la version agent (usage: make version-tag-agent TAG=agent-v1.0.0) + @test -n "$(TAG)" || (echo "Usage: make version-tag-agent TAG=agent-v1.0.0"; exit 1); \ + git tag "$(TAG)" && git push origin "$(TAG)" + # ─── Database ──────────────────────────────────────────────────── migration-add: ## Add a new EF migration (usage: make migration-add NAME=xxx)