Skip to content

ci: bypass do gate pr-author-org-member para PRs de bots#379

Merged
marmota-alpina merged 1 commit into
mainfrom
ci/skip-org-member-gate-for-bots
May 10, 2026
Merged

ci: bypass do gate pr-author-org-member para PRs de bots#379
marmota-alpina merged 1 commit into
mainfrom
ci/skip-org-member-gate-for-bots

Conversation

@marmota-alpina
Copy link
Copy Markdown
Contributor

Resumo

Destrava PRs do Dependabot (e qualquer bot futuro — github-actions, Renovate) que ficavam bloqueados pelo gate PR author is org member. Bots não passam pelo endpoint /collaborators/{login}/permission (retorna 404 para bot logins), fazendo o status check obrigatório sempre falhar.

Mudança

Step novo no início do job que bypass explícito quando user.type == 'Bot'. Step seguinte ganha condição if: user.type != 'Bot' para preservar a validação para humanos.

Por que bypass + nominal em vez de reescrever o gate

  • Auditoria preservada: humanos continuam validados pela rota original (permission write/admin/maintain + não-outside-collaborator)
  • Bots rastreáveis: user.login aparece no log do bypass step (dependabot[bot], github-actions[bot], etc.)
  • Sem allowlist hardcoded: user.type == 'Bot' é genérico — vale para qualquer bot integration

Alternativa rejeitada: --admin merge para cada PR Dependabot

Anti-pattern que mascara CI failures e quebra histórico de status checks como evidência de aprovação. Bypass explícito do gate é o caminho correto.

Impacto

Após mergeado, os PRs Dependabot atuais (#371, #373, #374) precisam re-disparar CI (ou rebase em main) para o status PR author is org member virar SUCCESS — então conseguem mergear normalmente.

Adicionado para destravar PRs do Dependabot (e qualquer bot futuro como
github-actions, Renovate). Bots não são "members" no sentido
organizacional — endpoint /collaborators/{login}/permission retorna 404
para bot logins, fazendo o gate sempre falhar.

Bypass explícito via github.event.pull_request.user.type == 'Bot'
preserva a semântica para humanos: o step seguinte só roda quando
type != 'Bot', mantendo a validação intacta de membership real
(permission write/admin/maintain + não-outside-collaborator).

Sem condicional, todos os PRs Dependabot ficariam bloqueados pelo
status check obrigatório, exigindo --admin merge — anti-pattern.
Copy link
Copy Markdown
Contributor

@jf2s jf2s left a comment

Choose a reason for hiding this comment

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

Aprovado. Bypass minimal para bots (user.type == 'Bot') preserva validação para humanos no step seguinte. CI 8/8 verde.

@marmota-alpina marmota-alpina merged commit 9b0151f into main May 10, 2026
8 checks passed
@marmota-alpina marmota-alpina deleted the ci/skip-org-member-gate-for-bots branch May 10, 2026 20:56
marmota-alpina added a commit that referenced this pull request May 10, 2026
Substitui os 6 PRs Dependabot abertos automaticamente após o merge da
config #369 — todos fechados sem merge por dois bloqueios estruturais:
gate org-member para bot (resolvido em #379) e lockfile drift transitivo
NU1004 com --locked-mode. Em vez de esperar nova rodada semanal, batch
manual regenera todos os 17 packages.lock.json via dotnet restore
--force-evaluate.

Directory.Packages.props
- WolverineFx + companion EFC/Postgresql/Kafka: 5.32.1 → 5.39.0 (7 minors)
- Microsoft.EntityFrameworkCore + companion InMemory/Relational/Design:
  10.0.5 → 10.0.7 (2 patches)
- Npgsql: 9.0.4 → 10.0.2 (major — validado via suite Outbox/Cascading
  completa: 71 testes integration Selecao + 10 Infra.Core, todos verdes)
- OpenTelemetry.Extensions.Hosting: 1.15.2 → 1.15.3 (alinha com Exporter
  já em 1.15.3 entregue na Story #30)
- Microsoft.NET.Test.Sdk: 18.3.0 → 18.5.1 (minor)
- Microsoft.AspNetCore.Mvc.Testing: 10.0.0 → 10.0.7 (patches)

.config/dotnet-tools.json
- dotnet-reportgenerator-globaltool: 5.5.4 → 5.5.10 (6 patches)

Validação
- dotnet restore --force-evaluate: 20 projetos restaurados sem NU1004
- dotnet build UniPlus.slnx: 0 warning, 0 error (TreatWarningsAsErrors)
- dotnet test UniPlus.slnx: 629 testes verdes, 0 falhas
  - 540 unit + arch
  - 8 Ingresso.IntegrationTests
  - 10 Infrastructure.Core.IntegrationTests (inclui OTel wiring E2E)
  - 71 Selecao.IntegrationTests (Outbox/Cascading com Wolverine 5.39 +
    EF Core 10.0.7 + Npgsql 10.0.2 reais via Testcontainers)

Closes #380
@marmota-alpina marmota-alpina self-assigned this May 11, 2026
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.

2 participants