Skip to content

feat: honor engine.version for copilot; add version tests for copilot and gemini - #48519

Open
pelikhan with Copilot wants to merge 4 commits into
mainfrom
copilot/ensure-supported-engine-version
Open

feat: honor engine.version for copilot; add version tests for copilot and gemini#48519
pelikhan with Copilot wants to merge 4 commits into
mainfrom
copilot/ensure-supported-engine-version

Conversation

Copilot AI commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

The copilot engine silently ignored engine.version and always installed DefaultCopilotVersion, overwriting any user-set value. Claude, codex, and gemini already honored engine.version. This aligns copilot and adds missing test coverage across all four engines.

Changes

  • copilot_engine_installation.go: Use engine.version when set; fall back to DefaultCopilotVersion only when absent (normalizing EngineConfig.Version for downstream consumers as before). The install script already skips compat-matrix resolution when an explicit version is passed, so compat.json cannot override a user-set value.

  • copilot_installer_test.go: Replace three tests that asserted version-is-ignored (TestCopilotInstallerCustomVersion, TestCopilotInstallerExpressionVersion_ViaEngineConfig, TestCopilotInstallerByokFeatureStillUsesDefaultPinnedVersion) with four tests asserting version-is-honored: TestCopilotEngineWithVersion, TestCopilotEngineWithoutVersion, TestCopilotEngineWithExpressionVersion, TestCopilotEngineWithVersionAndByokFeature.

  • gemini_engine_test.go: Add TestGeminiEngineWithVersion and TestGeminiEngineWithoutVersion, matching coverage that already existed for claude and codex.

engine:
  id: copilot
  version: 1.0.50  # now honored; previously silently overridden with DefaultCopilotVersion

Run URL: https://github.com/github/gh-aw/actions/runs/30337076577

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 7.94 AIC · ⌖ 5.43 AIC · ⊞ 7.2K ·
Comment /souschef to run again

Copilot AI and others added 2 commits July 28, 2026 04:20
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI requested a review from pelikhan July 28, 2026 04:31
@pelikhan
pelikhan marked this pull request as ready for review July 28, 2026 06:32
Copilot AI review requested due to automatic review settings July 28, 2026 06:32
@github-actions

github-actions Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Design Decision Gate 🏗️ completed the design decision gate check.

@github-actions

github-actions Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

@github-actions

github-actions Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

⚠️ PR Code Quality Reviewer failed during code quality review.

@github-actions

github-actions Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Test Quality Sentinel completed test quality analysis.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates Copilot installation to honor engine.version and expands engine-version tests.

Changes:

  • Honors explicit Copilot versions while retaining the default fallback.
  • Adds Copilot and Gemini version-selection tests.
  • Regenerates the Copilot auto smoke workflow lock file.
Show a summary per file
File Description
pkg/workflow/copilot_engine_installation.go Selects the configured Copilot version.
pkg/workflow/copilot_installer_test.go Tests Copilot version handling.
pkg/workflow/gemini_engine_test.go Tests Gemini default and custom versions.
.github/workflows/smoke-copilot-auto.lock.yml Removes generated model-pricing metadata.

Review details

Tip

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

  • Files reviewed: 4/4 changed files
  • Comments generated: 2
  • Review effort level: Medium

