Merge gort project into main#7
Merged
Merged
Conversation
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>
Codecov Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
main🤖 Generated with Claude Code