Skip to content

Merge gort project into main#7

Merged
clcollins merged 10 commits into
mainfrom
claude/add-copilot-evaluation-R8OiQ
Mar 31, 2026
Merged

Merge gort project into main#7
clcollins merged 10 commits into
mainfrom
claude/add-copilot-evaluation-R8OiQ

Conversation

@clcollins

Copy link
Copy Markdown
Owner

Summary

  • Merge the full gort codebase into main
  • Includes: initial scaffold, GitHub Models AI provider, multi-arch image build/push to Quay, comprehensive CI improvements (split jobs, YAML lint, Prometheus rule validation, Containerfile checks, --help/--version flags)

🤖 Generated with Claude Code

claude and others added 10 commits March 24, 2026 01:59
Extract shared prompt-building and response-parsing logic into
pkg/ai/prompt so both Claude and Copilot providers reuse the same
code. Add internal/copilot package implementing pkg/ai.Client via
the OpenAI-compatible Copilot chat completions API. Update main.go
to support GORT_AI_PROVIDER env var for selecting between "claude"
(default) and "copilot" providers.

https://claude.ai/code/session_01PQkbNNyPpMiKE7ULAqTkhY
The Copilot Chat API (api.githubcopilot.com) is not a public API and
requires a special token flow only available to IDE extensions. Replace
with the official GitHub Models inference API (models.github.ai) which
supports server-side use with a standard GitHub PAT (models:read scope).

Changes:
- Rename internal/copilot -> internal/ghmodels
- Endpoint: /inference/chat/completions (not /chat/completions)
- Add required headers: Accept, X-GitHub-Api-Version
- Default model: openai/gpt-4.1 (vendor-prefixed)
- Env vars: GORT_AI_PROVIDER=github-models, GORT_GITHUB_MODELS_TOKEN,
  GORT_GITHUB_MODELS_MODEL

https://claude.ai/code/session_01PQkbNNyPpMiKE7ULAqTkhY
Fix import ordering and struct field alignment to pass gofmt checks.

Created with assistance from Claude 🤖 <claude@anthropic.com>

Signed-off-by: Christopher Collins <collins.christopher@gmail.com>
Refactor ParseAnalysisResponse and ParseIntentResponse to use
inFilesSection/expectingPath state flags instead of matching file
extensions. This correctly handles any file type (not just .yaml/.md).
Also add EOF flush for in-progress file blocks when trailing ---
delimiter is missing.

Addresses Copilot review feedback.

Created with assistance from Claude 🤖 <claude@anthropic.com>

Signed-off-by: Christopher Collins <collins.christopher@gmail.com>
Use trimmed line values for all header detection (SUMMARY, FIX_PLAN,
FILES, INTENT_MET, ISSUES) in both parsers for consistency and
robustness. Skip --- delimiter lines when expecting a file path.

Addresses Copilot review feedback round 2.

Created with assistance from Claude 🤖 <claude@anthropic.com>

Signed-off-by: Christopher Collins <collins.christopher@gmail.com>
Move inFile content accumulation before header detection in both
parsers so that header-like prefixes (SUMMARY:, FIX_PLAN:, etc.)
inside proposed file content are preserved verbatim instead of being
misinterpreted as parser headers. Add regression tests.

Addresses Copilot review feedback round 3.

Created with assistance from Claude 🤖 <claude@anthropic.com>

Signed-off-by: Christopher Collins <collins.christopher@gmail.com>
Verify POST method, and check request body contains required JSON
fields (model, messages, max_tokens) in the httptest server handler.

Addresses Copilot review feedback round 4.

Created with assistance from Claude 🤖 <claude@anthropic.com>

Signed-off-by: Christopher Collins <collins.christopher@gmail.com>
* Add multi-arch image build and push workflow for Quay.io

Add image-build-push workflow using Quay robot account secrets
(QUAY_ROBOT_USERNAME/QUAY_ROBOT_TOKEN), multi-arch builds (amd64+arm64),
and standard tagging (SHA, pr-N, version, latest). Update Containerfile
with OCI labels and remove hardcoded GOARCH for multi-platform support.
Update CI image-build job with OCI label validation.

Based on clcollins/dwarfbot image-build-push workflow with PR #11 changes.

Created with assistance from Claude 🤖 <claude@anthropic.com>

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Christopher Collins <collins.christopher@gmail.com>

* fix: address Copilot review comments

Remove quotes from Containerfile ARG defaults to prevent literal
quote characters in label values. Update PR build log messages
to accurately reflect that only the SHA manifest is created locally.

Created with assistance from Claude 🤖 <claude@anthropic.com>

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Christopher Collins <collins.christopher@gmail.com>

* fix: align workflow image registry with Makefile

