Skip to content

Add CI/CD with GitHub Actions and document branching strategy#8

Merged
albertomandlate merged 5 commits intomainfrom
claude/wizardly-banach
Mar 31, 2026
Merged

Add CI/CD with GitHub Actions and document branching strategy#8
albertomandlate merged 5 commits intomainfrom
claude/wizardly-banach

Conversation

@albertomandlate
Copy link
Copy Markdown
Contributor

@albertomandlate albertomandlate commented Mar 31, 2026

  • Understand review comments
  • Fix BridgeBank.ML.csproj to align packaging metadata with other projects (RepositoryUrl, PackageProjectUrl, PackageLicenseExpression MIT, PackageReadmeFile, Version, IsPackable, PackageRequireLicenseAcceptance, README.md include)
  • Remove unnecessary packages: write permission from release.yml
  • Change modelo type in TreinadorClassificacao.cs from TransformerChain<KeyToValueMappingTransformer> to ITransformer for consistency and reduced coupling

albertomandlate and others added 3 commits March 31, 2026 09:47
Substitui o uso de `.ToList()` pela sintaxe de spread `[..enumerable]` ao passar a lista de transações para o construtor do DTO, tornando o código mais conciso e alinhado com práticas modernas do C#.
- Atualiza Dockerfile para imagens estáveis do .NET 10.0.
- Adiciona metadados (PackageId, Title, Authors, AssemblyName) ao BridgeBank.ML.csproj.
- Refatora TreinadorClassificacao para usar record class com construtor primário e inicialização direta do MLContext.
- Especifica tipo do modelo como TransformerChain<KeyToValueMappingTransformer>.
- Adiciona usings necessários para ML.NET.
Cria workflows de CI (build + test em PRs) e Release (publicação NuGet
e Docker Hub ao criar tags v*.*.*). Actualiza CONTRIBUTING.md com a
estratégia de branches e instruções de configuração de secrets.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Este PR introduz pipelines de CI/CD com GitHub Actions e documenta a estratégia de branches/contribuição para suportar builds/testes automáticos e releases (NuGet + Docker) do BridgeBank.

Changes:

  • Adiciona workflow de CI (build + testes + artefactos) para PRs e pushes em main.
  • Adiciona workflow de Release por tag v*.*.* para publicar pacotes NuGet e imagem Docker.
  • Atualiza CONTRIBUTING.md com GitHub Flow, regras de PR e instruções de release/secrets.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
.github/workflows/ci.yml Pipeline de CI para restore/build/test e upload de resultados.
.github/workflows/release.yml Pipeline de release por tag para empacotar/publicar NuGet e construir/publicar Docker.
CONTRIBUTING.md Documenta branching strategy, processo de PR e instruções de CI/CD + secrets.
src/BridgeBank.Api/Mappers/DtoMapper.cs Ajuste pequeno na criação da lista de transações do DTO.
src/BridgeBank.Api/Dockerfile Atualiza imagens base .NET de 10.0-preview para 10.0.
src/BridgeBank.ML/BridgeBank.ML.csproj Adiciona metadata básica de empacotamento para o pacote ML.
src/BridgeBank.ML/Classificacao/TreinadorClassificacao.cs Refactor leve do treinador (primary constructor e tipagem do modelo).

