fix: simplify Claude workflows and TestPyPI publishing#8
Conversation
- Remove auto-commit instructions from all three agents — contents: read prevents pushing commits on pull_request events - Agents now post PR comments with proposed fixes/snippets instead - Add test branch to workflow trigger (feature PRs target test, not main) Fixes Copilot review comments on PR #5. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…issions # Conflicts: # .github/workflows/claude-quality-gate.yml
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
This PR contains three main categories of changes: simplification of Claude AI-assisted CI workflows (removing plugin-based configuration in favor of plain prompts), fixing the TestPyPI publishing workflow to use Trusted Publishing via environment-based OIDC tokens (replacing API key auth), and a significant refactoring of ptop3/monitor.py including removal of the non-functional net sort key, encapsulation of sampling state in a ProcessSampler dataclass, addition of scroll support to the TUI, and an extensive new test suite.
Changes:
- Claude workflows (
claude-code-review.yml,claude-quality-gate.yml) simplified to use plain review prompts and restricted to comment-only mode (no auto-commits). - TestPyPI workflow upgraded to Trusted Publishing (
id-token: write,environment: testpypi) with automated unique dev-version stamping per run. ptop3/monitor.pyrefactored:netsort key and net I/O fields removed; process sampling encapsulated intoProcessSamplerdataclass; scroll support added to TUI viavisible_window_start/_sync_scroll; helper functions extracted (sort_groups,sort_processes,_selected_group,_selected_proc,_status_line); large test suite added covering all new/changed functions.
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/publish-testpypi.yml |
Switched to Trusted Publishing; added unique dev-version stamping step |
.github/workflows/claude-code-review.yml |
Replaced plugin/slash-command with plain review prompt; widened permissions to allow PR comments |
.github/workflows/claude-quality-gate.yml |
Agents restricted to comment-only (no auto-commits); added test branch trigger |
ptop3/monitor.py |
Major refactor: ProcessSampler dataclass, net sort removal, scroll support, helper extraction |
tests/test_monitor.py |
~1000 new lines of tests covering ProcessSampler, TUI methods, scroll, alerts, run loop |
tests/test_swap_clean.py |
New tests for short-line skipping, swapoff failure, dry-run target, file-by-file fallback, root check |
tests/test_drop_caches.py |
New test for OSError propagation from main() |
tests/test_sudo_config.py |
Import ordering cleanup (ruff-style) |
tests/conftest.py |
Removed unused io import |
pyproject.toml |
Added project URLs, coverage config, pytest pythonpath |
CHANGELOG.md |
Entry for net sort removal |
.gitignore |
Expanded to standard Python patterns (coverage, packaging, etc.) |
tests/test_swap_clean.py
Outdated
| ) | ||
|
|
||
| assert rc == 0 | ||
| assert "file-by-file" in capsys.readouterr().out |
There was a problem hiding this comment.
The test asserts "file-by-file" in capsys.readouterr().out, but the key message that proves the file-by-file fallback path was actually triggered is "Not enough RAM to clean all swap at once. Trying file-by-file...", which is printed to stderr (see swap_clean.py line 172). The current assertion happens to pass because the success message "Swap clean completed (file-by-file)." is also on stdout, but it does not actually verify the intended fallback behavior. The assertion should check capsys.readouterr().err to confirm the trigger message is present.
…issions # Conflicts: # .github/workflows/claude-code-review.yml # tests/test_swap_clean.py
* fix: simplify quality gate workflow and harden monitor coverage (#7) * fix: harden monitor behavior and raise coverage * fix: quality gate agents comment-only, add test branch trigger - Remove auto-commit instructions from all three agents — contents: read prevents pushing commits on pull_request events - Agents now post PR comments with proposed fixes/snippets instead - Add test branch to workflow trigger (feature PRs target test, not main) Fixes Copilot review comments on PR #5. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix: address PR review feedback * fix: simplify claude code review workflow --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> * fix: simplify Claude workflows and TestPyPI publishing (#8) * fix: harden monitor behavior and raise coverage * fix: quality gate agents comment-only, add test branch trigger - Remove auto-commit instructions from all three agents — contents: read prevents pushing commits on pull_request events - Agents now post PR comments with proposed fixes/snippets instead - Add test branch to workflow trigger (feature PRs target test, not main) Fixes Copilot review comments on PR #5. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix: address PR review feedback * fix: simplify claude code review workflow * ci: auto-version testpypi publishes * ci: set testpypi environment * chore: ignore coverage artifacts * chore: use standard python gitignore * test: tighten swap fallback assertion * fix: pass github_token to claude-code-action to resolve permission denials --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Summary
testbranch and Trusted Publishing via thetestpypienvironment.gitignoreto a standard Python baseline including coverage artifactsIncluded changes
.devversion per runenvironment: testpypiandid-token: writefor Trusted Publishing.gitignorefor common Python, packaging, test, and coverage artifactsVerification
yaml.safe_load