Use quay.io/chcollin/gort in both workflows to match the Makefile
IMAGE_REGISTRY default, avoiding mismatch between CI and local builds.

Created with assistance from Claude 🤖 <claude@anthropic.com>

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Christopher Collins <collins.christopher@gmail.com>

---------

Signed-off-by: Christopher Collins <collins.christopher@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Add multi-arch image build and push workflow for Quay.io

Add image-build-push workflow using Quay robot account secrets
(QUAY_ROBOT_USERNAME/QUAY_ROBOT_TOKEN), multi-arch builds (amd64+arm64),
and standard tagging (SHA, pr-N, version, latest). Update Containerfile
with OCI labels and remove hardcoded GOARCH for multi-platform support.
Update CI image-build job with OCI label validation.

Based on clcollins/dwarfbot image-build-push workflow with PR #11 changes.

Created with assistance from Claude 🤖 <claude@anthropic.com>

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Christopher Collins <collins.christopher@gmail.com>

* fix: address Copilot review comments

Remove quotes from Containerfile ARG defaults to prevent literal
quote characters in label values. Update PR build log messages
to accurately reflect that only the SHA manifest is created locally.

Created with assistance from Claude 🤖 <claude@anthropic.com>

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Christopher Collins <collins.christopher@gmail.com>

* fix: align workflow image registry with Makefile

Use quay.io/chcollin/gort in both workflows to match the Makefile
IMAGE_REGISTRY default, avoiding mismatch between CI and local builds.

Created with assistance from Claude 🤖 <claude@anthropic.com>

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Christopher Collins <collins.christopher@gmail.com>

* feat: comprehensive CI improvements

Add --help and --version flags to gort binary, enabling binary
verification in CI and Containerfile (matching dwarfbot standard).
Split monolithic go-checks CI job into separate jobs for faster
feedback. Add YAML linting, Prometheus rule validation, and
Containerfile base image tag checks. Fix lint issues: errcheck
on resp.Body.Close, gocritic if-else chain to switch.

New files: .dockerignore, .golangci.yml, .yamllint.yaml,
.github/scripts/validate-prometheus-rules.sh,
.github/scripts/check-containerfile-tags.sh, cmd/gort/main_test.go

Based on CI patterns from clcollins/dwarfbot and clcollins/cluster-config.

Created with assistance from Claude 🤖 <claude@anthropic.com>

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Christopher Collins <collins.christopher@gmail.com>

* fix: address Copilot review comments

Inject main.version via ldflags in Containerfile builder stage.
Add SHA-256 checksum verification for yq binary download. Align
yamllint install method between CI workflow and ci-container.sh.
Use filepath.Join for cross-platform path construction in tests.

Created with assistance from Claude 🤖 <claude@anthropic.com>

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Christopher Collins <collins.christopher@gmail.com>

* fix: use shell pattern matching for registry prefix check

Replace grep regex matching with shell pattern matching to avoid
dots in registry names (e.g. quay.io) being treated as wildcards.

Created with assistance from Claude 🤖 <claude@anthropic.com>

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Christopher Collins <collins.christopher@gmail.com>

* fix: remove CMD from Containerfile, pass --help in CI

Remove CMD ["--help"] which would cause the container to exit
immediately instead of running as a long-lived server. CI now
validates with explicit --help argument.

Created with assistance from Claude 🤖 <claude@anthropic.com>

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Christopher Collins <collins.christopher@gmail.com>

* fix: pin golangci-lint version to v2.11.3

Pin golangci-lint version for reproducible CI instead of using
latest which can introduce unexpected failures on new releases.

Created with assistance from Claude 🤖 <claude@anthropic.com>

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Christopher Collins <collins.christopher@gmail.com>

---------

Signed-off-by: Christopher Collins <collins.christopher@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Resolve conflict in ghmodels/client.go: keep errcheck-safe
resp.Body.Close() wrapper from CI improvements.

Created with assistance from Claude 🤖 <claude@anthropic.com>

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Christopher Collins <collins.christopher@gmail.com>
@clcollins clcollins merged commit c8fe0eb into main Mar 31, 2026
11 of 14 checks passed
@codecov

codecov Bot commented Mar 31, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 7.40741% with 25 lines in your changes missing coverage. Please review.
✅ Project coverage is 52.15%. Comparing base (5f48118) to head (9050f5b).
⚠️ Report is 11 commits behind head on main.

Files with missing lines Patch % Lines
cmd/gort/main.go 0.00% 25 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main       #7      +/-   ##
==========================================
- Coverage   53.30%   52.15%   -1.15%     
==========================================
  Files          12       12              
  Lines         998     1020      +22     
==========================================
  Hits          532      532              
- Misses        408      430      +22     
  Partials       58       58              

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

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