Skip to content

Add daily release update check to compile command#7032

Merged
pelikhan merged 5 commits into
mainfrom
copilot/add-daily-release-check
Dec 20, 2025
Merged

Add daily release update check to compile command#7032
pelikhan merged 5 commits into
mainfrom
copilot/add-daily-release-check

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Dec 20, 2025

Update Check Feature for Compile Command

Implementation Complete ✅

  • Create update check module (pkg/cli/update_check.go)
    • Implement daily check tracking in temp directory
    • Use go-gh to query GitHub releases API
    • Handle connectivity errors gracefully (non-blocking)
    • Detect CI/MCP server mode to disable checks
    • Use IsReleasedVersion helper for robust version detection
  • Add --no-check-update flag to compile command
  • Integrate update check into compile orchestrator
    • Call check at start of compilation (non-blocking)
    • Display message with update instructions if newer version found
  • Add comprehensive test coverage
    • Unit tests for all helper functions (6 test cases)
    • Integration tests for end-to-end behavior (5 test scenarios)
  • Manually test compile command with update check
    • Verified --no-check-update flag works
    • Confirmed CI mode detection works
    • Tested update check runs non-blocking
    • Verified error handling (silently ignores connectivity errors)

Features

Daily check - Only checks once per 24 hours, tracked in /tmp/gh-aw/gh-aw-last-update-check
CI/MCP disabled - Automatically disabled in CI environments and MCP server mode
Non-blocking - Runs in goroutine, doesn't slow down compilation
Error handling - Silently ignores all connectivity/API errors
go-gh integration - Uses existing github.com/cli/go-gh/v2 dependency
User control - --no-check-update flag to disable manually
Clear messaging - Shows update instructions: gh extension upgrade githubnext/gh-aw
Robust version detection - Uses IsReleasedVersion helper for proper semantic versioning validation

Testing

  • Unit tests (6 test cases): Validate all helper functions, environment detection, timestamp tracking, and error handling
  • Integration tests (5 test scenarios): End-to-end verification with actual binary execution
    • CI mode detection
    • --no-check-update flag functionality
    • Timestamp-based check frequency
    • Development build detection
    • Help text verification
  • Manual testing completed
  • Linting and formatting validated
Original prompt

The compile command should try to check for a release update once a day to detect a newer version.

  • disabled in ci mode / mcp server
  • only once a day, keep track in a temp location
  • non blocking, attempt download during compilation and show result if any. Ignore any connectivity error. Only attempt once a day.
  • use go-gh to query release
  • show message with instructions to update ("gh aw update")
  • support disabling through "--no-check-update"

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot make sure it only fails silently.

Copilot AI and others added 2 commits December 20, 2025 02:46
- Create update_check.go module with daily check logic
- Add --no-check-update flag to compile command
- Check disabled in CI/MCP server mode
- Track last check time in temp directory
- Use go-gh to query GitHub releases API
- Non-blocking check with connectivity error handling
- Display update message with upgrade instructions
- Add comprehensive tests for update check functionality

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Verified --no-check-update flag works correctly
- Confirmed CI mode detection works
- Tested update check runs non-blocking
- All linting and formatting checks pass

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add daily release update check during compilation Add daily release update check to compile command Dec 20, 2025
Copilot AI requested a review from pelikhan December 20, 2025 02:56
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Dec 20, 2025

@copilot make sure it only fails silently.

Confirmed - all failure cases fail silently:

  1. API/network errors (line 167-170): Logged to debug only, function returns
  2. File write errors (line 140): Logged to debug only, continues
  3. Panics (line 238-241): Recovered and logged to debug only
  4. Version check failures: All return early with debug logging only

Debug logs (updateCheckLog.Printf) only appear when DEBUG env var is set. No errors are shown to users - they only see the update notification when a newer version is actually available.

The implementation already meets the requirement. (eb4c32d)

@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot use isRelease helper to determine if it is a released build

@pelikhan pelikhan marked this pull request as ready for review December 20, 2025 06:55
- Export isReleasedVersion as IsReleasedVersion in pkg/workflow
- Update update_check.go to use workflow.IsReleasedVersion
- More robust check than simple "dev" string matching
- Validates semantic versioning format and filters dev/dirty/test builds

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Dec 20, 2025

@copilot use isRelease helper to determine if it is a released build

Done. Exported isReleasedVersion as IsReleasedVersion in pkg/workflow and updated update_check.go to use workflow.IsReleasedVersion(). This provides more robust version detection - validates semantic versioning format (x.y.z) and filters out builds containing "dev", "dirty", or "test" patterns. (0cd08bf)

@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot add integration test

