Skip to content

fix: simplify Claude workflows and TestPyPI publishing#8

Merged
spazyCZ merged 12 commits intotestfrom
fix/quality-gate-permissions
Mar 10, 2026
Merged

fix: simplify Claude workflows and TestPyPI publishing#8
spazyCZ merged 12 commits intotestfrom
fix/quality-gate-permissions

Conversation

@spazyCZ
Copy link
Copy Markdown
Owner

@spazyCZ spazyCZ commented Mar 10, 2026

Summary

  • simplify the Claude review workflows to use comment-only prompts instead of the old plugin-based flow
  • fix the TestPyPI publish workflow to use unique dev versions on the test branch and Trusted Publishing via the testpypi environment
  • update .gitignore to a standard Python baseline including coverage artifacts

Included changes

  • replace the old Claude Code Review plugin/slash-command configuration with a plain review prompt
  • keep Claude Quality Gate on the comment-only review path
  • add automatic TestPyPI version stamping before build using a unique .dev version per run
  • set environment: testpypi and id-token: write for Trusted Publishing
  • expand .gitignore for common Python, packaging, test, and coverage artifacts

Verification

  • workflow YAML files validated locally with yaml.safe_load
  • branch pushed successfully

spazyCZ and others added 9 commits March 9, 2026 13:59
- 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
Copilot AI review requested due to automatic review settings March 10, 2026 04:13
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.py refactored: net sort key and net I/O fields removed; process sampling encapsulated into ProcessSampler dataclass; scroll support added to TUI via visible_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.)

)

assert rc == 0
assert "file-by-file" in capsys.readouterr().out
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
@spazyCZ spazyCZ merged commit 250c8d2 into test Mar 10, 2026
8 of 12 checks passed
spazyCZ added a commit that referenced this pull request Mar 10, 2026
* 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>
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