Skip to content

Commit

Permalink
Merge pull request #696 from conda-forge/version-updates
Browse files Browse the repository at this point in the history
feat: version updates
  • Loading branch information
beckermr authored Oct 1, 2024
2 parents 728b417 + 200efb4 commit 8580570
Show file tree
Hide file tree
Showing 6 changed files with 650 additions and 63 deletions.
74 changes: 70 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
git config --global user.name "conda-forge-curator[bot]"
git config --global pull.rebase false
mkdir -p ~/.conda-smithy/ && echo $GH_TOKEN > ~/.conda-smithy/github.token
pip install --no-deps -e .
pip install --no-deps --no-build-isolation -e .
env:
GH_TOKEN: ${{ steps.generate_token.outputs.token }}

Expand Down Expand Up @@ -177,7 +177,7 @@ jobs:
git config --global user.name "conda-forge-curator[bot]"
git config --global pull.rebase false
mkdir -p ~/.conda-smithy/ && echo $GH_TOKEN > ~/.conda-smithy/github.token
pip install --no-deps -e .
pip install --no-deps --no-build-isolation -e .
env:
GH_TOKEN: ${{ steps.generate_token.outputs.token }}

Expand Down Expand Up @@ -239,7 +239,7 @@ jobs:
git config --global user.name "conda-forge-curator[bot]"
git config --global pull.rebase false
mkdir -p ~/.conda-smithy/ && echo $GH_TOKEN > ~/.conda-smithy/github.token
pip install --no-deps -e .
pip install --no-deps --no-build-isolation -e .
env:
GH_TOKEN: ${{ steps.generate_token.outputs.token }}

Expand Down Expand Up @@ -305,7 +305,7 @@ jobs:
git config --global user.name "conda-forge-curator[bot]"
git config --global pull.rebase false
mkdir -p ~/.conda-smithy/ && echo $GH_TOKEN > ~/.conda-smithy/github.token
pip install --no-deps -e .
pip install --no-deps --no-build-isolation -e .
env:
GH_TOKEN: ${{ steps.generate_token.outputs.token }}

Expand All @@ -327,3 +327,69 @@ jobs:
pytest -vvs --branch=${branch} test_live_linter.py
env:
GH_TOKEN: ${{ secrets.CF_ADMIN_GITHUB_TOKEN }}

live-tests-version-update:
name: live-tests-version-update
runs-on: "ubuntu-latest"
needs:
- tests
- docker-build
concurrency:
group: ${{ github.event.pull_request.head.repo.fork != 'true' && 'live-tests-version-update' || format('{0}-{1}', github.workflow, github.ref) }}
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
if: ${{ !github.event.pull_request.head.repo.fork }}
with:
fetch-depth: 0

- name: setup conda
if: ${{ !github.event.pull_request.head.repo.fork }}
uses: mamba-org/setup-micromamba@f8b8a1e23a26f60a44c853292711bacfd3eac822 # v1
with:
environment-file: conda-lock.yml
environment-name: webservices
condarc: |
show_channel_urls: true
channel_priority: strict
channels:
- conda-forge
- name: generate token
if: ${{ !github.event.pull_request.head.repo.fork }}
id: generate_token
uses: actions/create-github-app-token@31c86eb3b33c9b601a1f60f98dcbfd1d70f379b4 # v1
with:
app-id: ${{ secrets.CF_CURATOR_APP_ID }}
private-key: ${{ secrets.CF_CURATOR_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}

- name: install code
shell: bash -l {0}
if: ${{ !github.event.pull_request.head.repo.fork }}
run: |
git config --global user.email "79913779+conda-forge-curator[bot]@users.noreply.github.com"
git config --global user.name "conda-forge-curator[bot]"
git config --global pull.rebase false
mkdir -p ~/.conda-smithy/ && echo $GH_TOKEN > ~/.conda-smithy/github.token
pip install --no-deps --no-build-isolation -e .
env:
GH_TOKEN: ${{ steps.generate_token.outputs.token }}

- name: run version tests
shell: bash -l {0}
if: ${{ !github.event.pull_request.head.repo.fork }}
run: |
if [[ "${GITHUB_HEAD_REF}" != "" ]]; then
branch="${GITHUB_HEAD_REF}"
else
branch="${GITHUB_REF_NAME}"
fi
version=$(python -c "import conda_forge_webservices; print(conda_forge_webservices.__version__.replace('+', '.'))")
export CF_FEEDSTOCK_OPS_CONTAINER_NAME=condaforge/webservices-dispatch-action
export CF_FEEDSTOCK_OPS_CONTAINER_TAG="${version}"
cd tests
pytest -vvs --branch=${branch} test_live_version_update.py
env:
GH_TOKEN: ${{ secrets.CF_ADMIN_GITHUB_TOKEN }}
8 changes: 7 additions & 1 deletion .github/workflows/webservices-workflow-dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ on:
description: 'the container tag to use'
required: true
type: string
requested_version:
description: 'the requested version for a version update'
required: false
type: string
default: 'null'

env:
PY_COLORS: 1
Expand Down Expand Up @@ -109,7 +114,8 @@ jobs:
--task=${{ inputs.task }} \
--repo=${{ inputs.repo }} \
--pr-number=${{ inputs.pr_number }} \
--task-data-dir=${{ github.workspace }}/task-data
--task-data-dir=${{ github.workspace }}/task-data \
--requested-version=${{ inputs.requested_version }}
- name: upload task data
id: upload-task-data
Expand Down
18 changes: 15 additions & 3 deletions conda_forge_webservices/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -1009,10 +1009,22 @@ def update_version(full_name, pr_num, input_ver):
inject_app_token_into_feedstock(full_name, repo=repo)
inject_app_token_into_feedstock_readonly(full_name, repo=repo)

return not repo.create_repository_dispatch(
"version_update",
client_payload={"pr": pr_num, "input_version": input_ver or "null"},
_, repo_name = full_name.split("/")
ref = __version__.replace("+", ".")
workflow = gh.get_repo("conda-forge/conda-forge-webservices").get_workflow(
"webservices-workflow-dispatch.yml"
)
running = workflow.create_dispatch(
ref=ref,
inputs={
"task": "version_update",
"repo": repo_name,
"pr_number": str(pr_num),
"container_tag": ref,
"requested_version": str(input_ver) or "null",
},
)
return not running


def make_noarch(repo):
Expand Down
Loading

0 comments on commit 8580570

Please sign in to comment.