Skip to content

ci: add CI with a gate job - #64

Merged
uniqueg merged 4 commits into
devfrom
ci/add-ci
Nov 6, 2026
Merged

uniqueg merged 4 commits into
devfrom
ci/add-ci

Conversation

@uniqueg

@uniqueg uniqueg commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Summary

Closes #59. Part of #72.

  • ci.yml / CI, as in the organisation's other repositories (cloud-registry, proTES): PR title, Lint, Test (JUnit unit and integration tests, JaCoCo coverage to Codecov), Smoke test, Scan image, and the gate CI passed. Runs on pull requests and pushes to dev. The scan only reports until build: update dependencies flagged by the scan #60.
  • On pushes to dev (fork-safe PUBLISH pattern of proTES and foca): Push image pushes the image by digest in the environment dev-images (secrets DOCKERHUB_LOGIN, DOCKERHUB_TOKEN; variable DOCKERHUB_ORG, default elixircloud), Scan image scans exactly that digest, and Publish image attests, signs (Sigstore) and tags it dev and sha-<commit>. Forks without DOCKERHUB_ORG run the checks only. Lint checks that the copies of the publish condition match.
  • scan.yml / Scan: weekly scan of latest (today the 1.1.0 image, so it reports that image's findings until 1.2.0 is out).
  • Dockerfile: the base image openjdk:8-jdk-alpine no longer exists, so the image couldn't be built. It now builds from source on Temurin 8. Not on Alpine: there, TLS handshakes of Java 8 fail. Adds a .dockerignore.
  • Removes docker-build-publish.yml, maven-publish.yml, maven-check.yml and .travis.yml. Their actions are too old to run. Until ci: fix image tags and notify Pubgrade on release #61 a tag publishes nothing.
  • Dependabot for Maven, GitHub Actions and Docker, monthly, grouped, targeting dev; README section on building and testing.

Verified

  • ./mvnw clean verify on JDK 8: 104 unit and 38 integration tests pass.
  • docker build ., then the smoke test's requests by hand: noauth and auth profiles answer as the job expects.
  • Trivy 0.75 on the image, with the same severity and ignore file options as the shared action.
  • YAML of all workflows parses (yq); the publish-condition check passes locally. actionlint runs in CI (Lint); it could not run locally (Docker denied in the sandbox).
  • CI on this PR: see the checks.

Needs before the first push to dev

  • Environment dev-images limited to branch dev, with the org secrets DOCKERHUB_LOGIN/DOCKERHUB_TOKEN reaching it, and CODECOV_TOKEN (pushes fail on Codecov upload errors, as in the other repositories).

Declined review findings

  • Build the image once and share it between Smoke test and Scan image: two builds cost minutes; the jobs stay apart so that the scan runs on its own.
  • Non-root USER in the image: the chart's security context and OpenShift set the user, and a fixed one needs testing on those. In ci: complete the setup of the org's other repos #65.
  • cloudbuild.yaml stays: it still works, and I can't tell who uses it (ci: complete the setup of the org's other repos #65).
  • Case of service-info's artifact: the running app answers tes while the YAML says TES; the smoke test compares case-insensitively.
  • A pending publish of an older push can be cancelled by a newer one (one pending job per concurrency group), failing that run's gate: inherited from the shared pattern of all repositories; to fix there, not here.
  • Comments mention release.yml, which comes with ci: fix image tags and notify Pubgrade on release #68 right after this PR.

🤖 Generated with Claude Code

Add ci.yml as in the org's other repositories (PR title, lint, test,
smoke test, image scan, gate). The scan only reports until the
dependency update.

The base image of the Dockerfile no longer exists; build from source on
Temurin 8 instead (not Alpine: TLS handshakes fail there on Java 8).
Add a .dockerignore.

Remove the old workflows, which can't run any more and would publish
over the tag of the last release on every push to master, and Travis.

Closes #59

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sourcery-ai

sourcery-ai Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Adds a non-publishing GitHub Actions CI pipeline with a required CI passed gate, covering title validation, workflow linting, Maven tests, Docker smoke tests, and vulnerability scanning. The PR also makes Docker builds self-contained and reproducible with pinned Temurin Java 8 images, configures Dependabot, removes obsolete CI/publishing workflows, and documents the updated development workflow.

Flow diagram for the CI gate pipeline

flowchart TD
    Trigger[PR or push to master] --> Title[PR title]
    Trigger --> Lint[Lint]
    Trigger --> Test[Test]
    Trigger --> Smoke[Smoke test]
    Trigger --> Scan[Scan image]
    Title --> Gate[CI passed]
    Lint --> Gate
    Test --> Gate
    Smoke --> Gate
    Scan --> Gate
Loading

File-Level Changes

Change Details Files
Introduces a GitHub Actions workflow with a single required gate that validates pull requests and master pushes without publishing artifacts.
  • Runs PR-title validation, workflow linting, Maven unit/integration tests, Docker smoke tests, and Trivy image scanning.
  • Uses pinned actions and container digests, least-privilege permissions, timeouts, concurrency control, and conditional Dependabot/title handling.
  • Aggregates job outcomes through the CI passed gate, allowing only explicitly intended skips.
.github/workflows/ci.yml
Replaces the obsolete Docker build flow with a reproducible multi-stage Java 8 image build.
  • Builds the application inside a Temurin 8 JDK stage and runs it from a Temurin 8 JRE stage pinned by digest.
  • Adds Docker build context exclusions and an initially empty, documented Trivy ignore file.
Dockerfile
.dockerignore
.trivyignore.yaml
Adds automated dependency update configuration and removes superseded CI and publishing integrations.
  • Configures monthly Dependabot updates for Maven, GitHub Actions, and Docker dependencies with Java/Spring Boot major-version constraints.
  • Removes outdated GitHub Actions publishing/check workflows and Travis CI configuration, preventing unintended publishing.
.github/dependabot.yml
.github/workflows/docker-build-publish.yml
.github/workflows/maven-check.yml
.github/workflows/maven-publish.yml
.travis.yml
Updates project documentation and status indicators for the new build and CI process.
  • Replaces the Travis badge with the GitHub Actions CI badge.
  • Documents Java/Maven verification, source-based Docker builds, smoke testing, image scanning, and the CI gate.
README.md

Possibly linked issues

  • ci: add CI with a gate job #59: The PR implements the issue’s requested CI gate, working Docker build, Dependabot, removal of obsolete publishing workflows, and build/test documentation.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@codecov

codecov Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (dev@751d482). Learn more about missing BASE report.

Additional details and impacted files
@@          Coverage Diff           @@
##             dev      #64   +/-   ##
======================================
  Coverage       ?   55.90%           
======================================
  Files          ?       64           
  Lines          ?     2150           
  Branches       ?      233           
======================================
  Hits           ?     1202           
  Misses         ?      807           
  Partials       ?      141           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@uniqueg
uniqueg marked this pull request as ready for review November 5, 2026 04:51
sourcery-ai[bot]
sourcery-ai Bot previously approved these changes Nov 5, 2026

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!

Linked issues

#59 ci: add CI with a gate job · 5 of 5 met

# Requirement Status Notes
1 Add CI with PR title, lint, unit and integration tests, image smoke test, image scan, and the passed / CI passed gate. ✅ Met The workflow defines all six jobs; the gate requires the other jobs and allows the intended title-job skips.
2 Add a Dockerfile that builds with an existing base image and a .dockerignore. ✅ Met The Dockerfile builds from source on Temurin 8, and .dockerignore limits the build context while excluding common secret files.
3 Configure Dependabot for Maven, GitHub Actions, and Docker. ✅ Met All three ecosystems are configured in .github/dependabot.yml.
4 Remove the obsolete workflows and Travis configuration, and stop publishing images from pushes to master. ✅ Met The old workflows and .travis.yml are deleted; the replacement CI workflow publishes nothing.
5 Document how to build and test the project in the README. ✅ Met The README documents ./mvnw clean verify and building the image with Docker.

Sourcery assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

uniqueg and others added 3 commits November 6, 2026 04:56
Align CI with the branching model of the org's other repositories
(`dev` + `main`): run on pull requests and pushes to `dev`; on pushes,
push the image by digest in the environment `dev-images`, scan exactly
that digest, then attest, sign and tag it `dev` and `sha-<commit>`, as
cloud-registry does. Add the weekly scan of `latest` (`scan.yml`), let
Dependabot target `dev`, and fail pushes on Codecov upload errors.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Publish only on pushes to this repository, or to forks that set
`DOCKERHUB_ORG` (`PUBLISH`, as in proTES and foca): other runs scan a
local build, upload nothing to code scanning and don't fail on Codecov
upload errors, and the gate allows the skipped publishing jobs. Name
the environment and secrets publishing needs in the README, and fix
comments from the review.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linked issues

#59 ci: add CI with a gate job · 4 of 5 met

# Requirement Status Notes
1 Add CI for PR titles, lint, unit and integration tests, image smoke tests, image scans, and a CI gate. ✅ Met The workflow defines these jobs and the CI passed gate.
2 Use a buildable Docker base image and add a .dockerignore. ✅ Met The Dockerfile builds from source with Temurin 8, and .dockerignore limits the build context and excludes secret files.
3 Configure Dependabot for Maven, GitHub Actions, and Docker. ✅ Met All three ecosystems are configured in .github/dependabot.yml.
4 Remove the obsolete workflows and Travis, and remove master image publishing pending a tag-triggered release workflow. 🟡 Partly met The old workflows and Travis are removed, and there is no master publishing, but the new workflow publishes images on pushes to dev.
5 Document how to build and test. ✅ Met The README documents ./mvnw clean verify and docker build.

Comment thread .github/workflows/ci.yml Resolved
@sourcery-ai
sourcery-ai Bot dismissed their stale review November 6, 2026 04:32

Sourcery withdrew this approval because the latest commits introduced blocking findings.

@uniqueg
uniqueg merged commit 79db934 into dev Nov 6, 2026
29 of 32 checks passed
@uniqueg
uniqueg deleted the ci/add-ci branch November 6, 2026 04:36
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.

ci: add CI with a gate job

2 participants