-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feature/AY-971_Use-custom-staging-dir-fun…
…ctions
- Loading branch information
Showing
10 changed files
with
115 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,48 @@ | ||
name: 🔸Auto assign pr | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
pr_number: | ||
type: string | ||
description: "Run workflow for this PR number" | ||
required: true | ||
project_id: | ||
type: string | ||
description: "Github Project Number" | ||
required: true | ||
default: "16" | ||
pull_request: | ||
types: | ||
- opened | ||
|
||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
|
||
jobs: | ||
get-pr-repo: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
pr_repo_name: ${{ steps.get-repo-name.outputs.repo_name || github.event.pull_request.head.repo.full_name }} | ||
|
||
# INFO `github.event.pull_request.head.repo.full_name` is not available on manual triggered (dispatched) runs | ||
steps: | ||
- name: Get PR repo name | ||
if: ${{ github.event_name == 'workflow_dispatch' }} | ||
id: get-repo-name | ||
run: | | ||
repo_name=$(gh pr view ${{ inputs.pr_number }} --json headRepository,headRepositoryOwner --repo ${{ github.repository }} | jq -r '.headRepositoryOwner.login + "/" + .headRepository.name') | ||
echo "repo_name=$repo_name" >> $GITHUB_OUTPUT | ||
auto-assign-pr: | ||
uses: ynput/ops-repo-automation/.github/workflows/pr_to_project.yml@develop | ||
needs: | ||
- get-pr-repo | ||
if: ${{ needs.get-pr-repo.outputs.pr_repo_name == github.repository }} | ||
uses: ynput/ops-repo-automation/.github/workflows/pr_to_project.yml@main | ||
with: | ||
repo: "${{ github.repository }}" | ||
project_id: 16 | ||
pull_request_number: ${{ github.event.pull_request.number }} | ||
project_id: ${{ inputs.project_id != '' && fromJSON(inputs.project_id) || 16 }} | ||
pull_request_number: ${{ github.event.pull_request.number || fromJSON(inputs.pr_number) }} | ||
secrets: | ||
token: ${{ secrets.YNPUT_BOT_TOKEN }} | ||
# INFO fallback to default `github.token` is required for PRs from forks | ||
# INFO organization secrets won't be available to forks | ||
token: ${{ secrets.YNPUT_BOT_TOKEN || github.token}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
client/ayon_core/plugins/publish/collect_farm_env_variables.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import os | ||
|
||
import pyblish.api | ||
|
||
from ayon_core.lib import get_ayon_username | ||
from ayon_core.pipeline.publish import FARM_JOB_ENV_DATA_KEY | ||
|
||
|
||
class CollectCoreJobEnvVars(pyblish.api.ContextPlugin): | ||
"""Collect set of environment variables to submit with deadline jobs""" | ||
order = pyblish.api.CollectorOrder - 0.45 | ||
label = "AYON core Farm Environment Variables" | ||
targets = ["local"] | ||
|
||
def process(self, context): | ||
env = context.data.setdefault(FARM_JOB_ENV_DATA_KEY, {}) | ||
|
||
# Disable colored logs on farm | ||
for key, value in ( | ||
("AYON_LOG_NO_COLORS", "1"), | ||
("AYON_PROJECT_NAME", context.data["projectName"]), | ||
("AYON_FOLDER_PATH", context.data.get("folderPath")), | ||
("AYON_TASK_NAME", context.data.get("task")), | ||
# NOTE we should use 'context.data["user"]' but that has higher | ||
# order. | ||
("AYON_USERNAME", get_ayon_username()), | ||
): | ||
if value: | ||
self.log.debug(f"Setting job env: {key}: {value}") | ||
env[key] = value | ||
|
||
for key in [ | ||
"AYON_BUNDLE_NAME", | ||
"AYON_DEFAULT_SETTINGS_VARIANT", | ||
"AYON_IN_TESTS", | ||
# NOTE Not sure why workdir is needed? | ||
"AYON_WORKDIR", | ||
]: | ||
value = os.getenv(key) | ||
if value: | ||
self.log.debug(f"Setting job env: {key}: {value}") | ||
env[key] = value | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# -*- coding: utf-8 -*- | ||
"""Package declaring AYON addon 'core' version.""" | ||
__version__ = "1.0.9+dev" | ||
__version__ = "1.0.10+dev" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
name = "core" | ||
title = "Core" | ||
version = "1.0.9+dev" | ||
version = "1.0.10+dev" | ||
|
||
client_dir = "ayon_core" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
|
||
[tool.poetry] | ||
name = "ayon-core" | ||
version = "1.0.9+dev" | ||
version = "1.0.10+dev" | ||
description = "" | ||
authors = ["Ynput Team <[email protected]>"] | ||
readme = "README.md" | ||
|