if workflowData.EngineConfig != nil {
if workflowData.EngineConfig.Version != "" {
copilotInstallLog.Printf("Ignoring pinned engine.version (%s): Copilot CLI install version is pinned to %s", workflowData.EngineConfig.Version, copilotVersion)
copilotVersion = workflowData.EngineConfig.Version
GH_AW_INFO_FRONTMATTER_EMOJI: "🌸"
GH_AW_COMPILED_STRICT: "true"
GH_AW_INFO_MODEL_COSTS: '{"providers":{"github-copilot":{"models":{"auto":{"cost":{"input":"8.5e-07","output":"1.55e-06"}}}}}}'
GH_AW_INFO_FEATURES: '{"gh-aw-detection":false}'

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The changes look correct and well-tested. engine.version is now honoured for Copilot CLI (was previously silently ignored), matching Gemini behaviour. Expression versions handled via ENGINE_VERSION env-var injection. Tests updated with good coverage.

🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · sonnet46 · 13.9 AIC · ⌖ 5.17 AIC · ⊞ 5K

@github-actions

Copy link
Copy Markdown
Contributor

🧪 Test Quality Sentinel Report

Test Quality Score: 85/100 — Excellent

Analyzed 6 test(s): 6 design, 0 implementation, 0 violation(s).

📊 Metrics (6 tests)
Metric Value
Analyzed 6 (Go: 6, JS: 0)
✅ Design 6 (100%)
⚠️ Implementation 0 (0%)
Edge/error coverage 6 (100%) — all tests validate positive + error paths
Duplicate clusters 0
Inflation ⚠️ Yes (copilot: 5.75:1)
🚨 Violations 0
Test File Classification Assertion Count
TestGenerateCopilotInstallerSteps copilot_installer_test.go design_test 12+
TestCopilotEngineWithVersion copilot_installer_test.go design_test 8
TestCopilotEngineWithoutVersion copilot_installer_test.go design_test 8
TestGenerateCopilotInstallerSteps_ExpressionVersion copilot_installer_test.go design_test 8+
TestCopilotEngineWithExpressionVersion copilot_installer_test.go design_test 8
TestCopilotEngineWithVersionAndByokFeature copilot_installer_test.go design_test 8
TestGeminiEngineWithVersion gemini_engine_test.go design_test 4
TestGeminiEngineWithoutVersion gemini_engine_test.go design_test 4
🔍 Quality Notes

Strengths:

  • ✅ All 6 tests are behavioral contract tests verifying user-facing guarantees (version precedence, defaults, expression handling)
  • ✅ Comprehensive version handling coverage: explicit version, no version, expression version, and feature flag interactions
  • ✅ Excellent assertion messages with descriptive error context (no silent failures)
  • ✅ Build tag compliance: both test files correctly declare //go:build !integration
  • ✅ No mock library violations (uses only standard Go testing + string assertions)

Inflation Note:
The copilot_installer_test.go shows 5.75:1 ratio (+69 test lines / +12 source lines). This is not a quality concern because:

  • Existing test functions were renamed/restructured with minimal logic changes
  • New test (TestCopilotEngineWithoutVersion) is 35 lines to comprehensively test default behavior
  • Comments and assertions were expanded for clarity on version precedence semantics
  • All additions serve distinct behavioral contracts, not duplicated patterns

Verdict

passed. 100% design tests (threshold: ≤30% implementation). All tests verify behavioral contracts with comprehensive edge-case and assertion coverage. No violations.

🧪 Test quality analysis by Test Quality Sentinel · haiku45 · 18.8 AIC · ⌖ 10.7 AIC · ⊞ 8.1K ·
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Test Quality Sentinel: 85/100. 100% design tests (threshold: ≤30% implementation). All tests verify behavioral contracts with comprehensive edge-case and assertion coverage. No violations.

@github-actions

Copy link
Copy Markdown
Contributor

🏗️ Design Decision Gate — ADR Required

This PR makes significant changes to core business logic (144 new lines in pkg/) but does not have a linked Architecture Decision Record (ADR).

📄 Draft ADR committed: docs/adr/48519-honor-engine-version-for-copilot.md — review and complete it before merging.

🔒 This PR cannot merge until an ADR is linked in the PR body.

📋 What to do next
  1. Review the draft ADR committed to your branch — it was generated from the PR diff
  2. Complete the missing sections — add context the AI could not infer, refine the decision rationale, and list real alternatives you considered
  3. Commit the finalized ADR to docs/adr/ on your branch
  4. Reference the ADR in this PR body by adding a line such as:

    ADR: ADR-48519: Honor engine.version for Copilot CLI Installation

Once an ADR is linked in the PR body, this gate will re-run and verify the implementation matches the decision.

❓ Why ADRs Matter

"AI made me procrastinate on key design decisions. Because refactoring was cheap, I could always say 'I'll deal with this later.' Deferring decisions corroded my ability to think clearly."

ADRs create a searchable, permanent record of why the codebase looks the way it does. Future contributors (and your future self) will thank you.

📋 Michael Nygard ADR Format Reference

An ADR must contain these four sections to be considered complete:

  • Context — What is the problem? What forces are at play?
  • Decision — What did you decide? Why?
  • Alternatives Considered — What else could have been done?
  • Consequences — What are the trade-offs (positive and negative)?

All ADRs are stored in docs/adr/ as Markdown files numbered by PR number (e.g., 0042-use-postgresql.md for PR #42).

🏗️ ADR gate enforced by Design Decision Gate 🏗️ · sonnet46 · 52.7 AIC · ⌖ 12.8 AIC · ⊞ 8.5K ·
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Skills-Based Review 🧠

Applied /tdd and /diagnosing-bugs — one minor test-parity comment; no blocking issues.

📋 Key Themes & Highlights

Key Themes

  • Bug fix is clean: the logic inversion in copilot_engine_installation.go correctly honors engine.version and falls back to the default only when absent, consistent with how Claude, Codex, and Gemini already behave.
  • Test inversion is correct: the three old tests that asserted version-is-ignored are replaced with tests asserting version-is-honored — the assertions are inverted in exactly the right places.
  • Parity gap: TestGeminiEngineWithoutVersion uses a nil EngineConfig while the analogous TestCopilotEngineWithoutVersion uses an explicit empty EngineConfig{} and asserts the normalization mutation. See inline comment.

Positive Highlights

  • ✅ Comment quality in copilot_engine_installation.go is concise and accurately describes the mutation-by-design semantics.
  • TestCopilotEngineWithExpressionVersion now asserts the ENGINE_VERSION env-var injection pattern rather than just the absence of the old behavior — a much stronger specification.
  • ✅ Removing GH_AW_INFO_MODEL_COSTS from the smoke test lock file is a clean housekeeping win.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · sonnet46 · 35.1 AIC · ⌖ 4.78 AIC · ⊞ 6.7K
Comment /matt to run again


if !strings.Contains(installStep, "@google/gemini-cli@"+string(constants.DefaultGeminiVersion)) {
t.Errorf("Expected default version %q in install step when no engine.version set, got:\n%s", constants.DefaultGeminiVersion, installStep)
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[/tdd] TestGeminiEngineWithoutVersion omits the EngineConfig.Version normalization assertion that TestCopilotEngineWithoutVersion includes. Because WorkflowData.EngineConfig is nil here, any future Gemini normalization logic similar to Copilot's would not be exercised.

💡 Suggested addition

Switch to an explicit empty EngineConfig and assert the normalized version afterward:

workflowData := &WorkflowData{
    Name:         "test-workflow",
    EngineConfig: &EngineConfig{}, // match Copilot test pattern
}
// after GetInstallationSteps:
if workflowData.EngineConfig.Version != string(constants.DefaultGeminiVersion) {
    t.Errorf("Expected EngineConfig.Version normalized to %q, got %q",
        constants.DefaultGeminiVersion, workflowData.EngineConfig.Version)
}

This keeps the test set consistent and will catch any future normalization regression in the Gemini engine.

@copilot please address this.

@github-actions

Copy link
Copy Markdown
Contributor

PR Triage

  • Category: bug | Risk: medium | Score: 68/100
  • Impact 35 · Urgency 15 · Quality 18
  • Recommended action: fast_track

Fixes silently-ignored engine.version config for the copilot engine; adds test coverage across engines. Two AI-reviewer approvals. No CI check-run data found — verify CI before merge.

Generated by 🔧 PR Triage Agent · sonnet50 · 50.9 AIC · ⌖ 5.23 AIC · ⊞ 7.5K ·

@pelikhan

Copy link
Copy Markdown
Collaborator

@run pr-finisher skill

@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot run pr-finisher skill

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants