Skip to content

skip testrunner related files/folders from ocm#1597

Open
IndritFejza wants to merge 2 commits into
gardener:masterfrom
IndritFejza:patch-1
Open

skip testrunner related files/folders from ocm#1597
IndritFejza wants to merge 2 commits into
gardener:masterfrom
IndritFejza:patch-1

Conversation

@IndritFejza
Copy link
Copy Markdown
Member

Skip testunner related folders to be considered in merge-ocm-fragments action

Release note:

NONE

@gardener-prow gardener-prow Bot added the do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. label May 13, 2026
@gardener-prow
Copy link
Copy Markdown

gardener-prow Bot commented May 13, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign zkdev for approval. For more information see the Code Review Process.

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

Details 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

@gardener-prow gardener-prow Bot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. labels May 13, 2026
@IndritFejza
Copy link
Copy Markdown
Member Author

IndritFejza commented May 13, 2026

If you don't agree with the proposal what would be another way to skip non-ocm related directories from being processed by the action? 😊

In general, the script seems to not like folders that contain subfolders.
So, regardless of testrunner, if we have an artifact that is a folder that contains subfolders, the script fails.

debug: sub-directory ./A contains:
B
C.json
debug: sub-directory ./A/B contains:
ls: cannot access './A/B': No such file or directory

Comment thread .github/actions/merge-ocm-fragments/action.yaml
Co-authored-by: Indrit Fejza <indrit.fejza@sap.com>
@TuanAnh17N
Copy link
Copy Markdown
Contributor

thanks for the pr!
the [ ! -d "$d" ] guard fixes the immediate crash, but i'd suggest a different approach that avoids hardcoding caller-specific directory names in this shared action.

the root cause seems to be that the flatetning loop iterates over all subdirectories, including non-ocm artifacts. since ocm fragments are always .tar.gz files (that's the contract of export-ocm-fragemnts), we can just move those directly instead of flattening everything, i think 🤔

find . -mindepth 2 -name "*.tar.gz" -exec mv {} . \;

echo "extracting files with pattern *.tar.gz"
for tarffile in $(find . -maxdepth 1 -name "*.tar.gz"); do
  echo "extracting ${tarfile} into $PWD"
  tar xf "${tarfile}"
  unlnk "${tarfile}"
done

since the flattening loop can't be removed entirely - download-artifact@v3 (used on GHE) doesn't support merge-multiple (according to the comment above) - scoping it to .tar.gz files, seems right to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants