Skip to content

{CI} Fix env-setup action to prevent setuptools downgrade in old PR branches#33779

Closed
naga-nandyala with Copilot wants to merge 2 commits into
devfrom
copilot/fix-gh-check-cli-linter
Closed

{CI} Fix env-setup action to prevent setuptools downgrade in old PR branches#33779
naga-nandyala with Copilot wants to merge 2 commits into
devfrom
copilot/fix-gh-check-cli-linter

Conversation

Copilot AI commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Old PR branches that haven't been rebased (e.g., from 2022) carry a stale requirements.txt with setuptools==52.0.0. When azdev setup installs from this file, it silently downgrades setuptools, breaking setuptools.build_meta support — editable installs fail but azdev setup exits 0, leaving the venv without azure.cli. Subsequent steps like scripts/ci/service_name.py then fail with ModuleNotFoundError: No module named 'azure.cli'.

Changes

  • .github/actions/env-setup/action.yml: Added a "Use base branch requirements" step between the PR branch checkout and the Python/azdev install. It fetches requirements.txt from the base repo/branch (depth=1, efficient) and checks it out before azdev setup runs, ensuring setuptools is always at a compatible version regardless of how stale the PR branch is.
- name: Use base branch requirements
  shell: bash
  env:
    base_repo: ${{ github.event.pull_request.base.repo.clone_url }}
    base_ref: ${{ github.event.pull_request.base.ref }}
  run: |
    git remote add base "$base_repo" 2>/dev/null || git remote set-url base "$base_repo"
    git fetch base "$base_ref" --depth=1
    git checkout FETCH_HEAD -- requirements.txt

Related command
N/A — CI infrastructure fix only.

Testing Guide
Re-trigger the "GH Check CLI Linter" workflow on PR #21261 (runpy branch). Previously failing with ModuleNotFoundError: No module named 'azure.cli'; should now complete the azdev linter step.

History Notes


This checklist is used to make sure that common guidelines for a pull request are followed.

@azure-client-tools-bot-prd

Copy link
Copy Markdown

Hi @copilot,
Since the current milestone time is less than 7 days, this pr will be reviewed in the next milestone.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@yonzhan

yonzhan commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

Copilot AI changed the title [WIP] Fix failing GitHub Actions job GH Check CLI Linter {CI} Fix env-setup action to prevent setuptools downgrade in old PR branches Jul 23, 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