Skip to content

[Devfile#1718 ] Adding renovate.json and test script to ensure sample can still be parsed and used by consumers #70

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

JslYoon
Copy link

@JslYoon JslYoon commented Jul 14, 2025

[Devfile#1718 ] Adding renovate.json and test script to ensure sample can still be parsed and used by consumers
devfile/api#1718
Adding renovate.json and test script to ensure sample can still be parsed and used by consumers.

tests include:

odov3
non-terminating
validate-devfile-schemas

@JslYoon
Copy link
Author

JslYoon commented Jul 14, 2025

I did make this PR, I am not sure variables such as ${{ env.MINIKUBE_VERSION }} or ${{ env.KUBERNETES_VERSION }} is declared

Copy link
Contributor

@michael-valdron michael-valdron left a comment

Choose a reason for hiding this comment

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

@JslYoon Instead of trying to duplicate, I would suggest creating a new workflow that first pulls the devfile/registry repository, then runs the sample against each test suite. Also, good to create new check_*.sh scripts as the sample itself is the only input, the ones from devfile/registry look for multiple stacks under a stacks/ directory.

@JslYoon JslYoon force-pushed the devfile#1718-renovate branch from 57a089f to fedeb9a Compare July 15, 2025 18:50
@JslYoon JslYoon force-pushed the devfile#1718-renovate branch from 51eb318 to a8982d2 Compare July 16, 2025 18:36
@JslYoon JslYoon force-pushed the devfile#1718-renovate branch from 3629a8a to 0f2b1a2 Compare July 16, 2025 18:42
@JslYoon JslYoon requested a review from michael-valdron July 16, 2025 18:45

- name: Run Registry Validation Tests
env:
REGISTRY_PATH: ${{ github.workspace }}/registry
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
REGISTRY_PATH: ${{ github.workspace }}/registry

No need to set for the step, it is already set for the entire job.

set -x

# Path to the devfile in this sample repository
SAMPLE_PATH="$(pwd)"
Copy link
Contributor

Choose a reason for hiding this comment

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

SAMPLE_PATH="$(pwd)" will not be overridden by a set environment variable, this will allow you to override SAMPLE_PATH if its set as an environment variable or variable export:

Suggested change
SAMPLE_PATH="$(pwd)"
SAMPLE_PATH=${SAMPLE_PATH:-''}
if [ -z "${SAMPLE_PATH}" ]; then
SAMPLE_PATH="$(pwd)"
fi


set -x

SAMPLE_PATH="$(pwd)"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
SAMPLE_PATH="$(pwd)"
SAMPLE_PATH=${SAMPLE_PATH:-''}
if [ -z "${SAMPLE_PATH}" ]; then
SAMPLE_PATH="$(pwd)"
fi

- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.21'
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's use the latest target Go version current in devfile/registry:

Suggested change
go-version: '1.21'
go-version: '1.23'

run: |
sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
sudo chmod +x /usr/local/bin/yq
go install github.com/onsi/ginkgo/v2/ginkgo@latest
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's use the current ginkgo version in devfile/registry to avoid breakages:

Suggested change
go install github.com/onsi/ginkgo/v2/ginkgo@latest
go install github.com/onsi/ginkgo/v2/ginkgo@v2.19.0

Copy link
Contributor

Choose a reason for hiding this comment

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

@JslYoon I wonder if it is worth having a separate repository for the sample test scripts then pull them into each sample workflow when they run 🤔

Would reduce the number of places we would need to maintain these under.

Copy link
Contributor

Choose a reason for hiding this comment

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

Or we could modify the ones under devfile/registry to take single stack/sample inputs then there is no need to have separate copies of these scripts for overriding.

Copy link
Contributor

Choose a reason for hiding this comment

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

wdyt?

Comment on lines +29 to +46
- name: Setup test environment with overrides
run: |
# Copy entire project for devfile validation
mkdir -p test-sample
cp -r current-repo/* test-sample/

# Stage registry test files and apply local overrides
mkdir -p test-environment/tests
cp -r registry/tests/* test-environment/tests/

if [ -d "current-repo/tests" ]; then
echo "Applying local test overrides..."
cp -r current-repo/tests/* test-environment/tests/ 2>/dev/null || true
fi

# Copy staged files to execution location
cp -r test-environment/tests/* registry/tests/
cp -r test-sample/* registry/tests/
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we could just use current-repo path directly rather than coping into a new sample directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants