feat: fail-on severity, step summary, richer known issues (rebase of #128) - #185
Open
alansikora wants to merge 10 commits into
Open
alansikora wants to merge 10 commits into
alansikora wants to merge 10 commits into
Conversation
Exits non-zero when any new finding at or above the given severity level is found. Valid values: critical, bug, warning, suggestion, nitpick. Applies only to result.Findings (new findings) so CI gates don't fire on pre-existing issues. Invalid values are rejected before the review runs.
When the LLM evaluates whether an author's reply is technically valid, it now has visibility into the current state of the code around the finding line. Uses maxLines=200 with no diffText, consistent with TriageCrossFileChange. Also adds writeFileSnippet() call in buildReplyPrompt() so the snippet is included in the prompt.
When $GITHUB_STEP_SUMMARY is set (GitHub Actions), WriteUsageEnv now also appends a markdown table with per-phase and total token/cost data, giving teams visibility into review costs directly in the Actions UI.
The function was superseded by per-thread evaluation in triage.go and was not called anywhere in the codebase.
Each known issue in the "Known Issues (DO NOT DUPLICATE)" section now shows severity icon, severity level, finding ID, and title when available (extracted from the thread body's embedded JSON or parsed markdown), falling back to file:line only for old-format threads.
…atInt and test glob typo; export ValidSeverities
Buffer the whole markdown table before writing so an interrupted write cannot leave a half-formed table in the job summary, and surface the write error instead of discarding it (errcheck).
Keeps docs/review-flow.md in sync with the runner, triage and prompt changes in this branch, per the repo rule.
4 tasks
…issues" PR #179 rewrites the same Known Issues section with a strictly richer rendering — full title, severity and description per entry, plus an instruction for spotting when the incremental diff undermines an open finding. Keeping both would mean resolving a conflict in favour of #179 anyway, so drop this commit here and let #179 own the section. This reverts commit 7dd98fc.
Three fixes from the review on this branch: - --fail-on iterated only result.Findings, so a run that raised nothing new but left N unresolved findings above the threshold exited zero — defeating the CI gate the flag exists to provide. The threshold check now spans StillOpen as well, extracted into countAtOrAboveSeverity so it is testable without driving the whole pipeline. - ValidSeverities came back through the rebase's auto-merge and sat there unused, a second copy of severityLevels free to drift. ValidateSeverity already exposes the canonical check; removed it. - writeStepSummary was only reachable from inside WriteUsageEnv's GITHUB_ENV guard, so anywhere GITHUB_STEP_SUMMARY is set without GITHUB_ENV the table was silently never written. Each path now gates on its own env var.
Deploying codecanary with
|
| Latest commit: |
8de5032
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://f3ae684d.codecanary.pages.dev |
| Branch Preview URL: | https://feat-review-stack-rebased.codecanary.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rebase da stack de @anderson-0 (#123–#128) sobre o
mainatual. Os seis PRs originais eram empilhados, cada um superset do anterior — #128 continha todos. Substitui aquela stack inteira.O que entra
--fail-on <severity>— saída não-zero quando existem findings na severidade indicada ou acima, para CI poder barrar em cima do review. A contagem cobre tanto os findings novos quanto os que seguem abertos de reviews anteriores. A verificação roda depois de publicar/salvar estado/reportar uso, então um threshold estourado nunca custa ao PR seus comentários nem a telemetria.TriageHasReply— a triagem agora mostra o estado atual do código ao avaliar a réplica do autor, para o LLM julgar se a refutação procede.$GITHUB_STEP_SUMMARY— tabela por fase (modelo, tokens, custo) na página do job.BuildReevaluatePrompt— morto desde que a avaliação por thread migrou paratriage.go.O que ficou de fora
Dois commits da stack original foram descartados:
feat: filter rules by path in prompt builder— omainjá implementa isso viawriteRulesSection(&b, cfg, pr.Files), com um fallback melhor quando existem regras mas nenhuma casa com o diff.feat: include title and severity in incremental prompt known issues— feat: enrich Known Issues section with finding context #179 reescreve a mesma seção com uma renderização estritamente mais rica (título, severidade e descrição completos, mais a instrução de sinalizar quando o diff incremental derruba a premissa de um finding aberto). Revertido aqui para que feat: enrich Known Issues section with finding context #179 seja dono da seção.Ajustes na resolução dos conflitos
cmd/review/cli/review.gofoi reescrito sobre a estrutura nova domain(roteamento estrito GitHub/local), reaplicando só o--fail-on.review.ValidSeverities, duplicando oseverityLevelsque omainjá tem emformatter.go. Exporteireview.ValidateSeverity()lendo a lista canônica. OValidSeveritiesvoltou pelo auto-merge de um commit posterior e ficou sem uso — removido depois, quando o próprio CodeCanary apontou.writeStepSummarymonta a tabela inteira numstrings.Buildere escreve de uma vez, checando o erro. Também deixou de depender deGITHUB_ENV: cada caminho agora testa a sua própria variável.docs/review-flow.mdatualizado.go build,go vet,go test ./...egolangci-lint run ./...passam limpos.Fecha #128.