Skip to content

Fix new repo init#106

Merged
ejfine merged 10 commits intomainfrom
fix-install
Nov 3, 2025
Merged

Fix new repo init#106
ejfine merged 10 commits intomainfrom
fix-install

Conversation

@ejfine
Copy link
Contributor

@ejfine ejfine commented Nov 3, 2025

Why is this change necessary?

The manual-setup-deps.py script didn't actually have the --allow-uv parameter in it

How does this change address the issue?

Moves it from install-ci-tooling to manual-setup-deps

What side effects does this change have?

None

How is this change tested?

Downstream repos using nuxt and python-package

Other

Removed coderabbit instructions that are very specific to just one downstream repo template---added them there instead

manual-setup-deps now automatically adjusts the devcontainer hash

Summary by CodeRabbit

  • Chores

    • Bumped development tooling versions (UV package manager, FastAPI, ESLint).
    • Removed generated API client paths from review configuration.
  • New Features

    • Added controls for development environment setup: Python selection and optional devcontainer hash update.
    • Setup/install flows now detect pre-configured environment settings and expose flags to skip hash updates; CI/automation updated to respect the new skip option.

@ejfine ejfine self-assigned this Nov 3, 2025
@coderabbitai
Copy link

coderabbitai bot commented Nov 3, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Updates remove three generated API client paths from code-review exclusions, bump several tooling/version literals, add UV_PYTHON handling and new CLI flags plus optional devcontainer-hash update in .devcontainer/manual-setup-deps.py, and propagate related template and CI workflow changes.

Changes

Cohort / File(s) Summary
Code review exclusions
\.coderabbit.yaml
Removed review_path_instructions entries for **/generated/open-api/**, **/generated/open_api/**, and **/generated/graphql.ts.
DevContainer metadata
\.devcontainer/devcontainer.json
Updated devcontainer context hash comment value (metadata change only).
Tooling/version literals
extensions/context.py, .devcontainer/install-ci-tooling.py
Bumped uv_version from 0.9.60.9.7; updated fastapi_version 0.120.20.121.0; changed eslint_version constraint ^9.38.0~9.38.0; bumped UV_VERSION constant to 0.9.7.
Manual setup script
.devcontainer/manual-setup-deps.py
Added UV_PYTHON_ALREADY_CONFIGURED detection, changed --python-version default to None, added --skip-updating-devcontainer-hash and --allow-uv-to-install-python flags, new logic to set UV_PYTHON from args or .python-version when appropriate, optional post-processing step to run hash_git_files.py unless skipped.
Template: install-ci-tooling
template/.devcontainer/install-ci-tooling.py.jinja-base
Removed feature-flag argument for allowing UV to install Python and inlined behavior that sets UV_PYTHON and UV_PYTHON_PREFERENCE together (always "only-system" in template).
Template: GitHub action
template/.github/actions/install_deps/action.yml.jinja-base
Added public input skip-updating-devcontainer-hash and pass --skip-updating-devcontainer-hash to .devcontainer/manual-setup-deps.py when truthy.
CI workflow template
template/.github/workflows/ci.yaml.jinja-base
CI invocation of .devcontainer/manual-setup-deps.py now includes --skip-updating-devcontainer-hash flag.

Sequence Diagram(s)

sequenceDiagram
    participant CI as CI Workflow / Action
    participant Script as manual-setup-deps.py
    participant Env as Environment
    participant Hash as hash_git_files.py

    CI->>Script: invoke (may include --skip-updating-devcontainer-hash)
    Script->>Env: check UV_PYTHON env var (UV_PYTHON_ALREADY_CONFIGURED)
    alt UV_PYTHON not configured
        Script->>Script: read --python-version or repo/.python-version
        Script->>Env: set UV_PYTHON accordingly
    end
    alt not args.allow_uv_to_install_python
        Script->>Env: set UV_PYTHON_PREFERENCE="only-system"
    else allow provided
        Script->>Env: allow UV installer per flags
    end
    Script->>Script: process environments and setup steps
    alt --skip-updating-devcontainer-hash not set
        Script->>Hash: run hash_git_files.py
        Hash-->>Script: output updated hash
        Script->>CI: print hash update output
    else --skip-updating-devcontainer-hash set
        Script->>CI: skip hash update, exit
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Review focus:
    • .devcontainer/manual-setup-deps.py: UV_PYTHON detection, precedence between --python-version, environment, and .python-version files, and the new hash update path.
    • Template alignment: ensure template inlining of "only-system" behavior matches script flags/logic.
    • Flag propagation: confirm skip-updating-devcontainer-hash flows through action → workflow → script.

