Skip to content

Shell subprocesses and lazy-load GitHub token - #256

Open
JPires1992 wants to merge 1 commit into
chains-project:mainfrom
JPires1992:improvements
Open

JPires1992 wants to merge 1 commit into
chains-project:mainfrom
JPires1992:improvements

Conversation

@JPires1992

Copy link
Copy Markdown

Make subprocess calls compatible with Windows shells and defer GitHub token usage until needed. Use shell=True and convert command lists to strings for npm/mvn calls (github_repo.py, extract_deps.py) so npm/mvn.cmd is found on Windows. Replace top-level GITHUB_TOKEN usage with get_github_headers() that validates the env var and lazily initializes headers in get_pr_info.py, get_pr_review.py and main.py to avoid requiring the token at import time. Also update clone_repo in tool_config.py to include the token in the repo URL when available for authenticated cloning.

Make subprocess calls compatible with Windows shells and defer GitHub token usage until needed. Use shell=True and convert command lists to strings for npm/mvn calls (github_repo.py, extract_deps.py) so npm/mvn.cmd is found on Windows. Replace top-level GITHUB_TOKEN usage with get_github_headers() that validates the env var and lazily initializes headers in get_pr_info.py, get_pr_review.py and main.py to avoid requiring the token at import time. Also update clone_repo in tool_config.py to include the token in the repo URL when available for authenticated cloning.
@algomaster99

Copy link
Copy Markdown
Member

Hi! Thanks for your PR. If the goal is to make the CLI compatible with Windows subshell, could you please also add windows to this job.

Also, what is the rationale behing lazy loading of github headers?

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