Skip to content

fix: add git to Docker image and improve missing-git error message#801

Merged
reuvenharrison merged 1 commit intomainfrom
fix/add-git-to-docker
Mar 9, 2026
Merged

fix: add git to Docker image and improve missing-git error message#801
reuvenharrison merged 1 commit intomainfrom
fix/add-git-to-docker

Conversation

@reuvenharrison
Copy link
Collaborator

Summary

  • Adds git to the Alpine Docker image — required for git revision syntax (origin/main:openapi.yaml) introduced in feat: support git revision syntax for spec paths #799
  • Improves the error message when git is not in PATH from a raw exec error to is git installed and in PATH?

Why

The oasdiff-action pr-comment now passes origin/main:openapi.yaml directly to the oasdiff binary, which calls git show internally. The Docker container had no git, causing:

failed to load spec from git revision "origin/main:simple.yaml": exec: "git": executable file not found in $PATH

Since the action Dockerfiles are all FROM tufin/oasdiff:stable, adding git to the base image fixes the action without any changes to oasdiff-action itself.

Test plan

  • Docker image builds successfully
  • TestLoadInfo_GitRevisionNoGit passes with the improved error message

🤖 Generated with Claude Code

@codecov-commenter
Copy link

codecov-commenter commented Mar 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.57%. Comparing base (30adfba) to head (d15d3dc).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #801   +/-   ##
=======================================
  Coverage   89.57%   89.57%           
=======================================
  Files         239      239           
  Lines       12179    12179           
=======================================
  Hits        10909    10909           
  Misses        840      840           
  Partials      430      430           
Flag Coverage Δ
unittests 89.57% <100.00%> (ø)

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

☔ View full report in Codecov by Sentry.
📢 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.

git is required for git revision syntax (e.g. origin/main:openapi.yaml).
Add it to the Alpine image so Docker and action users get it automatically.
Improve the error message when git is not in PATH to make the fix obvious.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@reuvenharrison reuvenharrison force-pushed the fix/add-git-to-docker branch from ec0414b to d15d3dc Compare March 9, 2026 11:34
@reuvenharrison reuvenharrison merged commit d723640 into main Mar 9, 2026
14 checks passed
@reuvenharrison reuvenharrison deleted the fix/add-git-to-docker branch March 9, 2026 11:38
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