Skip to content

ci: normalizar workflows e templates de PR/issue - #3

Merged
rlueder merged 2 commits into
mainfrom
feat/normalize-workflows-and-templates
Apr 22, 2026
Merged

ci: normalizar workflows e templates de PR/issue#3
rlueder merged 2 commits into
mainfrom
feat/normalize-workflows-and-templates

Conversation

@rlueder

@rlueder rlueder commented Apr 21, 2026

Copy link
Copy Markdown
Member

Resumo

Datasus era o repo OSS mais defasado em estrutura .github comparado com fhir-brasil e medbench. Este PR fecha a lacuna sem mudar nenhum código de produto.

Adicionado

Arquivo Origem
.github/workflows/review.yml copiado de fhir-brasil verbatim — code review automatizado por Claude via Bedrock, com round 1 / round 2 e detecção de "docs-only" para skip
.github/workflows/ci.yml (modificado) adiciona job review que invoca review.yml via workflow_call em PRs
.github/PULL_REQUEST_TEMPLATE.md template de PR com checklist específico do datasus (pacotes dbc/core, vintages de schema)
.github/ISSUE_TEMPLATE/bug_report.md, feature_request.md templates com campos relevantes para microdados DATASUS (sistema, vintage, fonte oficial)
.husky/pre-push hook novo que roda lockfile check + format check + lint + typecheck + test antes do push, evitando quebrar CI

Intencionalmente NÃO incluído

  • preview.yml / build-site / deploy-site — datasus não tem site
  • publish-tag.yml (medbench-only)
  • IG / SUSHI / Simplifier (fhir-brasil-only)

Pré-requisitos para o review.yml funcionar

O job Code Review / Claude Review precisa dos secrets AWS_ACCESS_KEY_ID e AWS_SECRET_ACCESS_KEY configurados no nível do org ou do repo (mesmos secrets já em uso em fhir-brasil e medbench-brasil). Se ainda não estiverem visíveis para Precisa-Saude/datasus-brasil, o job vai falhar — basta adicionar acesso. O step Review Status (que decide se roda) usa só GITHUB_TOKEN e funciona sem config adicional.

Test plan

  • pnpm format:check && pnpm turbo run lint typecheck test verde
  • .husky/pre-push roda os mesmos checks e passa (validado no próprio push deste branch)
  • CI verde no PR
  • Code Review / Review Status corre (e Claude Review roda OU pula com mensagem clara se faltar AWS creds)

Datasus era o repo OSS mais defasado em estrutura .github comparado
com fhir-brasil e medbench-brasil. Este commit fecha a lacuna:

- .github/workflows/review.yml: copiado de fhir-brasil (workflow de
  code review automatizado por Claude via Bedrock, com round 1/round 2
  e detecção de docs-only para skip)
- .github/workflows/ci.yml: adiciona job "review" que invoca
  review.yml via workflow_call em PRs
- .github/PULL_REQUEST_TEMPLATE.md: template de PR com checklist
  específico do datasus (pacotes dbc/core, vintages de schema)
- .github/ISSUE_TEMPLATE/bug_report.md, feature_request.md: templates
  com campos relevantes para microdados DATASUS (sistema, vintage,
  fonte oficial)
- .husky/pre-push: hook novo que roda lockfile check + format check +
  lint + typecheck + test antes do push, evitando quebrar CI

Workflows / templates intencionalmente NÃO incluídos:
- preview.yml / build-site / deploy-site: datasus não tem site
- publish-tag.yml (medbench-only)
- IG / SUSHI / Simplifier (fhir-brasil-only)
@github-actions

Copy link
Copy Markdown

Claude Review - Round 1

Summary

This PR adds GitHub issue/PR templates, a CI-integrated Claude code review workflow using AWS Bedrock, and a Husky pre-push hook for local validation.

Changes

  • Added bug report and feature request issue templates in Portuguese
  • Added a PR template with checklist for contribution workflow
  • Added a reusable Claude code review workflow (review.yml) triggered from CI on PRs, using AWS Bedrock
  • Modified ci.yml to call the review workflow after build-and-test on PRs
  • Added a Husky pre-push hook that runs install, format check, lint, typecheck, and tests

🔍 Found 7 suggestions (see inline comments)

Automated review by Claude Opus 4.6 - Round 1 of 2 | 6,314 in / 1,235 out | $0.0624

Comment thread .github/workflows/review.yml
Comment thread .github/workflows/review.yml
Comment thread .github/workflows/review.yml
Comment thread .github/workflows/review.yml
Comment thread .github/workflows/review.yml
Comment thread .github/workflows/review.yml
Comment thread .husky/pre-push Outdated
Após review do PR: --offline força pnpm a usar apenas o cache local,
o que falha em fresh clones ou após branch switch que introduz
dependências novas. --frozen-lockfile sozinho garante reprodutibilidade
sem essa fragilidade — a diferença de velocidade é negligível quando
o cache já está quente, e quando não está, queremos a falha cedo
(no install) e não ofuscada por --offline.
@github-actions

Copy link
Copy Markdown

Claude Review - Round 2 (Final)

Summary

This PR migrates shared configuration (ESLint, Prettier, commitlint, TSConfig) from inline definitions to centralized @precisa-saude/* packages, bumps the minimum Node version to 22 and pnpm to 9.15.9, and removes the --offline flag from the pre-push hook's lockfile check.

Changes

  • Replaced inline ESLint, Prettier, commitlint, and TSConfig configurations with shared @precisa-saude/* config packages
  • Removed direct devDependencies on individual ESLint plugins/parsers (now transitive through the shared config)
  • Bumped minimum Node engine from >=20 to >=22 and packageManager from pnpm@9.15.4 to pnpm@9.15.9
  • Removed --offline flag from pnpm install --frozen-lockfile in the pre-push hook
  • Added .precisa.json project metadata file

🔍 Found 1 suggestions (see inline comments)

Automated review by Claude Opus 4.6 - Round 2 (Final) - No further reviews will be performed | 51,646 in / 373 out | $0.2676

Comment thread .husky/pre-push
@rlueder
rlueder merged commit 535bc9c into main Apr 22, 2026
3 checks passed
@rlueder
rlueder deleted the feat/normalize-workflows-and-templates branch April 22, 2026 00:18
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.

1 participant