Skip to content

Support fitted IsolationForest conversion to scikit-learn #6268

Support fitted IsolationForest conversion to scikit-learn

Support fitted IsolationForest conversion to scikit-learn #6268

name: Set PR and Issue Project Fields
# `zizmor` always flags these triggers because they are easy to use
# incorrectly. These usages are ok and don't execute any PR-specific
# code (and so aren't susceptible to exploits from forked PRs)
on: # zizmor: ignore[dangerous-triggers]
pull_request_target:
# This job runs when a PR is first opened, or it is updated
# Only runs if the PR is open (we don't want to update the status of a closed PR)
types: [opened, edited, synchronize, reopened, ready_for_review]
permissions: {}
jobs:
get-project-id:
uses: rapidsai/shared-workflows/.github/workflows/project-get-item-id.yaml@main
if: github.event.pull_request.state == 'open'
permissions:
actions: read
contents: read
id-token: write
packages: read
pull-requests: read
secrets: inherit # zizmor: ignore[secrets-inherit]
with:
PROJECT_ID: "PVT_kwDOABpemM4BgFBJ"
ITEM_NODE_ID: "${{ github.event.pull_request.node_id }}"
update-status:
# This job sets the PR and its linked issues to "In Progress" status
uses: rapidsai/shared-workflows/.github/workflows/project-get-set-single-select-field.yaml@main
if: ${{ github.event.pull_request.state == 'open' && (github.event.action == 'opened' || github.event.action == 'edited' || github.event.action == 'synchronize') && needs.get-project-id.outputs.ITEM_PROJECT_ID != '' }}
needs: get-project-id
permissions:
actions: read
contents: read
id-token: write
packages: read
pull-requests: read
with:
PROJECT_ID: "PVT_kwDOABpemM4BgFBJ"
SINGLE_SELECT_FIELD_ID: "PVTSSF_lADOABpemM4BgFBJzhaTRPI"
SINGLE_SELECT_FIELD_NAME: "Status"
SINGLE_SELECT_OPTION_VALUE: "In Progress"
ITEM_PROJECT_ID: "${{ needs.get-project-id.outputs.ITEM_PROJECT_ID }}"
ITEM_NODE_ID: "${{ github.event.pull_request.node_id }}"
UPDATE_ITEM: true
UPDATE_LINKED_ISSUES: true
secrets: inherit # zizmor: ignore[secrets-inherit]
get-release-version:
# release/*: version from branch name; main: first two segments of VERSION on main. Other bases: no output.
if: ${{ github.event.pull_request.state == 'open' && needs.get-project-id.outputs.ITEM_PROJECT_ID != '' }}
needs: get-project-id
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
release-version: ${{ steps.determine-version.outputs.release-version }}
steps:
- name: Checkout main branch if needed
if: ${{ github.event.pull_request.base.ref == 'main' }}
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
ref: main
persist-credentials: false
- name: Determine release version
id: determine-version
run: |
if [[ "$BASE_BRANCH" == release/* ]]; then
release="${BASE_BRANCH#release/}"
echo "release-version=$release" >> "$GITHUB_OUTPUT"
elif [ "$BASE_BRANCH" = "main" ] && [ -f VERSION ]; then
release=$(head -n 1 VERSION | cut -d. -f1,2)
echo "release-version=$release" >> "$GITHUB_OUTPUT"
fi
env:
BASE_BRANCH: ${{ github.event.pull_request.base.ref }}
update-release:
# This job sets the PR's Release field based on the target branch
# Only sets the field if it is not already set.
uses: rapidsai/shared-workflows/.github/workflows/project-get-set-single-select-field.yaml@main
if: ${{ github.event.pull_request.state == 'open' && needs.get-project-id.outputs.ITEM_PROJECT_ID != '' && needs.get-release-version.outputs.release-version != '' }}
needs: [get-project-id, get-release-version]
permissions:
actions: read
contents: read
id-token: write
packages: read
pull-requests: read
with:
PROJECT_ID: "PVT_kwDOABpemM4BgFBJ"
SINGLE_SELECT_FIELD_ID: "PVTSSF_lADOABpemM4BgFBJzhaTRP8"
SINGLE_SELECT_FIELD_NAME: "Release"
SINGLE_SELECT_OPTION_VALUE: "${{ needs.get-release-version.outputs.release-version }}"
ITEM_PROJECT_ID: "${{ needs.get-project-id.outputs.ITEM_PROJECT_ID }}"
ITEM_NODE_ID: "${{ github.event.pull_request.node_id }}"
UPDATE_ITEM: true
OVERRIDE_ITEM: false
UPDATE_LINKED_ISSUES: false
secrets: inherit # zizmor: ignore[secrets-inherit]
validate-release-target:
# This job reports whether the PR's Release field matches where the PR
# will actually land, and whether linked issues are delivered late.
if: ${{ always() && github.event.pull_request.state == 'open' && needs.get-release-version.outputs.release-version != '' }}
needs: [get-project-id, get-release-version, update-release]
continue-on-error: true
runs-on: ubuntu-latest
permissions:
contents: read
issues: read
pull-requests: read
repository-projects: read
steps:
- name: Checkout base branch
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
ref: ${{ github.event.pull_request.base.ref }}
persist-credentials: false
- name: Validate PR Release target
env:
GH_TOKEN: ${{ secrets.ADD_TO_PROJECT_GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
REPOSITORY: ${{ github.repository }}
TARGET_RELEASE: ${{ needs.get-release-version.outputs.release-version }}
run: |
python .github/scripts/check_pr_release_target.py \
--repo "$REPOSITORY" \
--pr-number "$PR_NUMBER" \
--target-release "$TARGET_RELEASE" \
--project-id "PVT_kwDOABpemM4BgFBJ" \
--release-field-id "PVTSSF_lADOABpemM4BgFBJzhaTRP8"