Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

ci: add go test, go vet, and staticcheck gates to the build-verify workflow

Aberta
#355 2 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

@Harishrs2006 já está trabalhando nisso.

Desde 9/5/2026.

  • #356 de @Harishrs2006 — aberto

Avaliação

Dificuldade
3/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
74/100
Tipo de issue
Funcionalidade
Clareza
Claramente especificada
Status de atividade
Pouca atividade
Stack de tecnologia
github-actions, go

Direção de pesquisa

Comece com .github/workflows/build-verify.yml e a etapa existente Build Go packages; depois inspecione Makefile e execute localmente as verificações Go propostas. Considera-se concluído quando o workflow executa go test ./..., go vet ./... e staticcheck em pushes e pull requests, com targets make test e make vet correspondentes e todos os testes existentes passando.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

component/build kind/task
Reason/Context

The current build-verify.yml CI workflow only compiles binaries — it never runs tests, go vet, or any static analysis. This means bugs ship silently and contributors get no automated feedback on correctness.

Proof from the current open PR queue — every one of these bugs existed in master and CI never caught them:

  1. req.Body read instead of resp.Body in DownloadArtifact → PR #338 (go vet catches this)
  2. panic(err.Error()) in connector code → PR #341, #319 (staticcheck catches this)
  3. TestDeleteContext fails on every clean checkout → PR #334 (go test ./... catches this)
  4. OAuth2 tokens printed unconditionally to stderr → PR #345 (caught by tests with log capture)
  5. String-concatenation JSON injection risk → PR #341 (staticcheck catches this)

The motivation: CI should be the first line of defence. Right now it is not.

Description

Add three mandatory quality gates to build-verify.yml that run on every PR and push:

  1. go test ./... — runs the existing unit test suite (currently never executed in CI)
  2. go vet ./... — Go's built-in analyser, catches real bugs like wrong body reads, bad panic arguments, printf mismatches
  3. staticcheck — industry-standard linter, zero config, no false positives

Also add make test and make vet targets to Makefile so contributors can run the same checks locally before pushing.

This is not a breaking change — it only adds new CI steps. If existing tests are currently failing on master,
those failures will need to be fixed as part of this PR.

Implementation ideas

Add before the existing Build Go packages step in .github/workflows/build-verify.yml:

- name: Run unit tests
  run: go test ./...

- name: Run go vet
  run: go vet ./...

- name: Run staticcheck
  uses: dominikh/staticcheck-action@v1
  with:
    version: latest
    install-go: false


`staticcheck` is preferred over `golangci-lint` — zero config, no false positives, directly catches the bug classes above.

Add to `Makefile`:

```makefile
.PHONY: test
test:
	go test ./...

.PHONY: vet
vet:
	go vet ./...
Linguagem predominante
Go
Estrelas
59
Forks
74
Merge médio
5d 17h
PRs com merge (30d)
22

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de microcks/microcks-cli

Todas as issues de microcks/microcks-cli

Issues semelhantes

Mais issues de Go

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.