- Test update check disabled in CI mode
- Test --no-check-update flag functionality
- Test timestamp-based check frequency
- Test development build detection
- Test flag appears in help text
- All tests use //go:build integration tag
- Tests build actual binary and verify end-to-end behavior

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Dec 20, 2025

@copilot add integration test

Added integration tests in update_check_integration_test.go covering:

  • CI mode detection (update check disabled)
  • --no-check-update flag functionality
  • Timestamp-based check frequency
  • Development build detection
  • Help text verification

Tests build the actual binary and verify end-to-end behavior using //go:build integration tag. All tests pass. (2607bca)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 20, 2025

🎉 Yo ho ho! Smoke Copilot Safe Inputs found the treasure and completed successfully! ⚓💰

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 20, 2025

✅ Firewall validation complete... Smoke Codex Firewall confirmed network sandboxing is operational. 🛡️

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 20, 2025

🤖 DIAGNOSTIC COMPLETE: Smoke Copilot No Firewall STATUS: ALL_UNITS_OPERATIONAL. MISSION_SUCCESS.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 20, 2025

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 20, 2025

🎬 THE ENDSmoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 20, 2025

🎉 Yo ho ho! Changeset Generator found the treasure and completed successfully! ⚓💰

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 20, 2025

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

@github-actions
Copy link
Copy Markdown
Contributor

Smoke Test Results

  • ✅ File Writing: Created test file successfully
  • ✅ Bash Tool: File read verification passed
  • ❌ Safe Input gh Tool: Tool not available

Overall Status: FAIL

The safeinputs-gh tool is not available in the current workflow configuration.

Ahoy! This treasure was crafted by 🏴‍☠️ Smoke Copilot Safe Inputs fer issue #7032 🗺️

@github-actions
Copy link
Copy Markdown
Contributor

Smoke Test Results

Last 2 merged PRs:

Test Results:

  • ✅ GitHub MCP (reviewed PRs)
  • ✅ File Writing (/tmp/gh-aw/agent/smoke-test-copilot-20394844112.txt)
  • ✅ Bash Tool (file verified)
  • ✅ Playwright MCP (page title: "GitHub · Change is constant. GitHub keeps you ahead. · GitHub")
  • ❌ Safe Input gh Tool (no authentication in bash context)

Status: FAIL (gh tool not authenticated)

🤖 DIAGNOSTIC REPORT GENERATED BY Smoke Copilot No Firewall fer issue #7032 🗺️

@github-actions
Copy link
Copy Markdown
Contributor

Smoke Test Results

Last 2 Merged PRs:

Test Results:

  • ✅ GitHub MCP Testing
  • ✅ File Writing Testing
  • ✅ Bash Tool Testing
  • ✅ GitHub MCP Default Toolset Testing (get_me correctly unavailable)
  • ✅ Cache Memory Testing

Overall: PASS

cc: @pelikhan

📰 BREAKING: Report filed by Smoke Copilot fer issue #7032 🗺️

@github-actions
Copy link
Copy Markdown
Contributor

OpenAI curl blocked: ✅
example.com blocked: ✅
GitHub MCP merged PRs: Add integration tests for safe output job configurations; Refactor: eliminate sanitization pipeline duplication between core and full modules ✅
File write/read /tmp/gh-aw/agent/smoke-test-codex-firewall-20394844099.txt: ✅
Network: SANDBOXED
Overall: PASS

🔥 Firewall tested by Smoke Codex Firewall fer issue #7032 🗺️

@github-actions
Copy link
Copy Markdown
Contributor

PRs:

  • Add integration tests for safe output job configurations
  • Refactor: eliminate sanitization pipeline duplication between core and full modules
    Tests: ✅ GitHub MCP PR fetch, ✅ file write/read /tmp/gh-aw/agent, ✅ Playwright title contains GitHub, ✅ cache memory file, ❌ safeinputs-gh (tool unavailable)
    Overall: FAIL

🔮 The oracle has spoken through Smoke Codex fer issue #7032 🗺️

@github-actions
Copy link
Copy Markdown
Contributor

Smoke Test Results - Claude Sonnet 4.5

PRs Reviewed:

Tests:
✅ GitHub MCP - last 2 merged PRs retrieved
✅ File Writing - agent directory file created
✅ Bash Tool - file verification successful
✅ Playwright MCP - navigated to GitHub, title contains "GitHub"
✅ Cache Memory - test file created and verified
⚠️ Safe Input gh Tool - tool not available in current context

Status: PASS (5/6 tests successful)

💥 [THE END] — Illustrated by Smoke Claude fer issue #7032 🗺️

@pelikhan pelikhan merged commit 4e0efe1 into main Dec 20, 2025
59 checks passed
@pelikhan pelikhan deleted the copilot/add-daily-release-check branch December 20, 2025 13:18
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.

2 participants