Skip to content

feat!: GUI-only approval, repo slug display, version 0.2.0#6

Merged
lklimek merged 9 commits into
mainfrom
feat/gui-only-approval-and-repo-slug
Mar 4, 2026
Merged

feat!: GUI-only approval, repo slug display, version 0.2.0#6
lklimek merged 9 commits into
mainfrom
feat/gui-only-approval-and-repo-slug

Conversation

@lklimek
Copy link
Copy Markdown
Owner

@lklimek lklimek commented Mar 4, 2026

Summary

  • Show repo slug in approval dialog — displays owner/repo (e.g. lklimek/ghsudo) instead of just the org name, when detectable from -R/--repo args or git origin remote
  • Remove --no-gui / terminal fallback — terminal prompts are trivially auto-approvable by AI agents, defeating ghsudo's purpose. A graphical display is now required (exit code 3 if unavailable)
  • Single version source — version defined only in pyproject.toml, read at runtime via importlib.metadata
  • Add CLAUDE.md — developer guide with release process
  • README updates — Linux-only testing note, ssh -X tip, updated exit code docs
  • 28 new tests for repo slug detection, org detection, and approval message formatting

Breaking changes

  • --no-gui flag removed
  • ghsudo now exits with code 3 if no graphical display is available (no terminal fallback)

Test plan

  • All 28 tests pass (pytest tests/ -v)
  • Verified GUI dialog shows "Repository: lklimek/ghsudo" via X11 forwarding
  • Verified exit code 3 when no display available
  • importlib.metadata.version() reads 0.2.0 correctly

🤖 Generated with Claude Code

🤖 Co-authored by Claudius the Magnificent AI Agent

lklimek and others added 4 commits March 4, 2026 10:59
Display the full owner/repo (e.g. lklimek/ghsudo) instead of just the
organization name in GUI and terminal approval prompts when the repo can
be detected from -R/--repo args or the git origin remote.

Refactors org detection to build on new repo-slug helpers, adds 27 tests
for slug/org detection and approval message formatting.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
BREAKING: Remove --no-gui / terminal fallback — a terminal prompt is
trivially auto-approvable by an AI agent, defeating ghsudo's purpose.
A graphical display (DISPLAY/WAYLAND_DISPLAY) is now required.

Also display the full owner/repo slug (e.g. lklimek/ghsudo) instead of
just the organization name when the repo can be detected from -R/--repo
args or the git origin remote.

Bump version to 0.2.0.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use importlib.metadata.version() in __init__.py so the version is
defined only in pyproject.toml.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 4, 2026 10:08
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 updates ghsudo to require GUI-based approvals (removing terminal fallback), improves context shown in approval dialogs by detecting and displaying the full owner/repo slug, and consolidates versioning to a single source in pyproject.toml.

Changes:

  • Add repo slug detection (from -R/--repo args or git origin) and display it in approval prompts.
  • Remove terminal approval fallback and require a graphical display (exit code 3 if unavailable).
  • Move version to pyproject.toml only and read it at runtime via importlib.metadata; add tests and docs updates.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/test_detection.py Adds tests for repo/org detection and approval message formatting.
src/ghsudo/main.py Implements repo slug detection, updates GUI approval messaging, and removes terminal fallback.
src/ghsudo/init.py Switches __version__ to be read from package metadata.
pyproject.toml Bumps project version to 0.2.0.
README.md Updates docs for GUI-only behavior, exit codes, and platform support notes.
CLAUDE.md Adds developer/release guide and documents versioning + GUI-only rationale.
Comments suppressed due to low confidence (1)

tests/test_detection.py:9

  • pytest is imported but never used in this test module. Removing the unused import will avoid lint noise (and keeps the tests module minimal).

import pytest


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/ghsudo/__main__.py
Comment thread src/ghsudo/__main__.py Outdated
Comment thread src/ghsudo/__init__.py Outdated
lklimek and others added 2 commits March 4, 2026 11:17
Agent instruction files tell agents to remind the user (not run it
themselves) since gh auth setup-git modifies global git config.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Escape repo/org values in PowerShell dialog string to prevent
  injection via malformed repo names
- Differentiate error messages: "no display" vs "no GUI toolkit found"
  with actionable remediation (install xmessage/zenity/kdialog)
- Handle PackageNotFoundError gracefully in __init__.py for
  uninstalled source checkouts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Drop TestDetectOrg (5 tests) — thin wrappers retesting slug functions
through a trivial split. Drop test_http_url — same regex path as
test_https_url.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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

Copilot reviewed 8 out of 8 changed files in this pull request and generated 8 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread AGENTS-example.md Outdated
Comment thread src/ghsudo/__main__.py
Comment thread README.md Outdated
Comment thread README.md
Comment thread CLAUDE.md Outdated
Comment thread CLAUDE.md Outdated
Comment thread README.md Outdated
Comment thread CLAUDE-example.md Outdated
- Timeout now auto-denies (exit 2) instead of returning "no GUI" (exit 3).
  _run_gui returns 1 on timeout, distinguishing it from tool-not-found (None).
- Clarify HTTPS requirement: needed for git push/pull via gh credential
  helper, not for ghsudo gh commands themselves.
- Update exit code 3 descriptions to cover both no-display and no-toolkit.
- Remove stale "terminal prompt" mention from README.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

src/ghsudo/main.py:434

  • The comment on this branch says rc is None means "not installed or timed out", but _run_gui now returns 1 on timeout (and None only when the tool is missing). Update the comment to avoid misleading future changes/debugging.
    if rc is None:
        return None  # not installed or timed out
    return rc == 0

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/ghsudo/__main__.py Outdated
Reject malformed slugs like "org/", "/repo", "a/b/c" in
_detect_repo_slug_from_args via new _parse_repo_slug helper.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@lklimek lklimek merged commit 0d2494c into main Mar 4, 2026
4 checks passed
@lklimek lklimek deleted the feat/gui-only-approval-and-repo-slug branch March 4, 2026 11:38
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