Skip to content
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

Flatten stacks with parent in non-terminating-image checks #574

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

Conversation

thepetk
Copy link
Contributor

@thepetk thepetk commented Jan 31, 2025

Description of Changes

The PR fixes the issue that the check_non_terminating script faces for stacks that include a parent. An example is #401 where the changes introduced are failing.

The list of updates:

  • We add a build step to the workflow.
  • The build step refers to a small golang bin file which utilizes the library to parse, flatten and update the devfile.
  • The necessary updates were added in the bash script to check if a parent is included in a devfile and if so to run the bin and flatten it.

Related Issue(s)

fixes devfile/api#1568

Acceptance Criteria

  • Contributing guide

Have you read the devfile registry contributing guide and followed its instructions?

  • Test automation

Does this repository's tests pass with your changes?

  • Documentation

Does any documentation need to be updated with your changes?

  • Check Tools Provider

Have you tested the changes with existing tools, i.e. Odo, Che, Console? (See devfile registry contributing guide on how to test changes)

Tests Performed

Explain what tests you personally ran to ensure the changes are functioning as expected.

How To Test

  • Update a stack to point to a parent.
  • Run minikube or create a cluster
  • From project root build the binary:
go build -C tests/check_non_terminating
  • Update the STACKS variable inside the tests/check_non_terminating to include only the stack you have temporarily update.
  • Finally again from project root, run locally the tests/check_non_terminating.sh script.

Notes To Reviewer

I've tried to mimic the updates introduced by the PR for ollama and ran the workflow here: https://github.com/thepetk/registry/actions/runs/13076640505/job/36490341149

@thepetk thepetk requested a review from a team as a code owner January 31, 2025 16:43
Copy link

openshift-ci bot commented Jan 31, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: thepetk

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Contributor

@Jdubrick Jdubrick left a comment

Choose a reason for hiding this comment

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

Couple comments/questions!

@@ -81,7 +81,9 @@ jobs:
run: echo "TEST_DELTA=true" >> $GITHUB_ENV

- name: Check that containers components are non terminating
run: bash tests/check_non_terminating.sh
run: |
go build -C tests/check_non_terminating
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not familiar with the -C flag and I can't find much on it, what does it do?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wanted to avoid changing dirs with cd so I used the flag -C to change it on build -> here

@@ -7,6 +7,9 @@ DEVFILES_DIR="$(pwd)/stacks"
# The stacks to test as a string separated by spaces
STACKS=$(bash "$(pwd)/tests/get_stacks.sh")

# Path to the check_non_terminating go package
NON_TERMINATING_MODULE_BIN="$(pwd)/tests/check_non_terminating/./check_non_terminating"
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
NON_TERMINATING_MODULE_BIN="$(pwd)/tests/check_non_terminating/./check_non_terminating"
NON_TERMINATING_MODULE_BIN="$(pwd)/tests/check_non_terminating/check_non_terminating"

Do we need the . there?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also if the second check_non_terminating is the binary name maybe we rename it for clarity? So it isn't doubled up in the path

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I made it a bit more dynamic and gave it the name flatten-parent as default (also for the workflow).

Signed-off-by: thepetk <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Non terminating image check does not support parent in devfiles
2 participants