From 269392690f365a737bb5d13cbfdde445062f978a Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 12 May 2026 19:52:12 +0000 Subject: [PATCH] fix(ci): stop -p:Version cascade in pack; unblock EF 6.3.0 deps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two coupled fixes for the broken Codout.Framework.EF 6.3.0 release plus cleanup of three abandoned packages. ## Workflow fix (root cause) release.yml and mcp-release.yml were passing both -p:Version= and -p:PackageVersion= to dotnet pack. Setting Version cascades through the entire build graph: every ProjectReference also inherits Version=X, which silently rewrites dependency entries in the generated .nuspec. That is why the already-published Codout.Framework.EF 6.3.0 declares "" even though Codout.Framework.Data.csproj has 6.2.2 on master: during the EF pack, -p:Version=6.3.0 leaked into Data too. Consumers running `dotnet restore` after upgrading to EF 6.3.0 fail with "Unable to find package Codout.Framework.Data with version >= 6.3.0". Fix: drop -p:Version= entirely; the .csproj already pins the package version. Keep -p:PackageVersion= so workflow_dispatch can still override the outgoing package version without affecting ProjectReference resolution. ## Codout.Framework.Data 6.3.0 Bump Codout.Framework.Data to 6.3.0 with no code/contract changes, so that the already-published EF 6.3.0 (which incorrectly demands Data >= 6.3.0) starts resolving on NuGet. Future EF builds will declare the correct Data version because of the workflow fix above. ## Drop unmaintained packages from the release surface Codout.Framework.DP, Cosmos repository, and DocumentDB repository have been broken for years: - DP implements an old IRepository shape (Find instead of Where, no AllReadOnly/WherePaged/Refresh/CancellationToken overloads, etc.) and still references the legacy "Codout.Framework.DAL" folder that no longer exists. - Cosmos and DocumentDB target netcoreapp2.0 (out of support since 2018), use the deprecated Microsoft.Azure.DocumentDB.Core SDK, and reference Codout.Framework.NetStandard.* projects that are not in the repo at all. All three csproj now declare false and have been removed from .github/release-packages.json (24 entries remain). release.yml and mass-release.yml therefore skip them. Source files are kept for archaeology; CLAUDE.md spells out what would be needed to revive each one. ## CLAUDE.md Added two prescriptive sections: - "Pacotes excluídos do release automatizado" — names the three above and tells future AI agents to refuse a publish request until the package is modernized. - "Cuidados ao usar dotnet pack" — explicitly forbids -p:Version= and explains the cascade trap, so the same bug does not get reintroduced. ## Operational follow-up after merge The user should tag `data-v6.3.0` against master. release.yml (with the fix above) will pack and push Codout.Framework.Data 6.3.0 to NuGet.org, at which point the already-published EF 6.3.0 starts to restore cleanly without reverting any csproj. https://claude.ai/code/session_015jxScBEvdKkRwGvJTgK5Py --- .github/release-packages.json | 3 --- .github/workflows/mcp-release.yml | 6 +++++- .github/workflows/release.yml | 8 +++++++- CHANGELOG.md | 7 +++++++ CLAUDE.md | 14 ++++++++++++++ Codout.Framework.DP/Codout.Framework.DP.csproj | 9 +++++++++ Codout.Framework.Data/Codout.Framework.Data.csproj | 2 +- ...dout.Framework.NetCore.Repository.Cosmos.csproj | 8 ++++++++ ....Framework.NetCore.Repository.DocumentDB.csproj | 8 ++++++++ 9 files changed, 59 insertions(+), 6 deletions(-) diff --git a/.github/release-packages.json b/.github/release-packages.json index 2839bfd..8d88d90 100644 --- a/.github/release-packages.json +++ b/.github/release-packages.json @@ -5,7 +5,6 @@ "api-dto": "Codout.Framework.Api.Dto/Codout.Framework.Api.Dto.csproj", "application": "Codout.Framework.Application/Codout.Framework.Application.csproj", "common": "Codout.Framework.Common/Codout.Framework.Common.csproj", - "dp": "Codout.Framework.DP/Codout.Framework.DP.csproj", "data": "Codout.Framework.Data/Codout.Framework.Data.csproj", "domain": "Codout.Framework.Domain/Codout.Framework.Domain.csproj", "ef": "Codout.Framework.EF/Codout.Framework.EF.csproj", @@ -20,8 +19,6 @@ "mailer-sendgrid": "Codout.Mailer.SendGrid/Codout.Mailer.SendGrid.csproj", "multitenancy": "Codout.Multitenancy/Codout.Multitenancy.csproj", "softprime-multitenancy": "Codout.Multitenancy/Softprime.Multitenancy.csproj", - "cosmos": "src/NetCore/Codout.Framework.NetCore.Repository.Cosmos/Codout.Framework.NetCore.Repository.Cosmos.csproj", - "documentdb": "src/NetCore/Codout.Framework.NetCore.Repository.DocumentDB/Codout.Framework.NetCore.Repository.DocumentDB.csproj", "security-argon2": "src/Security/Codout.Security.Argon2/Codout.Security.Argon2.csproj", "security-bcrypt": "src/Security/Codout.Security.Bcrypt/Codout.Security.Bcrypt.csproj", "security-core": "src/Security/Codout.Security.Core/Codout.Security.Core.csproj", diff --git a/.github/workflows/mcp-release.yml b/.github/workflows/mcp-release.yml index 84770b8..ffba866 100644 --- a/.github/workflows/mcp-release.yml +++ b/.github/workflows/mcp-release.yml @@ -70,9 +70,13 @@ jobs: - name: Pack run: | + # Mcp has no internal ProjectReferences today, so -p:Version would + # not actively break anything here, but we still use only + # -p:PackageVersion to stay consistent with release.yml and avoid + # reintroducing the cascade trap if a ProjectReference is added + # later. See release.yml for the full explanation. if [ -n "${{ steps.version.outputs.version }}" ]; then dotnet pack "$PROJECT" --configuration "$CONFIGURATION" --no-build \ - -p:Version=${{ steps.version.outputs.version }} \ -p:PackageVersion=${{ steps.version.outputs.version }} \ --output ./artifacts else diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9950cc5..e857db7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -116,9 +116,15 @@ jobs: # Pack performs its own restore/build for the target. Some packages # (Cosmos, DocumentDB, etc.) are not part of Codout.Framework.sln, so # we deliberately do NOT pass --no-build here. + # + # IMPORTANT: when overriding the package version via workflow_dispatch, + # use ONLY -p:PackageVersion=. Passing -p:Version= cascades to every + # project in the build graph (including ProjectReferences), which + # silently rewrites dependency versions in the generated .nuspec and + # produces broken packages. -p:PackageVersion only affects the + # outgoing package and leaves ProjectReference resolution alone. if [ -n "$VERSION" ]; then dotnet pack "$PROJECT" --configuration "$CONFIGURATION" \ - -p:Version="$VERSION" \ -p:PackageVersion="$VERSION" \ --output ./artifacts else diff --git a/CHANGELOG.md b/CHANGELOG.md index d252608..2411f59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,13 @@ versão afetados. ### Build - **Repositório** — `` removido de `Directory.Build.props` e movido para cada `.csproj` publicável. Cada pacote agora evolui independentemente; alterações em um pacote não disparam mais um build novo dos demais. Pacotes que não tiveram alteração ficaram congelados em `6.2.2`. +- **CI** — Workflows `release.yml` e `mcp-release.yml` passaram a usar **somente** `-p:PackageVersion=` no `dotnet pack`. O `-p:Version=` anterior cascateava para todos os projetos do build graph (incluindo `ProjectReference`), o que reescrevia silenciosamente a versão das dependências no `.nuspec` e produzia pacotes com referências quebradas — sintoma observado em `Codout.Framework.EF 6.3.0`, publicado declarando `Codout.Framework.Data >= 6.3.0` enquanto Data estava em 6.2.2 no csproj. +- **Repositório** — Pacotes `Codout.Framework.DP`, `Codout.Framework.NetCore.Repository.Cosmos` e `Codout.Framework.NetCore.Repository.DocumentDB` marcados com `false` e removidos de `.github/release-packages.json`. Os três estão abandonados (DP implementa um `IRepository` antigo e referencia a pasta `Codout.Framework.DAL` que não existe; Cosmos/DocumentDB targetam `netcoreapp2.0` e referenciam projetos `NetStandard.*` ausentes). Mass-release agora ignora os três; consulte `CLAUDE.md` antes de tentar revivê-los. + +### Codout.Framework.Data 6.3.0 + +#### Changed +- Bump de versão técnico para alinhar com `Codout.Framework.EF 6.3.0`. **Não há alterações de código ou contrato** em `Codout.Framework.Data` — esta versão existe para satisfazer a dependência `Codout.Framework.Data >= 6.3.0` declarada (incorretamente) pelo pacote EF 6.3.0 já publicado. Pacotes futuros do EF voltarão a depender da versão minor real de Data, agora que o workflow não cascateia mais o `-p:Version=`. ### Codout.Framework.EF 6.3.0 diff --git a/CLAUDE.md b/CLAUDE.md index fe4ddb1..bc25dde 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -57,6 +57,20 @@ Quando o usuário pedir "gerar nova versão e publicar do pacote X" (ou equivale - **Codout.Framework.Mcp**: usa workflow próprio (`.github/workflows/mcp-release.yml`) com passo `--validate` específico do CLI. Tag deve ser `mcp-v` (NÃO use `mcp` como short-name no `release.yml` — está intencionalmente bloqueado por padrão de tag para evitar duplo release). - **Mass release** (todos os pacotes de uma vez via `.github/workflows/mass-release.yml`): só execute se o usuário pedir explicitamente "mass release" ou "publicar todos". Mesmo assim, oriente o usuário a disparar via Actions UI com `dry_run: true` primeiro e revisar os artifacts antes de re-disparar com `dry_run: false`. Não tente disparar pela CLI sem autorização explícita. +## Pacotes excluídos do release automatizado + +Os seguintes csproj têm `false` e **não** estão em `.github/release-packages.json`. Não tente publicá-los antes de modernizá-los: + +- `Codout.Framework.DP` — implementa um `IRepository` antigo (sem `Where`, `AllReadOnly`, `WherePaged`, `Refresh`, overloads de `CancellationToken`, etc.) e referencia a pasta legada `Codout.Framework.DAL` que não existe mais. +- `src/NetCore/Codout.Framework.NetCore.Repository.Cosmos` — `netcoreapp2.0` (fora de suporte), SDK legado `Microsoft.Azure.DocumentDB.Core`, refs pra projetos `NetStandard.*` que sumiram do repo. +- `src/NetCore/Codout.Framework.NetCore.Repository.DocumentDB` — idem. + +Se o usuário pedir pra publicar um deles, **avise que está deprecated** e pergunte se quer fazer o port completo antes (não tente packar como está — vai falhar). + +## Cuidados ao usar `dotnet pack` + +**NUNCA passe `-p:Version=` no `dotnet pack`.** Essa propriedade cascateia para TODOS os projetos do build (incluindo `ProjectReference`), o que reescreve silenciosamente a versão das dependências no `.nuspec` gerado e produz pacotes com deps quebradas (ex.: `Codout.Framework.EF 6.3.0` declarando `Codout.Framework.Data >= 6.3.0` quando Data está em 6.2.2 no csproj). Para sobrescrever a versão do pacote alvo sem cascatear, use **apenas** `-p:PackageVersion=`. Os workflows já fazem assim — se for criar um novo, siga o mesmo padrão. + ## O que NÃO fazer - ❌ Reintroduzir `` em `Directory.Build.props`. diff --git a/Codout.Framework.DP/Codout.Framework.DP.csproj b/Codout.Framework.DP/Codout.Framework.DP.csproj index 75f9079..832e5b3 100644 --- a/Codout.Framework.DP/Codout.Framework.DP.csproj +++ b/Codout.Framework.DP/Codout.Framework.DP.csproj @@ -3,6 +3,15 @@ 6.2.2 netstandard2.1 + + false diff --git a/Codout.Framework.Data/Codout.Framework.Data.csproj b/Codout.Framework.Data/Codout.Framework.Data.csproj index 4f1e668..3ebc3c3 100644 --- a/Codout.Framework.Data/Codout.Framework.Data.csproj +++ b/Codout.Framework.Data/Codout.Framework.Data.csproj @@ -1,7 +1,7 @@  - 6.2.2 + 6.3.0 Interface da Biblioteca de persistência do Framework da Codout Codout;Framework;ORM;DAL;Repository;UnitOfWork;Specification;Auditing true diff --git a/src/NetCore/Codout.Framework.NetCore.Repository.Cosmos/Codout.Framework.NetCore.Repository.Cosmos.csproj b/src/NetCore/Codout.Framework.NetCore.Repository.Cosmos/Codout.Framework.NetCore.Repository.Cosmos.csproj index 7c3dde8..3d3d1cc 100644 --- a/src/NetCore/Codout.Framework.NetCore.Repository.Cosmos/Codout.Framework.NetCore.Repository.Cosmos.csproj +++ b/src/NetCore/Codout.Framework.NetCore.Repository.Cosmos/Codout.Framework.NetCore.Repository.Cosmos.csproj @@ -3,6 +3,14 @@ 6.2.2 netcoreapp2.0 + + false true Marcelo & Clovis Codout diff --git a/src/NetCore/Codout.Framework.NetCore.Repository.DocumentDB/Codout.Framework.NetCore.Repository.DocumentDB.csproj b/src/NetCore/Codout.Framework.NetCore.Repository.DocumentDB/Codout.Framework.NetCore.Repository.DocumentDB.csproj index d736052..9907699 100644 --- a/src/NetCore/Codout.Framework.NetCore.Repository.DocumentDB/Codout.Framework.NetCore.Repository.DocumentDB.csproj +++ b/src/NetCore/Codout.Framework.NetCore.Repository.DocumentDB/Codout.Framework.NetCore.Repository.DocumentDB.csproj @@ -3,6 +3,14 @@ 6.2.2 netcoreapp2.0 + + false