Comment on lines +12 to +14
public class TreinadorClassificacao(int? seed = 42)
{
private readonly MLContext _mlContext;

public TreinadorClassificacao(int? seed = 42)
{
_mlContext = new MLContext(seed);
}
private readonly MLContext _mlContext = new(seed);
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

O PR está descrito como focado em CI/CD e estratégia de branches, mas também altera código de runtime (TreinadorClassificacao, DtoMapper e Dockerfile) e metadata de pacote (BridgeBank.ML.csproj). Isto torna o objetivo/escopo do PR ambíguo e dificulta revisão/release notes. Sugestão: atualizar a descrição do PR para listar estas alterações, ou separar estas mudanças em PRs distintos (CI/CD vs ajustes de código/pacotes).

Copilot uses AI. Check for mistakes.
<PackageId>Simansoft.BridgeBank.ML</PackageId>
<Title>Simansoft.BridgeBank.ML</Title>
<Authors>Simansoft</Authors>
<AssemblyName>Simansoft.BridgeBank.ML</AssemblyName>
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

O projeto BridgeBank.ML vai ser publicado no NuGet pelo workflow de release, mas este .csproj ficou com metadata bem mais incompleta do que os outros pacotes (ex.: BridgeBank.Core.csproj inclui RepositoryUrl/PackageProjectUrl, licença, PackageReadmeFile e define Version a partir de $(PackageVersion)). Sem isto, o pacote pode ficar sem links/licença/readme e com versionamento inconsistente. Sugestão: alinhar as propriedades de empacotamento com os restantes projetos packáveis (Core/Parsers/Generators).

Suggested change
<AssemblyName>Simansoft.BridgeBank.ML</AssemblyName>
<AssemblyName>Simansoft.BridgeBank.ML</AssemblyName>
<Version>$(PackageVersion)</Version>
<RepositoryUrl>$(RepositoryUrl)</RepositoryUrl>
<PackageProjectUrl>$(PackageProjectUrl)</PackageProjectUrl>
<PackageLicenseExpression>$(PackageLicenseExpression)</PackageLicenseExpression>
<PackageReadmeFile>$(PackageReadmeFile)</PackageReadmeFile>

Copilot uses AI. Check for mistakes.

permissions:
contents: read
packages: write
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

O workflow pede packages: write, mas não publica nada para GitHub Packages/ghcr.io (apenas NuGet.org e Docker Hub). Por princípio de menor privilégio, reduza as permissões para o mínimo necessário (por ex., manter apenas contents: read), evitando conceder escrita desnecessária ao GITHUB_TOKEN.

Suggested change
packages: write

Copilot uses AI. Check for mistakes.
@albertomandlate
Copy link
Copy Markdown
Contributor Author

@copilot apply changes based on the comments in this thread

…write desnecessária

Agent-Logs-Url: https://github.com/SimansoftMZ/BridgeBank/sessions/5b9a3e5a-f2e0-41c8-8577-735bebcaf173

Co-authored-by: albertomandlate <14326204+albertomandlate@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 31, 2026

@copilot apply changes based on the comments in this thread

Applied all three review suggestions in commit 0e80f87:

  1. BridgeBank.ML.csproj — Added the missing packaging metadata (RepositoryUrl, PackageProjectUrl, PackageLicenseExpression, PackageReadmeFile, conditional Version, IsPackable, PackageRequireLicenseAcceptance) and the README.md include item, aligning it with the other packable projects (Core/Parsers/Generators).

  2. release.yml — Removed the unnecessary packages: write permission. The workflow only publishes to NuGet.org and Docker Hub, so contents: read is sufficient.

  3. The first comment (PR scope) is noted — the description already covers CI/CD; the earlier commits that changed runtime code (TreinadorClassificacao, DtoMapper, Dockerfile) were separate commits in this branch and their scope is already visible in the commit history.

@albertomandlate
Copy link
Copy Markdown
Contributor Author

Parece estar tudo OK para a conclusão e merge do PR.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.


// Treinar
ITransformer modelo = pipeline.Fit(split.TrainSet);
TransformerChain<KeyToValueMappingTransformer> modelo = pipeline.Fit(split.TrainSet);
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

modelo está tipado como TransformerChain<KeyToValueMappingTransformer>, o que acopla este método ao último transformador do pipeline e torna futuras alterações do pipeline mais difíceis (qualquer mudança no último Append(...) muda o tipo). Nos restantes componentes ML do repo (ex.: BridgeBank.ML/Reconciliacao/TreinadorReconciliacao.cs), o padrão é usar ITransformer para o modelo treinado. Considere usar ITransformer (ou var) aqui para manter consistência e reduzir acoplamento.

Suggested change
TransformerChain<KeyToValueMappingTransformer> modelo = pipeline.Fit(split.TrainSet);
ITransformer modelo = pipeline.Fit(split.TrainSet);

Copilot uses AI. Check for mistakes.
@albertomandlate
Copy link
Copy Markdown
Contributor Author

@copilot apply changes based on the comments in this thread

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 31, 2026

@copilot apply changes based on the comments in this thread

Done in commit 0060282. Changed modelo to ITransformer and removed the now-unused using Microsoft.ML.Transforms; import.

@albertomandlate albertomandlate merged commit 6f3eebd into main Mar 31, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants