Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/scripts-unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: scripts-unit-tests
env:
PYTHON_VERSION: 3.11
on:
pull_request:
paths:
- 'scripts/validate_metadata/**'
jobs:
execute-scripts-unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Install test dependencies
run: |
pip install -r scripts/validate_metadata/requirements.txt

- name: Install Test dependencies
run: |
pip install -r scripts/validate_metadata/requirements.txt

- name: Run tests
run: pytest scripts/validate_metadata
49 changes: 49 additions & 0 deletions .github/workflows/validate-metadata-schema.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: validate-metadata-schema
env:
PYTHON_VERSION: 3.11
RETRIEVAL_SCRIPT_PATH: $GITHUB_WORKSPACE/.github/resources/scripts/get_items_for_validation.sh
VALIDATION_SCRIPT_PATH: $GITHUB_WORKSPACE/scripts/validate_metadata/validate_metadata.py
on:
pull_request:
paths:
- 'components/**'
- 'pipelines/**'
- 'scripts/**'
- 'third_party/components/**'
- 'third_party/pipelines/**'

jobs:
validate-metadata-schema:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Install Test dependencies
run: |
pip install -r scripts/validate_metadata/requirements.txt

- name: Retrieve new components and/or pipelines
id: get-new-items
run: ${{ env.RETRIEVAL_SCRIPT_PATH }} "${{ github.event.pull_request.base.sha }}" "${{ github.event.pull_request.head.sha }}" validate_metadata

#ToDo: Utilize .github/scripts/find-changed-components-and-pipelines.sh script once merged in from https://github.com/kubeflow/pipelines-components/pull/7
- name: Validate new core/third-party components and/or pipelines
if: ${{ steps.get-new-items.outputs.new_items_list != '' }}
run: |
NEW_ITEMS_ARRAY="${{ steps.get-new-items.outputs.new_items_list }}"

# Set IFS to a comma, so that the shell will split the string by commas.
IFS=','

for item in $NEW_ITEMS_ARRAY; do
FILE_PATH="$GITHUB_WORKSPACE/$item"
echo "Processing item: $item"
python "${{ env.VALIDATION_SCRIPT_PATH }}" --item $FILE_PATH

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
python "${{ env.VALIDATION_SCRIPT_PATH }}" --item $FILE_PATH
python "${{ env.VALIDATION_SCRIPT_PATH }}" --component $FILE_PATH

I see that the validate_metadata.py script accepts --component flag.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated this argument to --dir

done
Empty file added scripts/__init__.py
Empty file.
Empty file.
3 changes: 3 additions & 0 deletions scripts/validate_metadata/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
PyYAML==6.0.3
semver==3.0.4
pytest==7.1.2
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
approvers:
- sample-approver
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
tier: third_party
name: happy-path-component
stability: alpha | beta | stable
dependencies:
kubeflow:
- name: Pipelines
version: '>=2.5'
- name: Trainer
version: '>=2.0'
external_services:
- name: Argo Workflows
version: "3.6"
tags:
- training
- evaluation
lastVerified: 2025-03-15T00:00:00Z
ci:
skip_dependency_probe: false
pytest: optional
links:
documentation: https://kubeflow.org/components/happy-path-component
issue_tracker: https://github.com/kubeflow/kfp-components/issues
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
approvers:
- sample-approver
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: component_valid
tier: third_party
stability: alpha
dependencies:
kubeflow:
- name: Pipelines
version: '2.5.0'
- name: Trainer
version: '2.0.0'
external_services:
- name: Argo Workflows
version: "3.6.0"
tags:
- training
- evaluation
lastVerified: 2025-03-15T00:00:00Z
ci:
skip_dependency_probe: false
links:
documentation: https://kubeflow.org/components/happy-path-component
issue_tracker: https://github.com/kubeflow/kfp-components/issues
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: invalid-ci
tier: core
stability: alpha
dependencies:
kubeflow:
- name: Pipelines
version: '>=2.5.0'
- name: Trainer
version: '>=2.0.0'
external_services:
- name: Argo Workflows
version: "3.6.0"
tags:
- training
- evaluation
lastVerified: 2025-03-15T00:00:00Z
ci: invalid-ci-value
links:
documentation: https://kubeflow.org/components/happy-path-component
issue_tracker: https://github.com/kubeflow/kfp-components/issues
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: invalid-ci-category
tier: core
stability: stable
dependencies:
kubeflow:
- name: Pipelines
version: '>=2.5.0'
- name: Trainer
version: '>=2.0.0'
external_services:
- name: Argo Workflows
version: "3.6.0"
tags:
- training
- evaluation
lastVerified: 2025-03-15T00:00:00Z
ci:
skip_dependency_probe: false
invalid_ci_category: invalid_value
links:
documentation: https://kubeflow.org/components/happy-path-component
issue_tracker: https://github.com/kubeflow/kfp-components/issues
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: invalid-ci-dependency-probe
tier: third_party
stability: beta
dependencies:
kubeflow:
- name: Pipelines
version: '>=2.5.0'
- name: Trainer
version: '>=2.0.0'
external_services:
- name: Argo Workflows
version: "3.6.0"
tags:
- training
- evaluation
lastVerified: 2025-03-15T00:00:00Z
ci:
skip_dependency_probe: invalid-probe-value
links:
documentation: https://kubeflow.org/components/happy-path-component
issue_tracker: https://github.com/kubeflow/kfp-components/issues
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: invalid-dependencies-category
tier: core
stability: beta
dependencies:
kubeflow:
- name: Pipelines
version: '>=2.5.0'
- name: Trainer
version: '>=2.0.0'
external_services:
- name: Argo Workflows
version: "3.6.0"
invalid_dependency_category:
- name: Invalid Dependency
version: "1.0"
tags:
- training
- evaluation
lastVerified: 2025-03-15T00:00:00Z
ci:
skip_dependency_probe: false
links:
documentation: https://kubeflow.org/components/happy-path-component
issue_tracker: https://github.com/kubeflow/kfp-components/issues
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: invalid-dependencies-type
tier: third_party
stability: alpha
dependencies: "invalid-dependencies-type"
tags:
- training
- evaluation
lastVerified: 2025-03-15T00:00:00Z
ci:
skip_dependency_probe: false
links:
documentation: https://kubeflow.org/components/happy-path-component
issue_tracker: https://github.com/kubeflow/kfp-components/issues
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: invalid-dependency-semantic-versioning
tier: third_party
stability: stable
dependencies:
kubeflow:
- name: Pipelines
version: '>=2.5.0'
- name: Trainer
version: '>=2.0.0'
external_services:
- name: Argo Workflows
version: "3.6"
tags:
- training
- evaluation
lastVerified: 2025-03-15T00:00:00Z
ci:
skip_dependency_probe: false
links:
documentation: https://kubeflow.org/components/happy-path-component
issue_tracker: https://github.com/kubeflow/kfp-components/issues
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: invalid-links
tier: core
stability: alpha
dependencies:
kubeflow:
- name: Pipelines
version: '>=2.5.0'
- name: Trainer
version: '>=2.0.0'
external_services:
- name: Argo Workflows
version: "3.6.0"
tags:
- training
- evaluation
lastVerified: 2025-03-15T00:00:00Z
ci:
skip_dependency_probe: false
links: https://invalid-link
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: 2
tier: core
stability: beta
dependencies:
kubeflow:
- name: Pipelines
version: '>=2.5.0'
- name: Trainer
version: '>=2.0.0'
external_services:
- name: Argo Workflows
version: "3.6.0"
tags:
- training
- evaluation
lastVerified: 2025-03-15T00:00:00Z
ci:
skip_dependency_probe: false
links:
documentation: https://kubeflow.org/components/happy-path-component
issue_tracker: https://github.com/kubeflow/kfp-components/issues
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: invalid-stability
tier: third_party
stability: invalid-stability
dependencies:
kubeflow:
- name: Pipelines
version: '>=2.5.0'
- name: Trainer
version: '>=2.0.0'
external_services:
- name: Argo Workflows
version: "3.6.0"
tags:
- training
- evaluation
lastVerified: 2025-03-15T00:00:00Z
ci:
skip_dependency_probe: false
links:
documentation: https://kubeflow.org/components/happy-path-component
issue_tracker: https://github.com/kubeflow/kfp-components/issues
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: invalid-tag-array-type
tier: core
stability: stable
dependencies:
kubeflow:
- name: Pipelines
version: '>=2.5.0'
- name: Trainer
version: '>=2.0.0'
external_services:
- name: Argo Workflows
version: "3.6.0"
tags:
- 1
- 2
lastVerified: 2025-03-15T00:00:00Z
ci:
skip_dependency_probe: false
links:
documentation: https://kubeflow.org/components/happy-path-component
issue_tracker: https://github.com/kubeflow/kfp-components/issues
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: invalid-tag-type
tier: core
stability: stable
dependencies:
kubeflow:
- name: Pipelines
version: '>=2.5.0'
- name: Trainer
version: '>=2.0.0'
external_services:
- name: Argo Workflows
version: "3.6.0"
tags: "tags"
lastVerified: 2025-03-15T00:00:00Z
ci:
skip_dependency_probe: false
links:
documentation: https://kubeflow.org/components/happy-path-component
issue_tracker: https://github.com/kubeflow/kfp-components/issues
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: invalid-tier
tier: invalid_tier
stability: alpha
dependencies:
kubeflow:
- name: Pipelines
version: '>=2.5.0'
- name: Trainer
version: '>=2.0.0'
external_services:
- name: Argo Workflows
version: "3.6.0"
tags:
- training
- evaluation
lastVerified: 2025-03-15T00:00:00Z
ci:
skip_dependency_probe: false
links:
documentation: https://kubeflow.org/components/happy-path-component
issue_tracker: https://github.com/kubeflow/kfp-components/issues
Loading
Loading