Commit 0945009
authored
Shell completion auto-install and pre-commit hook improvements (#1124)
* Add CI lint gate and local precheck command
- Add lint-gate job to test.yml that runs fast checks (formatting,
spelling, linting) before expensive test matrix and HPC jobs start
- Add concurrency groups to test.yml, coverage.yml, cleanliness.yml,
and bench.yml to cancel superseded runs on new pushes
- Add ./mfc.sh precheck command for local CI validation before pushing
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Fix precheck.sh portability and usability issues
- Add cross-platform hash function (macOS uses md5, Linux uses md5sum)
- Validate -j/--jobs argument (require value, must be numeric)
- Improve error messages with actionable guidance
- Clarify that formatting has been auto-applied when check fails
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Gate benchmarks on Test Suite completion
Add wait-for-tests job that polls GitHub API to ensure:
- Lint Gate passes first (fast fail)
- All Github test jobs complete successfully
- Only then do benchmark jobs start
This prevents wasting HPC resources on benchmarking code that
fails tests, while preserving the existing maintainer approval gate.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Auto-install git pre-commit hook for precheck
- Add .githooks/pre-commit that runs ./mfc.sh precheck before commits
- Auto-install hook on first ./mfc.sh invocation (symlinks to .git/hooks/)
- Hook only installs once; subsequent runs skip if already present
- Developers can bypass with: git commit --no-verify
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Use dynamic CPU count in pre-commit hook
Auto-detect available CPUs for parallel formatting:
- Linux: nproc
- macOS: sysctl -n hw.ncpu
- Fallback: 4
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Show CPU count in pre-commit hook output
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Add precheck command to CLI and autocomplete
Register precheck in commands.py so it appears in:
- Shell tab completion
- CLI documentation
- ./mfc.sh precheck --help
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Auto-update installed shell completions on regeneration
When completion scripts are auto-regenerated, also update the installed
completions at ~/.local/share/mfc/completions/ if they exist.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Show source command when completions auto-update
When installed shell completions are auto-updated, print a message
with the appropriate source command for the user's detected shell.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Always check installed completions on every run
Previously, installed completions only updated when source files
changed and regeneration occurred. Now we also check if the installed
completions are older than the generated ones (e.g., after git pull
brings new pre-generated completions).
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Prevent directory completion fallback in shell completions
- Remove -o bashdefault from bash complete command to prevent
falling back to directory completion when no matches found
- Add explicit : (no-op) for zsh commands without arguments to
prevent default file/directory completion
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Auto-install completions and fix bash completion options
- Auto-install completions on first mfc.sh run (via main.py)
- Add -o filenames back to bash complete (needed for file completion)
- Keep -o bashdefault removed to prevent directory fallback
- Simplify code by having __update_installed_completions handle both
install and update cases
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Auto-install completions from mfc.sh with shell rc setup
Move completion auto-install to mfc.sh so it runs for ALL commands
including help, precheck, etc. This ensures completions are always
set up on first run.
- Install completion files to ~/.local/share/mfc/completions/
- Add source line to .bashrc or fpath to .zshrc
- Tell user to restart shell or source the file
- main.py now only handles updates when generated files change
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Clarify verbose, debug, and debug-log flag documentation
- -v/-vv/-vvv: output verbosity levels
- --debug: build with debug compiler flags (for MFC Fortran code)
- --debug-log/-d: Python toolchain debug logging (not MFC code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Cap pre-commit hook parallelism at 12 jobs
Avoid hogging resources on machines with many cores.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Fix completion auto-install to check for files, not just directory
Previously checked if ~/.local/share/mfc/completions/ existed.
Now checks if the actual completion file exists for the user's shell.
This handles the edge case of an empty completions directory.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Auto-update outdated shell completions
Check if installed completions are older than source files and
update them automatically. Shows message with source command
only on install or update, silent otherwise.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Auto-activate completions when mfc.sh is sourced
When running 'source ./mfc.sh' instead of './mfc.sh', completions
are activated immediately in the current shell. This is useful for
users who want tab completion without restarting their shell.
- './mfc.sh' - installs/updates, shows source command to run
- 'source ./mfc.sh' - installs/updates AND activates immediately
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Use workflow_run for benchmarks and extract completion logic
- Replace polling-based wait-for-tests job with workflow_run trigger
that fires when Test Suite completes (more efficient, no wasted
runner minutes)
- Extract shell completion setup from mfc.sh to dedicated
toolchain/bootstrap/completions.sh script for better maintainability
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Suppress verbose package list from uv install by default
Filter out individual package lines (+ pkg==1.0) from uv output
while keeping progress info (Resolved, Built, Installed). Use -v
flag to see full package list.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Compact splash screen from 45 to 20 lines
Remove decorative boxes and condense layout while keeping all
essential information: commands with aliases, descriptions, and
quick start guide.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Pass arguments to python.sh for verbose flag support
Now ./mfc.sh init -v and similar commands respect verbosity
flags during venv/package installation.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Handle ./mfc.sh -v without command (show help, not error)
When only flags are given without a command, show help screen
instead of passing flags to main.py which would error.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Fix splash screen to use COMMANDS as single source of truth
Use the CLI schema from commands.py instead of hardcoded
descriptions for the compact splash screen.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Address AI reviewer feedback on PR #1124
1. Fix workflow_run.actor.login returning re-runner instead of PR author
by fetching actual PR author from GitHub API
2. Quote all $@ in mfc.sh to handle arguments with spaces correctly
3. Add existence check for completion source files before copying
(prevents errors on fresh clones before generation)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Show full build error output instead of truncating to 40 lines
Truncation hides important context when diagnosing build failures.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Fix troubleshooting tips to suggest --debug instead of --debug-log
--debug-log only enables Python toolchain logging, while --debug
enables debug compiler flags which is actually useful for
diagnosing build and run failures.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Fix flags-before-command detection and shell detection
- Scan all args for a non-flag to detect if a command is present,
so ./mfc.sh -v build works correctly instead of dropping args
- Use ZSH_VERSION instead of $SHELL for shell detection (detects
the running shell, not the login shell)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Raise minimum Python version to 3.12 (pyrometheus requires it)
The pyrometheus dependency requires Python >= 3.12. The previous
minimum of 3.11 would allow bootstrapping but fail at package
installation.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Lower minimum Python to 3.10 by pinning pyrometheus to pre-3.12 commit
Pin pyrometheus to commit 49833404f (before it added a Python >= 3.12
requirement) so MFC can support Python 3.10+. Verified that bootstrap,
build, and chemistry test cases all pass with Python 3.10.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Add -v flag to all CI build/run/test/bench commands
Enables verbose output in CI for easier debugging of failures.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Add -v flag to coverage and GitHub runner CI commands
Missed these in the previous commit — adds verbose output to the
codecov build/test and the GitHub-hosted runner build/test steps.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Revert pyrometheus pin to track git HEAD
The Python 3.10 compatibility changes have been merged upstream,
so we no longer need to pin to a specific commit.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Remove -v flag from HPC CI scripts to fix build stalls
The -v flag causes verbose compiler output (-Minfo=inline -Minfo=accel)
which fills pipe buffers during GPU compilation, causing the compiler
to block on pipe_write and the build to hang indefinitely until SLURM
kills the job at the time limit.
This was the root cause of CI failures on Phoenix and Frontier GPU jobs
that appeared as 3-hour timeouts but were actually build stalls.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Fix shell detection for zsh users sourcing under bash
The completions.sh script runs under bash due to its shebang, so
ZSH_VERSION is never set even for zsh users. Add fallback to check
$SHELL environment variable which reflects the user's login shell.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Limit push-triggered CI to master branch only
Previously, workflows triggered on both push and pull_request events,
causing duplicate CI runs when pushing to PR branches. Now push events
only trigger CI on master, while PRs are tested via pull_request event.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Fix shell detection to not use $SHELL fallback when in bash
The previous fix could incorrectly install zsh completions when running
mfc.sh in bash if the user's login shell ($SHELL) was zsh. Now we only
fall back to $SHELL when BASH_VERSION is also unset.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Change Frontier SLURM account from CFD154 to ENG160
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Remove -v flag from GitHub/coverage CI and pin pyrometheus
- Remove verbose flag from GitHub runner and coverage CI commands
to prevent build hangs from pipe buffer exhaustion
- Pin pyrometheus to known-good commit 4983340 to fix potential
chemistry build failures on Frontier
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Harden CI against transient Frontier/Phoenix failures
- Add retry logic (3 attempts) to Frontier and Frontier AMD build
scripts to handle transient Lustre I/O errors during compilation
- Replace fragile sbatch -W with monitor_slurm_job.sh in all submit
scripts (Frontier, Frontier AMD, Phoenix) for resilient job monitoring
with exponential backoff and sacct fallback
- Add SIGHUP trap to submit scripts to survive login node session drops
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Add SIGHUP protection to Frontier build scripts
The build step runs directly on the login node (not through sbatch),
so it also needs trap '' HUP to survive session drops.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Restore -v flag to all CI build and test commands
The verbose flag was removed based on a pipe buffer theory that
turned out to be wrong — the real issue was SIGHUP from login
node session drops, which is now fixed.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Remove -v from GitHub-hosted CI, keep for self-hosted runners
Verbose output stalls GitHub-hosted runners (pipe buffer issue)
but is safe on Frontier/Phoenix where output goes to SLURM files.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Fix pipe deadlock in -v build mode and restore -v everywhere
The streaming build mode (-v) was reading stdout and stderr
sequentially, causing a classic subprocess deadlock when the
compiler's stderr filled the 64KB pipe buffer. Fix by merging
stderr into stdout with subprocess.STDOUT.
Now safe to use -v on all CI runners (GitHub-hosted and self-hosted).
* Pass --test-all to Build step so post_process builds during dry-run
Previously HDF5/Silo/post_process were only built during the Test
step, adding build time to test execution. Now the Build step
includes --test-all for MPI jobs so all targets are pre-built.
* Refactor test.yml: generic self-hosted steps via matrix.cluster
- Replace lbl_comp with cluster field that maps to workflow directory
names (phoenix, frontier, frontier_amd), making steps generic
- Collapse 6 conditional Build/Test steps into 2 generic ones
- Merge duplicate Archive Logs blocks into one
- Rename OPT1/OPT2 to TEST_ALL/TEST_PCT for clarity1 parent 7b35b59 commit 0945009
27 files changed
Lines changed: 510 additions & 275 deletions
File tree
- .github/workflows
- frontier_amd
- frontier
- phoenix
- toolchain
- bootstrap
- mfc
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | | - | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| 17 | + | |
| 18 | + | |
16 | 19 | | |
17 | 20 | | |
18 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
19 | 25 | | |
20 | 26 | | |
21 | 27 | | |
| 28 | + | |
| 29 | + | |
22 | 30 | | |
23 | 31 | | |
24 | 32 | | |
25 | 33 | | |
26 | 34 | | |
27 | 35 | | |
28 | 36 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
| 37 | + | |
| 38 | + | |
34 | 39 | | |
35 | 40 | | |
36 | 41 | | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
56 | 63 | | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | 64 | | |
72 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
73 | 68 | | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
| 69 | + | |
80 | 70 | | |
81 | 71 | | |
82 | 72 | | |
83 | | - | |
84 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
85 | 83 | | |
86 | 84 | | |
87 | 85 | | |
| |||
145 | 143 | | |
146 | 144 | | |
147 | 145 | | |
| 146 | + | |
148 | 147 | | |
149 | 148 | | |
150 | 149 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
4 | 8 | | |
5 | 9 | | |
6 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
4 | 8 | | |
5 | 9 | | |
6 | 10 | | |
| |||
39 | 43 | | |
40 | 44 | | |
41 | 45 | | |
42 | | - | |
| 46 | + | |
43 | 47 | | |
44 | 48 | | |
45 | | - | |
| 49 | + | |
46 | 50 | | |
47 | 51 | | |
48 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
4 | 8 | | |
5 | 9 | | |
6 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
3 | 6 | | |
4 | 7 | | |
5 | 8 | | |
| |||
15 | 18 | | |
16 | 19 | | |
17 | 20 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
26 | 54 | | |
| 55 | + | |
| 56 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
5 | 8 | | |
6 | 9 | | |
7 | 10 | | |
| |||
26 | 29 | | |
27 | 30 | | |
28 | 31 | | |
| 32 | + | |
29 | 33 | | |
30 | | - | |
| 34 | + | |
31 | 35 | | |
32 | 36 | | |
33 | | - | |
| 37 | + | |
34 | 38 | | |
35 | 39 | | |
36 | 40 | | |
37 | | - | |
| 41 | + | |
38 | 42 | | |
39 | | - | |
40 | 43 | | |
41 | 44 | | |
42 | 45 | | |
| |||
53 | 56 | | |
54 | 57 | | |
55 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
56 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
3 | 6 | | |
4 | 7 | | |
5 | 8 | | |
| |||
15 | 18 | | |
16 | 19 | | |
17 | 20 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
26 | 54 | | |
| 55 | + | |
| 56 | + | |
0 commit comments