Skip to content

Add GitHub Actions harness for PR gating#2

Merged
e-fu merged 2 commits into
mainfrom
add-ci-harness
May 15, 2026
Merged

Add GitHub Actions harness for PR gating#2
e-fu merged 2 commits into
mainfrom
add-ci-harness

Conversation

@e-fu
Copy link
Copy Markdown
Contributor

@e-fu e-fu commented May 15, 2026

Summary

  • Adds .github/workflows/harness.yml running format / compile (warnings-as-errors) / credo --strict / doctor --raise / sobelow / mix test.json --cover --cover-threshold 70 / dialyzer on every push to main and every PR.
  • Pins Erlang 27.3.4.11 / Elixir 1.18.4-otp-27 via .tool-versions so CI and local dev never drift on mix format output.
  • Coverage threshold: 70% (main currently 73.62%, small margin). Raise as coverage climbs.

Why

Closes the no-CI gap noted while reviewing the Task 6 PR (#1). Every PR push now gets the full Elixir harness as a GitHub check — visible to user, agent, and PR-review tooling.

Test plan

  • mix format --check-formatted — clean
  • mix compile --warnings-as-errors — clean
  • mix credo --strict --ignore TagTODO,TagFIXME — 0 issues, 17 source files
  • mix doctor --raise — 100% doc/moduledoc/spec coverage
  • mix sobelow — scan complete, no findings
  • mix test.json --cover — 73.62% (above 70% threshold)
  • mix dialyzer — verified passing in prior sessions via mix dialyzer.json; CI first run will build PLT (~5 min), then cached

Notes

  • .tool-versions uses 27.3.4.11 (latest 27.x patch in asdf list erlang) — setup-beam fetches precompiled binaries for any named version.
  • mix test.json's test_helper.exs already excludes :integration tags by default; no --exclude integration flag needed.

Summary by CodeRabbit

  • Chores
    • Added a new CI workflow to run automated code quality checks: strict compilation, format check, static analysis, security scans, type checking, and tests with a 70% coverage gate.
    • Updated development toolchain to newer Erlang/Elixir versions.
    • Expanded type-checker ignore patterns to reduce noisy warnings.

Review Change Stack

Adds .github/workflows/harness.yml running format / compile / credo /
doctor / sobelow / test+cover@70% / dialyzer on every push to main and
every PR.

Versions pinned via .tool-versions (Erlang 27.3.4.11, Elixir 1.18.4-otp-27)
so CI and local dev stay in lockstep on mix format output.

Coverage threshold set at 70% — main currently sits at 73.62%, leaving
a small margin. Raise as coverage climbs.

Closes the no-CI gap noted while reviewing the Task 6 PR.
Copilot AI review requested due to automatic review settings May 15, 2026 10:07
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 15, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6f47bd5e-af0c-4463-884a-4d92025366d7

📥 Commits

Reviewing files that changed from the base of the PR and between f0dc73f and b8983e1.

📒 Files selected for processing (1)
  • .dialyzer_ignore.exs

📝 Walkthrough

Walkthrough

Adds a GitHub Actions workflow "Harness" that pins Erlang/Elixir via .tool-versions and runs deps install, compile (warnings-as-errors), format check, Credo, doctor, sobelow, tests with a 70% coverage gate, and Dialyzer; also updates .tool-versions and Dialyzer ignore patterns.

Changes

CI Harness Setup

Layer / File(s) Summary
Workflow foundation and toolchain configuration
.github/workflows/harness.yml, .tool-versions
Workflow name and triggers (pull_request, push to main), minimal permissions, concurrency, job MIX_ENV=test, toolchain pinned via .tool-versions (Erlang 27.3.4.11, Elixir 1.18.4-otp-27) and setup-beam, plus caching for deps, _build, and Dialyzer PLTs.
Build and format validation
.github/workflows/harness.yml
Fetches dependencies, compiles with --warnings-as-errors, and enforces mix format --check-formatted.
Code quality and static analysis
.github/workflows/harness.yml
Runs mix credo --strict excluding TagTODO/TagFIXME, mix doctor --raise, and mix sobelow.
Test execution and type verification
.github/workflows/harness.yml, .dialyzer_ignore.exs
Runs mix test.json with coverage enforcement (--cover-threshold 70, --summary-only) and mix dialyzer; updates .dialyzer_ignore.exs to ignore ExRLP warnings.

🎯 3 (Moderate) | ⏱️ ~20 minutes

🐰 A tiny rabbit hums with cheer,
I pin the tools and run the gear,
Format, lint, and tests in flight,
Seventy percent keeps metrics tight,
Dialyzer sleeps — the tree is clear. 🥕

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and clearly summarizes the main change: adding a GitHub Actions workflow for PR gating and CI checks.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch add-ci-harness

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
.github/workflows/harness.yml (1)

25-27: Add a job timeout to cap hung runs.

Consider adding timeout-minutes on the harness job so stalled runs (especially initial PLT/dialyzer) don’t consume runners indefinitely.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/harness.yml around lines 25 - 27, The harness job
currently lacks a timeout and can hang indefinitely; add a timeout-minutes
setting to the harness job definition (the job named "harness") to cap run time
(e.g., timeout-minutes: 60 or your desired limit) so stalled steps like
PLT/dialyzer won't consume runners indefinitely; update the harness job block in
the workflow to include this key alongside name and runs-on.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In @.github/workflows/harness.yml:
- Around line 25-27: The harness job currently lacks a timeout and can hang
indefinitely; add a timeout-minutes setting to the harness job definition (the
job named "harness") to cap run time (e.g., timeout-minutes: 60 or your desired
limit) so stalled steps like PLT/dialyzer won't consume runners indefinitely;
update the harness job block in the workflow to include this key alongside name
and runs-on.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 84d217d1-f1c9-4afd-b141-c124096446e9

📥 Commits

Reviewing files that changed from the base of the PR and between d5e7dd2 and f0dc73f.

📒 Files selected for processing (2)
  • .github/workflows/harness.yml
  • .tool-versions

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f0dc73f5bc

ℹ️ 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".

run: mix doctor --raise

- name: Sobelow (honors .sobelow-conf, exit=Low)
run: mix sobelow
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Make Sobelow fail the harness on findings

As written, this step only reports Sobelow results; it does not gate the PR when findings are present. Sobelow's task docs list --exit as the option that returns a non-zero exit status, and this repo has no .sobelow-conf to supply that option, so a PR introducing a Low/Medium/High finding would still pass this job. Add --exit Low or save an equivalent config if this harness is meant to block security findings.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a GitHub Actions CI “harness” to gate pushes to main and all pull requests with a deterministic Elixir toolchain, and pins Erlang/Elixir versions via .tool-versions to keep CI and local formatting/compilation consistent.

Changes:

  • Add .github/workflows/harness.yml to run format, compile (warnings-as-errors), Credo, Doctor, Sobelow, tests+coverage gate, and Dialyzer on PRs and pushes to main.
  • Add .tool-versions pinning Erlang and Elixir versions for deterministic local/CI toolchains.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
.tool-versions Pins Erlang/Elixir versions for deterministic CI and local development.
.github/workflows/harness.yml Introduces a CI workflow to run the full Elixir quality/test/static-analysis harness on PRs and main.
Comments suppressed due to low confidence (2)

.github/workflows/harness.yml:65

  • The comment mentions .doctor.exs and a raise=false setting, but there is no .doctor.exs file in the repo. Either add the configuration file being referenced, or adjust the comment to describe the actual behavior (i.e., running mix doctor --raise without relying on a config override).
      - name: Doctor (--raise overrides .doctor.exs raise=false to gate CI)
        run: mix doctor --raise

.github/workflows/harness.yml:68

  • The comment claims Sobelow "honors .sobelow-conf", but there is no .sobelow-conf in this repository. Either add the config file or update the comment to avoid pointing to a non-existent configuration.
      - name: Sobelow (honors .sobelow-conf, exit=Low)
        run: mix sobelow

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +28 to +30
env:
MIX_ENV: test
steps:
Comment on lines +59 to +60
# so harness only fails on real Credo issues (see development-philosophy.md
# § "TODO Comment Requirements").
test/support/tempo_test_helpers.ex calls ExRLP.encode/1 — ExRLP is a
transitive dep via onchain (and only compiles in :test env via
elixirc_paths). Dialyxir's :apps_direct PLT strategy doesn't pull in
transitive deps, so the call surfaces as :unknown_function in CI.

Local dev env dialyzer didn't trip this because test/support isn't
compiled there. CI runs with MIX_ENV=test, which exposes it.

Per CLAUDE.md: ExRLP is documented as a transitive dep needing
@dialyzer suppressions — same class as Jason / Req / Cartouche /
Onchain / Descripex already in this file.
@e-fu e-fu merged commit 1c59f25 into main May 15, 2026
2 checks passed
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.

2 participants