Skip to content

feat: add automatic version update check#98

Merged
rm-hull merged 5 commits into
mainfrom
feat/version-check
May 19, 2026
Merged

feat: add automatic version update check#98
rm-hull merged 5 commits into
mainfrom
feat/version-check

Conversation

@rm-hull
Copy link
Copy Markdown
Owner

@rm-hull rm-hull commented May 19, 2026

Implement a startup check that compares the current binary version against
the latest release on proxy.golang.org.

sequenceDiagram
    participant App
    participant UI as Model
    participant API as proxy.golang.org

    App->>UI: Init()
    UI->>UI: checkLatestVersion()
    UI->>API: GET @latest
    API-->>UI: Return latest version
    UI-->>App: latestVersionMsg
    App->>UI: Run() completes
    UI->>App: Notify if update available
Loading

Implement a startup check that compares the current binary version
against
the latest release on `proxy.golang.org`.

```mermaid
sequenceDiagram
    participant App
    participant UI as Model
    participant API as proxy.golang.org

    App->>UI: Init()
    UI->>UI: checkLatestVersion()
    UI->>API: GET @latest
    API-->>UI: Return latest version
    UI-->>App: latestVersionMsg
    App->>UI: Run() completes
    UI->>App: Notify if update available
```
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 19, 2026

TestsPassed ✅SkippedFailed
JUnit Test Report49 ran49 passed0 skipped0 failed
TestResult
JUnit Test Report
com/rm-hull/git-commit-summary/internal/config.TestLoad/Defaults✅ passed
com/rm-hull/git-commit-summary/internal/config.TestLoad/WithEnvironmentVariables✅ passed
com/rm-hull/git-commit-summary/internal/config.TestLoad✅ passed
com/rm-hull/git-commit-summary/internal/config.Test_updateProperties/handle_empty_quoted_strings✅ passed
com/rm-hull/git-commit-summary/internal/config.Test_updateProperties/empty_file,_add_new_properties✅ passed
com/rm-hull/git-commit-summary/internal/config.Test_updateProperties/existing_file,_update_properties✅ passed
com/rm-hull/git-commit-summary/internal/config.Test_updateProperties/doesnt_overwrite_values_if_new_value_is_the_same✅ passed
com/rm-hull/git-commit-summary/internal/config.Test_updateProperties/existing_file,_add_new_and_update_existing✅ passed
com/rm-hull/git-commit-summary/internal/config.Test_updateProperties/preserve_comments_and_other_lines✅ passed
com/rm-hull/git-commit-summary/internal/config.Test_updateProperties/handle_mixed_quoting_styles✅ passed
com/rm-hull/git-commit-summary/internal/config.Test_updateProperties/empty_props,_no_changes✅ passed
com/rm-hull/git-commit-summary/internal/config.Test_updateProperties/properties_with_special_characters✅ passed
com/rm-hull/git-commit-summary/internal/config.Test_updateProperties✅ passed
com/rm-hull/git-commit-summary/internal/llm_provider.TestNewProvider/GoogleProvider✅ passed
com/rm-hull/git-commit-summary/internal/llm_provider.TestNewProvider/OpenAIProvider✅ passed
com/rm-hull/git-commit-summary/internal/llm_provider.TestNewProvider/UnknownProvider✅ passed
com/rm-hull/git-commit-summary/internal/llm_provider.TestNewProvider✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestHistory/NewHistory✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestHistory/Add_and_Value✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestHistory/Undo✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestHistory/Redo✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestHistory/Undo_at_beginning✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestHistory/Redo_at_end✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestHistory/Add_truncates_future_history✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestHistory/Multiple_Undos_and_Redos✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestHistory✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestModel_Update/tea.KeyMsg_-_CtrlC_in_showSpinner_state✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestModel_Update/tea.KeyMsg_-_CtrlC_in_other_states✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestModel_Update/gitCheckMsg_-_empty_(no_staged_changes)✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestModel_Update/gitCheckMsg_-_non-empty_(staged_changes)✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestModel_Update/gitDiffMsg✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestModel_Update/llmResultMsg_-_with_user_message✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestModel_Update/llmResultMsg_-_without_user_message✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestModel_Update/commitMsg✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestModel_Update/regenerateMsg✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestModel_Update/userResponseMsg✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestModel_Update/cancelRegenPromptMsg✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestModel_Update/errMsg✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestModel_Update/abortMsg✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestModel_Update/spinner.Update_for_showSpinner_state✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestModel_Update/commitView.Update_for_showCommitView_state✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestModel_Update/promptView.Update_for_showRegeneratePrompt_state✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestModel_Update/llmResultMsg_-_YOLO_mode✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestModel_Update/llmResultMsg_-_YOLO_mode_-_empty_summary✅ passed
com/rm-hull/git-commit-summary/internal/ui.TestModel_Update✅ passed
com/rm-hull/git-commit-summary/internal/version.TestCheckLatestReturnsLatestWhenNewer✅ passed
com/rm-hull/git-commit-summary/internal/version.TestCheckLatestReturnsEmptyWhenUpToDate✅ passed
com/rm-hull/git-commit-summary/internal/version.TestCheckLatestReturnsEmptyForDevel✅ passed
com/rm-hull/git-commit-summary/internal/version.TestCheckLatestReturnsErrorOnBadStatus✅ passed

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request implements an update notification system that checks for newer versions via the Go proxy and displays a notice after the UI finishes. It also refactors UI styles and reduces startup delays. Reviewers identified a bug where HTTP errors in the version check were handled silently and suggested further UX improvements, such as removing artificial sleeps and parallelizing the version and git status checks to prevent blocking the application startup.

