Skip to content

ci: improve the API-spec workflow (adopted from os2display) - #40

Merged
turegjorup merged 3 commits into
developfrom
ci/apispec-adopt-os2display
Jul 8, 2026
Merged

ci: improve the API-spec workflow (adopted from os2display)#40
turegjorup merged 3 commits into
developfrom
ci/apispec-adopt-os2display

Conversation

@turegjorup

Copy link
Copy Markdown
Contributor

Adopt the stronger parts of os2display/display-api-service's apispec workflow, keeping our Task-based export and single public/spec.yaml.

Changes to api-spec.yml

  • Path-filtered trigger — the job (which spins up the full stack via task site:update) now runs only when the spec can actually change: src/**/*.php, config/**, composer.json/.lock, docker-compose*.yml, public/spec.yaml. Previously it ran on every PR.
  • Least-privilege permissions:contents: read + pull-requests: write on both jobs (they comment on PRs).
  • Vendor cacheactions/cache@v5 keyed on composer.lock.
  • oasdiff breaking-change detection — replaces the aging openapitools/openapi-diff Docker image with oasdiff/oasdiff-action@v0.0.44 (maintained Go tool, richer markdown changelog + fail-on: ERR). Includes the headers: [] → {} sanitisation shim oasdiff needs. Posts a single sticky PR comment (HTML-marker keyed) that updates in place and is marked resolved when the diff clears — no comment pile-up.

Deliberately not adopted

Task→docker-compose switch (we use task for local-dev parity), and JSON spec export (no consumer here).

Notes

  • Kept action versions as-is on the lines I didn't touch; version bumps are PR ci: update GitHub Actions to latest versions #39's concern (they'll reconcile on merge).
  • github.base_ref is passed via env: and quoted (workflow-injection hygiene), though it's the repo-controlled target branch, not attacker input.
  • Heads-up: with the path filter, if api-spec is a required status check, PRs that don't touch those paths won't report it — adjust branch protection to "not required when skipped" if needed.

prettier + markdownlint clean. (Behavioural verification happens on the PR's own CI run, since it's a workflow change.)

Adopt the stronger parts of os2display/display-api-service's apispec workflow,
keeping our Task-based export and single public/spec.yaml:

- Path-filtered trigger so the job only runs when the spec can actually change
  (src, config, composer, docker-compose, the spec itself).
- Least-privilege `permissions:` (contents: read, pull-requests: write) on both
  jobs.
- Cache vendor/ between runs.
- Replace openapitools/openapi-diff with oasdiff (maintained, richer markdown
  changelog); post a single sticky PR comment that updates in place and resolves
  when the diff clears.
@codecov-commenter

codecov-commenter commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.89%. Comparing base (d6f37ac) to head (2211a92).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files
@@            Coverage Diff             @@
##             develop      #40   +/-   ##
==========================================
  Coverage      71.89%   71.89%           
  Complexity       226      226           
==========================================
  Files             29       29           
  Lines            637      637           
==========================================
  Hits             458      458           
  Misses           179      179           
Flag Coverage Δ
unittests 71.89% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@turegjorup turegjorup self-assigned this Jul 8, 2026
…s2display

# Conflicts:
#	.github/workflows/api-spec.yml
#	CHANGELOG.md
@turegjorup
turegjorup merged commit 74de5a0 into develop Jul 8, 2026
10 checks passed
@turegjorup
turegjorup deleted the ci/apispec-adopt-os2display branch July 8, 2026 09: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.

2 participants