chore(governance): add AGENTS.md, maintenance documentation, Gitea workflows and sync monitoring scripts
CI - Validacao Go / Validar Codigo e Testes (push) Successful in 5m59s

This commit is contained in:
jfeng committed 2026-11-09 11:17:45 -03:00
1 parent 9337afc47e
commit 25117bd2c1
13 files changed
+1040

No files matched your search

+75
View File
@@ -0,0 +1,75 @@
# Script de Verificacao de Atualizacoes do Upstream (PowerShell)
param (
[string]$UpstreamUrl = "https://github.com/evolution-foundation/evolution-go.git"
)
$dateStr = Get-Date -Format "yyyy-MM-dd_HHmmss"
$reportFile = "relatorio_atualizacao_$dateStr.md"
Write-Host "=== Iniciando Auditoria de Atualizacoes do Upstream ($dateStr) ==="
$remotes = git remote
if ($remotes -notcontains "upstream") {
git remote add upstream $UpstreamUrl
}
git fetch upstream --tags
$localHead = (git rev-parse HEAD).Trim()
$upstreamMain = (git rev-parse upstream/main).Trim()
$newCommits = git log HEAD..upstream/main --oneline -n 15
$newCommitCount = (git rev-list --count HEAD..upstream/main).Trim()
$latestLocalTag = git describe --tags --abbrev=0 2>$null
if (-not $latestLocalTag) { $latestLocalTag = "0.7.2" }
$latestUpstreamTag = ((git tag -l --sort=-v:refname | Select-Object -First 1) + "").Trim()
$localWhatsmeow = ((Get-Content go.mod | Select-String "go.mau.fi/whatsmeow") -replace "^\s*go.mau.fi/whatsmeow\s+", "").Trim()
$impactNotice = if ([int]$newCommitCount -gt 0) {
"WARNING: Novidades detectadas no upstream ($newCommitCount novos commits). Recomenda-se abrir branch de teste em maintenance/sync-upstream."
} else {
"OK: Ambiente alinhado. Nao ha novos commits pendentes na branch principal do upstream."
}
$commitsBlock = if ($newCommits) { $newCommits -join "`r`n" } else { "Nenhum commit novo detectado." }
$sb = New-Object System.Text.StringBuilder
[void]$sb.AppendLine("# Relatorio de Monitoramento de Atualizacoes — Upstream EvoGO")
[void]$sb.AppendLine("")
[void]$sb.AppendLine("- Data da Auditoria: $(Get-Date -Format 'dd/MM/yyyy HH:mm:ss')")
[void]$sb.AppendLine("- Commit Local Base: $localHead")
[void]$sb.AppendLine("- Tag Local Recente: $latestLocalTag")
[void]$sb.AppendLine("")
[void]$sb.AppendLine("---")
[void]$sb.AppendLine("")
[void]$sb.AppendLine("## 1. Estado da Branch Principal (Upstream Main)")
[void]$sb.AppendLine("")
[void]$sb.AppendLine("- Commit Upstream Main: $upstreamMain")
[void]$sb.AppendLine("- Commits a frente no upstream: $newCommitCount")
[void]$sb.AppendLine("- Ultima Tag Upstream: $latestUpstreamTag")
[void]$sb.AppendLine("")
[void]$sb.AppendLine("### Commits Recentes no Upstream:")
[void]$sb.AppendLine('```')
[void]$sb.AppendLine($commitsBlock)
[void]$sb.AppendLine('```')
[void]$sb.AppendLine("")
[void]$sb.AppendLine("---")
[void]$sb.AppendLine("")
[void]$sb.AppendLine("## 2. Dependencia Central (Whatsmeow)")
[void]$sb.AppendLine("")
[void]$sb.AppendLine("- Versao Whatsmeow no go.mod local: $localWhatsmeow")
[void]$sb.AppendLine("")
[void]$sb.AppendLine("---")
[void]$sb.AppendLine("")
[void]$sb.AppendLine("## 3. Analise de Impacto e Conflitos")
[void]$sb.AppendLine("")
[void]$sb.AppendLine($impactNotice)
[void]$sb.AppendLine("")
[void]$sb.AppendLine("---")
[void]$sb.AppendLine("*Relatorio gerado pelo script de monitoramento EvoGO.*")
[System.IO.File]::WriteAllText((Join-Path (Get-Location) $reportFile), $sb.ToString(), [System.Text.Encoding]::UTF8)
Write-Host "Relatorio gerado com sucesso em: $reportFile"
Get-Content $reportFile
+67
View File
@@ -0,0 +1,67 @@
#!/usr/bin/env bash
set -euo pipefail
REPORT_DATE=$(date +%Y-%m-%d_%H%M%S)
REPORT_FILE="relatorio_atualizacao_${REPORT_DATE}.md"
echo "=== Iniciando Auditoria de Atualizacoes do Upstream (${REPORT_DATE}) ==="
# 1. Configurar ou garantir remoto upstream
if ! git remote | grep -q "^upstream$"; then
git remote add upstream https://github.com/evolution-foundation/evolution-go.git
fi
git fetch upstream --tags
LOCAL_HEAD=$(git rev-parse HEAD)
UPSTREAM_MAIN=$(git rev-parse upstream/main)
UPSTREAM_DEV=$(git rev-parse upstream/develop 2>/dev/null || echo "N/A")
NEW_COMMITS_COUNT=$(git rev-list --count HEAD..upstream/main 2>/dev/null || echo 0)
NEW_COMMITS_LIST=$(git log HEAD..upstream/main --oneline -n 15 2>/dev/null || echo "Nenhum commit novo.")
LATEST_LOCAL_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "nenhuma")
LATEST_UPSTREAM_TAG=$(git tag -l --sort=-v:refname | head -n 1)
# Whatsmeow version comparison
LOCAL_WHATSMEOW=$(grep "go.mau.fi/whatsmeow" go.mod | awk '{print $2}' || echo "N/A")
cat << EOF > "${REPORT_FILE}"
# Relatorio de Monitoramento de Atualizacoes — Upstream EvoGO
**Data da Auditoria:** $(date '+%d/%m/%Y %H:%M:%S')
**Commit Local Base:** \`${LOCAL_HEAD}\`
**Tag Local Recente:** \`${LATEST_LOCAL_TAG}\`
---
## 1. Estado da Branch Principal (Upstream Main)
- **Commit Upstream Main:** \`${UPSTREAM_MAIN}\`
- **Commits a frente do upstream:** ${NEW_COMMITS_COUNT}
- **Ultima Tag Upstream:** \`${LATEST_UPSTREAM_TAG}\`
### Commits Recentes no Upstream:
\`\`\`
${NEW_COMMITS_LIST}
\`\`\`
---
## 2. Dependencia Central (Whatsmeow)
- **Versao Whatsmeow no go.mod local:** \`${LOCAL_WHATSMEOW}\`
---
## 3. Analise de Impacto e Conflitos
$([ "$NEW_COMMITS_COUNT" -gt 0 ] && echo "⚠ **Novidades detectadas no upstream!** Recomenda-se abrir branch de analise em \`maintenance/sync-upstream\`." || echo "✓ **Ambiente alinhado.** Nao ha novos commits pendentes na branch principal do upstream.")
---
*Relatorio gerado automaticamente pelo pipeline de monitoramento EvoGO.*
EOF
echo "Relatorio gerado em: ${REPORT_FILE}"
cat "${REPORT_FILE}"