Skip to content

Move config server CLI to panoptes-utils config; polish Typer CLI; add tests#337

Closed
Copilot wants to merge 10 commits intodevelopfrom
copilot/move-config-server-cli-to-utils
Closed

Move config server CLI to panoptes-utils config; polish Typer CLI; add tests#337
Copilot wants to merge 10 commits intodevelopfrom
copilot/move-config-server-cli-to-utils

Conversation

Copy link
Contributor

Copilot AI commented Mar 16, 2026

The panoptes-config-server entry point was a separate CLI inconsistent with the unified panoptes-utils CLI. This PR consolidates it and improves CLI polish across the board.

Changes

  • New panoptes-utils config subcommand (src/panoptes/utils/cli/config.py): Typer-based run, stop, get, set commands. Replaces the old panoptes-config-server entry point. Includes host 0.0.0.0localhost normalisation and a startup wait-loop (--startup-timeout, default 30 s).
  • Typer CLI polish (image.py, main.py): typer.sechorich.print with markup; rich_markup_mode="rich" and no_args_is_help=True on all Typer() instances.
  • rich>=12.3.0 added as explicit core dependency (was already transitive via typer).
  • Tests: comprehensive coverage for config CLI (run, stop, get, set, host normalisation, startup timeout, monitor exception) and image CLI (cr2 to-jpg, cr2 to-fits, fits solve).
  • Test hang fix: patch("panoptes.utils.cli.config.time.sleep") patches the global time.sleep and leaks under pytest-cov. Fixed by patching the module-level reference instead:
    # before — leaks globally under coverage
    patch("panoptes.utils.cli.config.time.sleep")
    
    # after — scoped to cli/config.py only
    patch("panoptes.utils.cli.config.time")

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/graphql
    • Triggering command: /usr/bin/gh gh auth status (http block)
    • Triggering command: /usr/bin/gh gh pr view 337 --repo panoptes/panoptes-utils --json title,body (http block)

If you need me to access, download, or install something from one of these locations, you can either:


📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

Co-authored-by: wtgee <70736+wtgee@users.noreply.github.com>
Copilot AI changed the title [WIP] Move config server cli to panoptes-utils namespace Move config server CLI into panoptes-utils CLI namespace (Click → Typer) Mar 16, 2026
Copilot AI requested a review from wtgee March 16, 2026 22:37
Co-authored-by: wtgee <70736+wtgee@users.noreply.github.com>
Copilot AI changed the title Move config server CLI into panoptes-utils CLI namespace (Click → Typer) Migrate config server CLI to panoptes-utils config; switch all CLI output to rich Mar 16, 2026
@wtgee wtgee marked this pull request as ready for review March 16, 2026 23:14
@wtgee wtgee requested a review from Copilot March 16, 2026 23:14
Copy link
Contributor

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

Consolidates the standalone config server CLI into the existing panoptes-utils Typer CLI under a new config subcommand, and standardizes CLI output to use Rich across modules.

Changes:

  • Adds a new Typer-based config CLI (run, stop, get, set) under panoptes-utils config.
  • Wires the new config sub-app into the main CLI entry point.
  • Removes the legacy panoptes-config-server console script entry point and updates tests/changelog accordingly.

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
src/panoptes/utils/cli/config.py New Typer sub-app implementing config server commands and Rich-based output.
src/panoptes/utils/cli/main.py Registers the new config subcommand and enables Rich markup / no-args help.
src/panoptes/utils/cli/image.py Switches CLI output to Rich and enables Rich markup / no-args help.
tests/config/test_config_cli.py Updates CLI tests to invoke the consolidated panoptes-utils app.
pyproject.toml Removes the panoptes-config-server entry point.
CHANGELOG.md Documents CLI consolidation and script removal.
Comments suppressed due to low confidence (1)

tests/config/test_config_cli.py:32

  • --port is defined on the config app callback (group-level option), but this test passes it after the run subcommand. With Click/Typer parsing, group options must appear before the subcommand (e.g., config --port ... run ...), otherwise the invocation will fail with an unknown option.
                "run",
                "--config-file",
                f"{config_path}",
                "--port",
                cli_config_port,

You can also share your feedback on Copilot code review. Take the survey.

Co-authored-by: wtgee <70736+wtgee@users.noreply.github.com>
Copilot AI changed the title Migrate config server CLI to panoptes-utils config; switch all CLI output to rich Switch all Typer CLI scripts to rich output; add rich as explicit dependency Mar 16, 2026
Copilot AI changed the title Switch all Typer CLI scripts to rich output; add rich as explicit dependency Harmonizing config server cli with panoptes-utils Mar 17, 2026
@codecov
Copy link

codecov bot commented Mar 17, 2026

Codecov Report

❌ Patch coverage is 26.26263% with 73 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.68%. Comparing base (f4b2118) to head (52a0f48).

Files with missing lines Patch % Lines
src/panoptes/utils/cli/config.py 23.45% 62 Missing ⚠️
src/panoptes/utils/cli/image.py 26.66% 11 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #337      +/-   ##
===========================================
- Coverage    83.76%   81.68%   -2.08%     
===========================================
  Files           21       23       +2     
  Lines         1355     1398      +43     
===========================================
+ Hits          1135     1142       +7     
- Misses         220      256      +36     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Co-authored-by: wtgee <70736+wtgee@users.noreply.github.com>
Copilot AI changed the title Harmonizing config server cli with panoptes-utils Harmonizing config server CLI with panoptes-utils Mar 17, 2026
… unused imports)

Co-authored-by: wtgee <70736+wtgee@users.noreply.github.com>
Copilot AI changed the title Harmonizing config server CLI with panoptes-utils Add comprehensive CLI test coverage for config and image subcommands Mar 17, 2026
Copilot AI changed the title Add comprehensive CLI test coverage for config and image subcommands Fix ruff linting errors in test_image_cli.py Mar 17, 2026
Copilot AI changed the title Fix ruff linting errors in test_image_cli.py Move config server CLI into panoptes-utils config subcommand Mar 17, 2026
…e patch

Co-authored-by: wtgee <70736+wtgee@users.noreply.github.com>
Copilot AI changed the title Move config server CLI into panoptes-utils config subcommand Fix test hang caused by global time.sleep patch leaking across tests under coverage Mar 17, 2026
Copilot AI changed the title Fix test hang caused by global time.sleep patch leaking across tests under coverage Fix test suite hang caused by leaking time.sleep mock under coverage Mar 17, 2026
Co-authored-by: wtgee <70736+wtgee@users.noreply.github.com>
Copilot AI changed the title Fix test suite hang caused by leaking time.sleep mock under coverage Move config server CLI to panoptes-utils config; polish Typer CLI; add tests Mar 17, 2026
Copilot stopped work on behalf of wtgee due to an error March 17, 2026 19:20
@wtgee
Copy link
Member

wtgee commented Mar 18, 2026

Replaced by #340

@wtgee wtgee closed this Mar 18, 2026
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.

3 participants