Skip to content

Update invoke shared auth source path#4

Merged
MTG-Thomas merged 3 commits into
mainfrom
codex/update-invoke-shared-src
May 8, 2026
Merged

Update invoke shared auth source path#4
MTG-Thomas merged 3 commits into
mainfrom
codex/update-invoke-shared-src

Conversation

@MTG-Thomas

@MTG-Thomas MTG-Thomas commented May 8, 2026

Copy link
Copy Markdown
Member

Summary

  • update invoke.ps1 to use the Midtown mtg-microsoft-auth source checkout

Verification

  • .\invoke.ps1 --help
  • $env:PYTHONPATH = ((Join-Path (Get-Location) 'src') + ';C:\Users\ThomasBray\src\Midtown-Technology-Group\mtg-microsoft-auth\src'); .\.venv\Scripts\python.exe -m pytest

Note: plain global python -m pytest is not usable in this checkout because the global interpreter is missing project deps/import path.


View in Codesmith
Need help on this PR? Tag @codesmith with what you need.

  • Let Codesmith autofix CI failures and bot reviews

Summary by CodeRabbit

  • Chores
    • Launcher now accepts a configurable environment variable to locate the shared authentication source, falls back to a project-relative location if unset, validates the resolved directory (exiting with a clear error if missing), and otherwise preserves existing runtime behavior.

@coderabbitai

coderabbitai Bot commented May 8, 2026

Copy link
Copy Markdown

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: b2df9f44-aa54-4a60-9f33-c96238ce62a1

📥 Commits

Reviewing files that changed from the base of the PR and between 2910e10 and c6cb654.

📒 Files selected for processing (1)
  • invoke.ps1
🚧 Files skipped from review as they are similar to previous changes (1)
  • invoke.ps1

📝 Walkthrough

Walkthrough

invoke.ps1 now sets $SharedSrc from $env:MTG_SHARED_AUTH_SRC when provided, otherwise computes a repository-relative fallback, verifies the directory exists (exits with code 1 if not), and normalizes the final path with Resolve-Path before continuing to set PYTHONPATH and launch Python.

Changes

Shared Source Path Configuration

Layer / File(s) Summary
Launcher shared-src resolution and validation
invoke.ps1
$SharedSrc is now sourced from $env:MTG_SHARED_AUTH_SRC if non-empty, otherwise computed as $(Split-Path -Parent $ProjectRoot)\mtg-microsoft-auth\src; the script checks the path with Test-Path, exits with an error if missing, and normalizes via Resolve-Path.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A tiny hop, a path made right,
Env or fallback, checked by light,
Resolve the way, no more surprise,
The launcher leaps with clearer eyes,
And Python wakes where certainty lies.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: updating how invoke.ps1 determines the shared auth source path, from a hardcoded value to deriving it from an environment variable with a fallback.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/update-invoke-shared-src

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@invoke.ps1`:
- Line 11: The script currently hard-codes $SharedSrc to a machine-specific
absolute path; change $SharedSrc to be configurable (read from a script
parameter or environment variable, e.g., $env:SHARED_SRC or a Param() default)
and if not provided fall back to a repository-relative path (e.g., ../src or
./src), then resolve to an absolute path with Resolve-Path and validate with
Test-Path before using it to build PYTHONPATH; if the path is invalid, stop the
script with a clear error message so PYTHONPATH is not polluted.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 89e146c6-782c-49b9-a8a7-9648805f0804

📥 Commits

Reviewing files that changed from the base of the PR and between d2ebb5f and 165e038.

📒 Files selected for processing (1)
  • invoke.ps1

Comment thread invoke.ps1 Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@invoke.ps1`:
- Around line 15-16: The current check uses Test-Path which returns true for
files too; change the conditional that validates $SharedSrc (the if block
guarding the Write-Error message) to ensure $SharedSrc is an existing directory
by using Test-Path with PathType 'Container' (or equivalent directory check) so
only directories get accepted and files are rejected before appending to
PYTHONPATH.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 13384e60-c0c8-4b8c-8705-df89c62c7fd9

📥 Commits

Reviewing files that changed from the base of the PR and between 165e038 and 2910e10.

📒 Files selected for processing (1)
  • invoke.ps1

Comment thread invoke.ps1 Outdated
@MTG-Thomas MTG-Thomas merged commit 815f705 into main May 8, 2026
5 checks passed
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.

1 participant