feat: validacao com testcontainers, build docker no ci e retencao de pacotes - #12
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dd5eb469de
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| try: | ||
| import testcontainers | ||
| import docker | ||
| except ImportError: | ||
| raise unittest.SkipTest("testcontainers ou docker não estão instalados") |
There was a problem hiding this comment.
Install container-test dependencies before gating releases
When .github/workflows/release.yml discovers this new test, neither testcontainers nor docker has been installed—the workflow only runs plain pip install . after the test step—so this branch skips the entire class and the dependent job can publish a tagged or manually dispatched image without exercising its runtime validation. Install the test extras before the release test step or otherwise make the container-validation job a prerequisite of publishing.
Useful? React with 👍 / 👎.
| try: | ||
| cls.imagem = obter_ou_construir_imagem(cls.imagem) | ||
| except Exception as e: | ||
| raise unittest.SkipTest(f"Falha ao obter ou construir imagem Docker: {e}") |
There was a problem hiding this comment.
Fail when obtaining or building the image fails
When the requested image is absent and its Dockerfile build fails, this catches the build exception and converts it into SkipTest, so a direct invocation of the new Testcontainers suite exits successfully instead of detecting the broken image. Only unavailable optional infrastructure should be skipped; failures from obter_ou_construir_imagem should propagate as test failures.
Useful? React with 👍 / 👎.
| prune-packages: | ||
| name: Prune Older Packages (Keep Last 3) | ||
| needs: build-and-push-docker | ||
| runs-on: ubuntu-latest |
There was a problem hiding this comment.
Keep package cleanup out of the release success path
Every completed release already triggers the retention action in .github/workflows/cleanup-packages.yml, so this job performs the same destructive cleanup a second time. More importantly, a transient GHCR/API failure here now marks an otherwise successfully built and pushed release as failed; the existing cleanup workflow then skips its own retention job because it requires the release conclusion to be success. Remove this duplicate job and leave retention to the separately serialized workflow.
Useful? React with 👍 / 👎.
Implementa a validacao da imagem Docker utilizando Testcontainers, adiciona a verificacao do build no GitHub Actions CI e garante a retencao das ultimas 3 versoes no GitHub Packages.