Skip to content

Conversation

@zooba
Copy link
Member

@zooba zooba commented May 12, 2025

Fixes #93

@zooba zooba marked this pull request as ready for review May 13, 2025 14:54
@zooba zooba requested a review from Copilot May 13, 2025 14:54
Copy link

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 adds a first-run configuration experience that prompts users to modify system settings and improves validation of environment requirements. Key changes include a new test suite for first-run checks, native and Python module enhancements for system configuration, and updates to command handling for initiating first-run flows.

Reviewed Changes

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

Show a summary per file
File Description
tests/test_firstrun.py New tests for first-run configuration and alias checks
tests/conftest.py Added log capture functions to support new test assertions
src/pymanager/main.cpp Introduced a new function to configure long paths via the registry
src/manage/firstrun.py Implemented first-run configuration logic and various system checks
src/manage/commands.py Integrated new first-run and configuration commands into the CLI interface
src/_native/misc.cpp Added native functions (get_current_package, read_alias_package, etc.)
_msbuild_test.py, _msbuild.py Updated build scripts to include the new native functions

@zooba zooba changed the title [WIP] Add 'first run' configuration experience to prompt users to modify system settings Add 'first run' configuration experience to prompt users to modify system settings May 13, 2025
@zooba
Copy link
Member Author

zooba commented May 13, 2025

I think the only way to validate this is to ship it, since it's really hard to test without being able to install it. I've adjusted the release script to allow publishing without forcing everyone to auto-update, so we can have some time to test it directly without imposing it on everyone else.

I'm going to do a bit more manual testing myself before merging though.

@zooba zooba requested a review from Copilot May 14, 2025 22:28
Copy link

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 adds a “first run” interactive configuration helper that prompts users to update key system settings (app execution aliases, long-path support, PATH entries, and Python installs) when they run the manager for the first time. It also introduces native APIs for querying package aliases and broadcasting environment changes, plus a new helper to enable long-path support.

  • Add first_run command class, CLI wiring, and calls in manage/commands.py
  • Implement first_run logic in src/manage/firstrun.py with logging and user prompts
  • Expose native functions (get_current_package, read_alias_package, broadcast_settings_change) and configure_long_path in C++

Reviewed Changes

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

Show a summary per file
File Description
tests/test_logging.py New tests for wrap_and_indent helper
tests/test_firstrun.py Tests covering firstrun checks and commands
tests/conftest.py Extend log-capture fixture with end_of_log
src/pymanager/main.cpp Added configure_long_path and CLI hook for **configure-long-paths
src/manage/logging.py Added wrap_and_indent and wrap support in LOGGER.print
src/manage/install_command.py Only print shortcuts in non-automatic mode
src/manage/firstrun.py Implement the first-run checks, prompts, and actions
src/manage/commands.py Register **first_run and --configure options in CLI schema
src/_native/misc.cpp New native exports for package/alias reading and settings broadcast
scripts/test-firstrun.py Helper script to run firstrun.py without a rebuild
_msbuild.py / _msbuild_test.py Include new native functions in build definitions
Comments suppressed due to low confidence (1)

src/pymanager/main.cpp:85

  • The new 'configure_long_path' function is not covered by any automated tests; consider adding a unit or integration test to verify registry key creation and error handling.
r = RegCreateKeyExW(HKEY_LOCAL_MACHINE, L"System\\CurrentControlSet\\Control\\FileSystem",

"check_long_paths": (config_bool, None, "env"),
"check_py_on_path": (config_bool, None, "env"),
"check_any_install": (config_bool, None, "env"),
"check_default_tag": (config_bool, None, "env"),
Copy link

Copilot AI May 14, 2025

Choose a reason for hiding this comment

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

The 'check_default_tag' option is declared in the CLI schema but never used in the first_run handler; remove it or implement its behavior to keep the configuration schema in sync with the code.

Suggested change
"check_default_tag": (config_bool, None, "env"),
# Removed the unused "check_default_tag" option to keep the schema in sync with the code.

Copilot uses AI. Check for mistakes.
@zooba zooba merged commit 7e8c553 into python:main May 14, 2025
4 checks passed
@zooba zooba deleted the gh-93 branch May 14, 2025 23:01
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.

Add interactive "first use" workflow

1 participant