Comment thread internal/version/check.go Outdated
Comment thread internal/ui/model.go
Comment thread internal/ui/model.go
Comment thread internal/ui/model.go
@coveralls
Copy link
Copy Markdown

coveralls commented May 19, 2026

Coverage Report for CI Build 26122594823

Coverage increased (+0.9%) to 33.269%

Details

  • Coverage increased (+0.9%) from the base build.
  • Patch coverage: 29 uncovered changes across 4 files (28 of 57 lines covered, 49.12%).
  • No coverage regressions found.

Uncovered Changes

File Changed Covered %
internal/ui/model.go 17 3 17.65%
internal/app/app.go 7 0 0.0%
internal/version/check.go 32 25 78.13%
main.go 1 0 0.0%

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 1034
Covered Lines: 344
Line Coverage: 33.27%
Coverage Strength: 0.36 hits per line

💛 - Coveralls

rm-hull added 4 commits May 19, 2026 20:55
Return a descriptive error instead of an undefined variable when the
latest version check API returns a non-200 status code.
Reorder imports to follow standard Go formatting conventions by placing
third-party packages together.
* Refactor `CheckLatest` to support testability by extracting
configuration
  to package-level variables.
* Export `LatestResponse` and `Origin` structs.
* Add comprehensive unit tests using `httptest` to verify version
comparison
  logic and error handling.

```mermaid
sequenceDiagram
    participant App
    participant Proxy as proxy.golang.org
    App->>Proxy: GET /@latest
    Proxy-->>App: Return JSON (LatestResponse)
    App->>App: Compare semantic versions
    App-->>App: Return newer version or empty string
```
Introduce `setupLatestTestServer` to encapsulate repetitive test
boilerplate, including server lifecycle management and package variable
patching. This improves test readability and ensures cleaner resource
cleanup using `t.Cleanup`.
@rm-hull rm-hull merged commit bf1f881 into main May 19, 2026
3 checks passed
@rm-hull rm-hull deleted the feat/version-check branch May 19, 2026 20:15
rm-hull added a commit that referenced this pull request May 23, 2026
…/delete-line-capability

* 'main' of github.com:rm-hull/git-commit-summary:
  feat: separate system instructions and user prompts (#102)
  feat: support Gemini 3.5 Flash model
  chore(deps): Bump github.com/openai/openai-go/v3 from 3.36.0 to 3.37.0 (#100)
  chore(deps): Bump google.golang.org/genai from 1.57.0 to 1.58.0 (#101)
  style: reorder version notice message parts
  style: adjust new version notification format
  refactor: defer error check in app.Run
  chore: go get -u && go mod tidy (#99)
  feat: add automatic version update check (#98)
  chore(deps): Bump github.com/revrost/go-openrouter from 1.5.0 to 1.6.0 (#97)
  chore: go get -u && go mod tidy (#96)
  fix: reset cursor position in commit summary textarea
  feat: display LLM generation duration in UI
  feat: add Gemma 4 26B and 31B models
  feat: add `--yolo` flag for immediate commits (#93)
  chore: go get -u && go mod tidy (#95)
  feat: add support for including all modified files (#94)
  chore(deps): Bump google.golang.org/genai from 1.56.0 to 1.57.0 (#92)
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