Skip to content

enh: add tomo_process --upgrade and run tests on GitHub Actions - #13

Merged
RaghavaAlajangi merged 3 commits into
mainfrom
enh/tomo-process-upgrade
Oct 26, 2026
Merged

RaghavaAlajangi merged 3 commits into
mainfrom
enh/tomo-process-upgrade

Conversation

@RaghavaAlajangi

Copy link
Copy Markdown
Member

Summary

Non-technical users currently update an installation by running
git stash clear, git stash, git pull, git stash apply so that their
local edits (e.g. EMAIL in config.sh) survive. This replaces that with a
single command, tomo_process --upgrade, and adds CI so the shell tests run on
every push and PR.

Changes

  • tomo_process --upgrade
    • Stashes tracked local edits under the name tomo_process-upgrade.
    • Runs git pull --ff-only.
    • Re-applies the edits with git stash pop.
    • Prints Upgraded <old> -> <new> or Already up to date. After an upgrade it
      reminds the user to run tomo_process --restart <run_id> for runs in progress.
    • Works from any directory: it resolves the repo through realpath and cds
      into it, so a symlink on PATH is fine.
  • Safer than the manual sequence
    • It never runs git stash clear, so other stashes are untouched.
    • If git pull fails, local edits are restored and nothing is upgraded.
    • If the update conflicts with a local edit, the command exits non-zero. The
      user's changes stay in git stash list and the message tells them to ask
      the maintainer. Git leaves conflict markers in the file, so it needs fixing
      by hand.
  • Tests: 6 new tests in tests/test_tomo_process.sh use throwaway git repos
    (an origin plus a clone):
    • pull with local edits kept
    • pull with a clean tree
    • already up to date
    • conflict kept in the stash
    • not a git checkout
    • --help lists --upgrade
  • CI: .github/workflows/tests.yml runs bash tests/run_tests.sh on push to
    main and on pull requests. The MATLAB tests are skipped there because the
    runner has no matlab.
  • Docs: new "Updating to the latest version" section in the README.

Testing

  • bash tests/test_tomo_process.sh: 16 passed, 0 failed.
  • bash tests/run_tests.sh: all four shell suites pass; MATLAB tests skipped
    (no matlab locally).
  • Not yet run on the cluster. Not yet run on GitHub Actions (the workflow's first
    run will be on this PR).

Notes

  • Users need this version of tomo_process before --upgrade exists, so they
    need one last manual git pull.
  • Only tracked files are stashed. Untracked files are left alone.

@RaghavaAlajangi
RaghavaAlajangi merged commit 30a1712 into main Oct 26, 2026
1 check passed
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.

1 participant