Skip to content

doctor's version hint blames the server when it's the CLI escript that's behind (server 0.1.68 @ X, CLI 0.1.67 @ X → "restart the server") - #1956

Open
ryanrborn wants to merge 7 commits into
mainfrom
bugfix/1946-doctor-s-version-hint-blames-server
Open

ryanrborn wants to merge 7 commits into
mainfrom
bugfix/1946-doctor-s-version-hint-blames-server

Conversation

@ryanrborn

Copy link
Copy Markdown
Owner

Summary

When arb server doctor detects a version mismatch between the CLI and the server in dev/source mode, it previously always assumed the server's compiled version was stale and advised restarting the server. However, if the server is newer than the CLI (e.g. after tagging a new release, or if the server was updated while the escript was built earlier), the CLI is the component that is stale.

This change inspects the direction of the mismatch in ArbiterCli.Cmd.Doctor.Checks:

  • When the CLI is older than the server (by semver comparison, or when semvers match/unparseable and CLI sha is an ancestor of server sha, or same sha with CLI version < server version), doctor hints to rebuild and reinstall the arb CLI (arb install-cli).
  • When the server is older than the CLI, doctor keeps the existing hint advising restarting the server via the process manager.

Test plan

  • Unit tests in apps/arbiter_cli/test/arbiter_cli/cmd/doctor_test.exs:
    • dev/source install with server version newer than CLI hints to rebuild and reinstall CLI
    • dev/source install with server version older than CLI hints to restart the server
  • Ran mix test across arbiter_cli (all 800 tests pass).
  • Verified mix format --check-formatted passes.

References: bd-42rnnq
Closes #1946

When the server is newer than the CLI, doctor was blaming the server
and advising restarting it instead of rebuilding/reinstalling the CLI.
Determine the direction of the mismatch and give appropriate guidance.
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.

doctor's version hint blames the server when it's the CLI escript that's behind (server 0.1.68 @ X, CLI 0.1.67 @ X → "restart the server")

1 participant