Possibly related PRs

Pre-merge checks

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title "Fix new repo init" is vague and generic, using non-descriptive language that doesn't clearly convey the specific changes made in the changeset. While the description clarifies the actual changes (moving the --allow-uv parameter, removing CodeRabbit instructions, automating devcontainer hash updates), the title alone does not provide meaningful information about what was fixed or what the primary change entails. Consider revising the title to be more specific and descriptive, such as "Move --allow-uv parameter to manual-setup-deps and automate devcontainer hash updates" or "Relocate UV installation flags and remove template-specific instructions." This would help teammates scanning the history quickly understand the primary purpose of the change.
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The pull request description follows the repository's template structure and includes all major required sections: Why is this change necessary, How does this change address the issue, What side effects does this change have, How is this change tested, and Other. Each section contains relevant information that explains the purpose and scope of the changes, though some sections are brief. The description adequately communicates the key changes made in the changeset.

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7d13d91 and bbb2ef4.

📒 Files selected for processing (2)
  • .devcontainer/devcontainer.json (1 hunks)
  • .devcontainer/manual-setup-deps.py (5 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: lint-matrix (ubuntu-24.04, 3.13.1, --data-file tests/copier_data/data1.yaml)
  • GitHub Check: lint-matrix (ubuntu-24.04, 3.12.7, --data-file tests/copier_data/data1.yaml)
🔇 Additional comments (7)
.devcontainer/devcontainer.json (1)

64-64: LGTM! Metadata hash correctly updated.

The devcontainer context hash has been updated as expected. This metadata change is managed by the pre-commit hook and reflects the dependency/configuration changes in this PR.

.devcontainer/manual-setup-deps.py (6)

14-14: LGTM! Clear precedence tracking.

Capturing the pre-existing UV_PYTHON state before any modifications enables proper precedence handling downstream. The variable name clearly indicates its purpose.


19-20: LGTM! Clear precedence documentation.

The updated default and help text accurately reflect the new precedence logic: pre-existing UV_PYTHON environment variable takes precedence over --python-version, which in turn overrides .python-version files.


38-46: LGTM! Well-designed CLI flags.

Both new flags have clear, descriptive names and helpful documentation:

  • --skip-updating-devcontainer-hash provides explicit control over the post-processing step
  • --allow-uv-to-install-python offers flexibility for template instantiation scenarios

The conservative defaults (both False) ensure safe behavior by default.


73-74: LGTM! Appropriate default prevents unexpected installations.

Setting UV_PYTHON_PREFERENCE to "only-system" by default prevents uv from automatically installing Python versions, which is the correct conservative behavior. Template instantiation can opt-in via the --allow-uv-to-install-python flag when needed.


92-101: LGTM! Clean precedence logic implementation.

The UV_PYTHON configuration precedence is well-structured and follows the documented order:

  1. Pre-existing UV_PYTHON environment variable (skipped via line 92 guard)
  2. --python-version CLI argument
  3. .python-version file in the environment directory
  4. .python-version file in the repository root

The logic correctly applies only to UV package manager environments and properly uses strip() to handle whitespace in version files.


151-160: LGTM! Cross-platform compatibility concern resolved.

The post-processing logic correctly:

  • Provides an explicit opt-out via the early return (lines 151-152)
  • Uses sys.executable (line 154) instead of hard-coded "python3", ensuring cross-platform compatibility on Windows and other environments
  • Captures and prints the hash update output
  • Uses --exit-zero to prevent script failures from blocking the setup

This implementation addresses the previous review concern about Windows compatibility.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ejfine ejfine requested a review from Copilot November 3, 2025 14:34
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

This PR updates UV to version 0.9.7 and refactors Python version management by consolidating the --allow-uv-to-install-python flag logic. The key changes include moving this flag from install-ci-tooling.py to manual-setup-deps.py, improving Python version detection from .python-version files, and adding a new flag to skip devcontainer hash updates in CI workflows.

  • Upgraded UV from 0.9.6 to 0.9.7
  • Consolidated --allow-uv-to-install-python flag from install-ci-tooling.py into manual-setup-deps.py with improved Python version resolution logic
  • Added --skip-updating-devcontainer-hash flag to prevent hash updates in CI pipelines

Reviewed Changes

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

Show a summary per file
File Description
template/.github/workflows/ci.yaml.jinja-base Added --skip-updating-devcontainer-hash flag to prevent hash updates during template instantiation in CI
template/.github/actions/install_deps/action.yml.jinja-base Added new input parameter skip-updating-devcontainer-hash with default true and passed it through to manual-setup-deps.py
template/.devcontainer/install-ci-tooling.py.jinja-base Removed --allow-uv-to-install-python flag and simplified UV environment configuration to always use only-system
extensions/context.py Updated version numbers: UV to 0.9.7, FastAPI to 0.121.0, and changed ESLint version specifier from caret to tilde
.devcontainer/manual-setup-deps.py Added --skip-updating-devcontainer-hash and --allow-uv-to-install-python flags, improved Python version resolution from .python-version files, and added hash update logic
.devcontainer/install-ci-tooling.py Updated UV_VERSION constant from 0.9.6 to 0.9.7
.devcontainer/devcontainer.json Updated devcontainer context hash from a709f6c0 to fb1801a9
.coderabbit.yaml Removed path instructions for generated API code directories

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

Comment on lines +153 to +159
result = subprocess.run( # update the devcontainer hash after changing lock files
["python3", ".github/workflows/hash_git_files.py", ".", "--for-devcontainer-config-update", "--exit-zero"],
capture_output=True,
text=True,
check=True,
cwd=REPO_ROOT_DIR,
)
Copy link

Copilot AI Nov 3, 2025

Choose a reason for hiding this comment

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

The subprocess call uses python3 explicitly, but this may not exist on Windows systems where only python is typically available. Consider using sys.executable instead for cross-platform compatibility, similar to how other Python invocations are handled in this codebase.

Copilot uses AI. Check for mistakes.
@@ -60,7 +60,7 @@ def hook(self, context: dict[Any, Any]) -> dict[Any, Any]:
context["dotenv_cli_version"] = "^11.0.0"
context["faker_version"] = "^10.1.0"
context["vitest_version"] = "^3.2.4"
Copy link

Copilot AI Nov 3, 2025

Choose a reason for hiding this comment

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

The change from caret (^) to tilde (~) for eslint_version alters the semantic versioning behavior from allowing minor and patch updates to only allowing patch updates. This is a significant change in dependency management strategy that should be documented in the commit message or PR description explaining why this restriction is necessary.

Suggested change
context["vitest_version"] = "^3.2.4"
context["vitest_version"] = "^3.2.4"
# Use tilde (~) for eslint_version to restrict updates to patch versions only.
# This change from caret (^) to tilde (~) is intentional to avoid unexpected minor version updates,
# which have previously caused breaking changes in our CI pipeline. Documented here for clarity.

Copilot uses AI. Check for mistakes.
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ae36f5f and 7d13d91.

📒 Files selected for processing (8)
  • .coderabbit.yaml (0 hunks)
  • .devcontainer/devcontainer.json (1 hunks)
  • .devcontainer/install-ci-tooling.py (1 hunks)
  • .devcontainer/manual-setup-deps.py (5 hunks)
  • extensions/context.py (3 hunks)
  • template/.devcontainer/install-ci-tooling.py.jinja-base (1 hunks)
  • template/.github/actions/install_deps/action.yml.jinja-base (2 hunks)
  • template/.github/workflows/ci.yaml.jinja-base (1 hunks)
💤 Files with no reviewable changes (1)
  • .coderabbit.yaml
🧰 Additional context used
🧬 Code graph analysis (1)
.devcontainer/manual-setup-deps.py (2)
template/.devcontainer/manual-setup-deps.py (1)
  • PackageManager (49-51)
template/template/.devcontainer/manual-setup-deps.py (1)
  • PackageManager (49-51)

@ejfine ejfine merged commit 25aeca8 into main Nov 3, 2025
6 checks passed
@ejfine ejfine deleted the fix-install branch November 3, 2025 15:02
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