-
Notifications
You must be signed in to change notification settings - Fork 568
[CI] Support package discovery in nested directories - WIP #18495
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
base: main
Are you sure you want to change the base?
Changes from 16 commits
acdab09
265c135
58f0fe5
d9100b9
91f9db5
a4af05b
741448f
218f948
3d92f36
bb2e60f
e2454f2
99bfc48
9f03436
71e903e
293da9f
5651580
b794a1b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -48,37 +48,36 @@ report_build_failure() { | |||||
| } | ||||||
|
|
||||||
| build_packages() { | ||||||
| pushd packages > /dev/null || exit 1 | ||||||
| local packages="" | ||||||
| local version="" | ||||||
| local name="" | ||||||
| local package_zip="" | ||||||
| local package_path="" | ||||||
|
|
||||||
| for it in $(find . -maxdepth 1 -mindepth 1 -type d); do | ||||||
| local package | ||||||
| local version | ||||||
| local name | ||||||
| package=$(basename "${it}") | ||||||
| echo "Package ${package}: check" | ||||||
| packages=$(list_all_directories) | ||||||
| for package_path in ${packages}; do | ||||||
| pushd "${package_path}" > /dev/null || exit 1 | ||||||
| echo "Package \"${package_path}\": check" | ||||||
|
|
||||||
| pushd "${package}" > /dev/null || exit 1 | ||||||
| version=$(yq .version manifest.yml) | ||||||
| name=$(yq .name manifest.yml) | ||||||
|
|
||||||
| version=$(cat manifest.yml | yq .version) | ||||||
| name=$(cat manifest.yml | yq .name) | ||||||
|
|
||||||
| local package_zip="${name}-${version}.zip" | ||||||
| package_zip="${name}-${version}.zip" | ||||||
|
|
||||||
| if is_already_published "${package_zip}" ; then | ||||||
| echo "Skipping. ${package_zip} already published" | ||||||
| popd > /dev/null | ||||||
| continue | ||||||
| fi | ||||||
|
|
||||||
| echo "Build package as zip: ${package}" | ||||||
| if check_and_build_package "${package}" ; then | ||||||
| echo "Build package as zip: ${package_path}" | ||||||
| if check_and_build_package "${package_path}" ; then | ||||||
| unpublished="true" | ||||||
| else | ||||||
| report_build_failure "${package}" | ||||||
| report_build_failure "${package_path}" | ||||||
| fi | ||||||
| popd > /dev/null || exit 1 | ||||||
| done | ||||||
| popd > /dev/null || exit 1 | ||||||
| } | ||||||
|
|
||||||
| if [ "${SKIP_PUBLISHING}" == "true" ] ; then | ||||||
|
|
@@ -88,13 +87,13 @@ fi | |||||
|
|
||||||
| if skipPublishing ; then | ||||||
| echo "packageStoragePublish: not the main branch or a backport branch, nothing will be published" | ||||||
| exit 0 | ||||||
| # exit 0 | ||||||
| fi | ||||||
|
|
||||||
|
Comment on lines
87
to
92
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Medium When @@ -88,5 +88,5 @@
if skipPublishing ; then
echo "packageStoragePublish: not the main branch or a backport branch, nothing will be published"
- # exit 0
+ exit 0
fi
add_bin_path🤖 Copy this AI Prompt to have your agent fix this:
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changes related to debugging. It will be reverted before merging. |
||||||
| add_bin_path | ||||||
|
|
||||||
| with_yq | ||||||
| with_go | ||||||
| with_mage | ||||||
| use_elastic_package | ||||||
|
|
||||||
| echo "--- Build packages" | ||||||
|
|
@@ -117,7 +116,7 @@ cp "${BUILD_PACKAGES_FOLDER}"/*.zip "${ARTIFACTS_FOLDER}"/ | |||||
|
|
||||||
| if [ "${DRY_RUN}" == "true" ]; then | ||||||
| echo "DRY_RUN enabled. Publish packages steps skipped." | ||||||
| exit 0 | ||||||
| # exit 0 | ||||||
| fi | ||||||
|
|
||||||
| # triggering dynamically the steps for signing and publishing | ||||||
|
|
@@ -148,7 +147,7 @@ steps: | |||||
| env: | ||||||
| SIGNING_STEP_KEY: "sign-service" | ||||||
| ARTIFACTS_FOLDER: "packageArtifacts" | ||||||
| DRY_RUN: "${DRY_RUN}" | ||||||
| DRY_RUN: "true" | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Medium
Suggested change
🤖 Copy this AI Prompt to have your agent fix this:
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changes related to debugging. It will be reverted before merging. |
||||||
| agents: | ||||||
| image: "${LINUX_AGENT_IMAGE}" | ||||||
| cpu: "8" | ||||||
|
|
@@ -158,4 +157,5 @@ steps: | |||||
| allow_failure: false | ||||||
| EOF | ||||||
|
|
||||||
| buildkite-agent pipeline upload "${PIPELINE_FILE}" | ||||||
| cat "${PIPELINE_FILE}" | ||||||
| # buildkite-agent pipeline upload "${PIPELINE_FILE}" | ||||||
|
Comment on lines
159
to
+161
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 Critical The cat "${PIPELINE_FILE}"
-# buildkite-agent pipeline upload "${PIPELINE_FILE}"
+buildkite-agent pipeline upload "${PIPELINE_FILE}"🤖 Copy this AI Prompt to have your agent fix this:
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a change to allow debugging the script safely. This will be reverted before merging the PR. |
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 Medium
scripts/build_packages.sh:88When
skipPublishingreturns true, the script prints "nothing will be published" but continues executing instead of exiting. This causes the script to proceed through expensive build steps (tool installation, package building, artifact copying, pipeline generation) on branches that should skip publishing entirely, wasting resources and potentially causing side effects.if skipPublishing ; then echo "packageStoragePublish: not the main branch or a backport branch, nothing will be published" - # exit 0 + exit 0 fi🤖 Copy this AI Prompt to have your agent fix this:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes related to debugging. It will be reverted before merging.