From e2fbf6ddcba92cac7d879d2ef3eb6ce7de778d64 Mon Sep 17 00:00:00 2001 From: Kyle McCormick Date: Fri, 7 Jun 2024 12:31:11 -0400 Subject: [PATCH] feat: use pull request creator from repo-tools, not testeng-ci (#137) testeng-ci is deprecated in favor of repo-tools. See the DEPR [1] and the PR that moved pull_request_creator to repo-tools [2]. This also includes some cosmetic changes to the upgrade PRs. Before: * branch == jenkins/upgrade-python-requirements-{id} * title == Python Requirements Update * commit == chore: Updating Python Requirements After: * branch == repo-tools/upgrade-python-requirements-{id} * title == chore: Upgrade Python requirements * commit == chore: Upgrade Python requirements NOTE: This leaves behind a testeng-ci reference in the repo-health job. We need to figure out the future of the edx-repo-health repo. This will be a future task [3] [1] https://github.com/openedx/public-engineering/issues/265 [2] https://github.com/openedx/repo-tools/pull/517 [3] https://github.com/openedx/.github/issues/138 --- .github/workflows/bulk_repo_update.yml | 15 ++++++--------- .github/workflows/upgrade-python-requirements.yml | 13 ++++++------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/.github/workflows/bulk_repo_update.yml b/.github/workflows/bulk_repo_update.yml index f332913..cecedb0 100644 --- a/.github/workflows/bulk_repo_update.yml +++ b/.github/workflows/bulk_repo_update.yml @@ -97,7 +97,7 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ github.event.inputs.python_version }} - + - name: Setup Nodejs uses: actions/setup-node@v4 with: @@ -110,11 +110,9 @@ jobs: - name: run script run: ${{ github.event.inputs.script }} - - name: setup testeng-ci + - name: setup pull_request_creator run: | - git clone https://github.com/edx/testeng-ci.git - cd $GITHUB_WORKSPACE/testeng-ci - pip install -r requirements/base.txt + pip install 'edx-repo-tools[pull_request_creator]' - name: setup draft flag run: echo "draftflag=$(if ${{ github.event.inputs.draft }}; then echo '--draft'; else echo ''; fi)" >> $GITHUB_ENV @@ -122,16 +120,15 @@ jobs: - name: setup force delete flag run: echo "force_delete_old_prs_flag=$(if ${{ github.event.inputs.force_delete_old_prs }}; then echo '--force-delete-old-prs'; else echo '--no-force-delete-old-prs'; fi)" >> $GITHUB_ENV - - name: ignore testeng-ci - run: echo "testeng-ci" >> .git/info/exclude + - name: ignore repo-tools + run: echo "repo-tools" >> .git/info/exclude - name: create pull request env: GITHUB_TOKEN: ${{ secrets.requirements_bot_github_token }} GITHUB_USER_EMAIL: ${{ secrets.requirements_bot_github_email }} run: | - cd $GITHUB_WORKSPACE/testeng-ci - python -m jenkins.pull_request_creator --repo-root=$GITHUB_WORKSPACE \ + pull_request_creator --repo-root=$GITHUB_WORKSPACE \ --target-branch="${{ env.BRANCH }}" --base-branch-name="${{ github.event.inputs.branch }}" \ --commit-message="${{ github.event.inputs.commit_message }}" \ --pr-title="${{ github.event.inputs.commit_message }}" \ diff --git a/.github/workflows/upgrade-python-requirements.yml b/.github/workflows/upgrade-python-requirements.yml index c064942..860d796 100644 --- a/.github/workflows/upgrade-python-requirements.yml +++ b/.github/workflows/upgrade-python-requirements.yml @@ -74,11 +74,10 @@ jobs: cd $GITHUB_WORKSPACE make upgrade - - name: setup testeng-ci + - name: setup pull_request_creator run: | - git clone https://github.com/edx/testeng-ci.git - cd $GITHUB_WORKSPACE/testeng-ci - pip install -r requirements/base.txt + pip install 'edx-repo-tools[pull_request_creator]' + - name: create pull request id: createpullrequest env: @@ -88,10 +87,10 @@ jobs: USER_REVIEWERS: ${{ inputs.user_reviewers }} TEAM_REVIEWERS: ${{ inputs.team_reviewers }} run: | - cd $GITHUB_WORKSPACE/testeng-ci - python -m jenkins.pull_request_creator --repo-root=$GITHUB_WORKSPACE \ + pull_request_creator --repo-root=$GITHUB_WORKSPACE \ --target-branch="$TARGET_BRANCH" --base-branch-name="upgrade-python-requirements" \ - --commit-message="chore: Updating Python Requirements" --pr-title="Python Requirements Update" \ + --commit-message="chore: Upgrade Python requirements" \ + --pr-title="chore: Upgrade Python requirements" \ --pr-body="Python requirements update. Please review the [changelogs](https://openedx.atlassian.net/wiki/spaces/TE/pages/1001521320/Python+Package+Changelogs) for the upgraded packages." \ --user-reviewers="$USER_REVIEWERS" \ --team-reviewers="$TEAM_REVIEWERS" \