Skip to content

[CI] Review output in CI builds #2639

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

Merged
merged 30 commits into from
Jul 24, 2025
Merged

Conversation

mrodm
Copy link
Contributor

@mrodm mrodm commented Jun 5, 2025

Make easier to read Buidkite output:

  • Add more groups in Buildkite output
  • Avoid executing some commands in clean up process if the Elastic stack failed to start.
  • Ensure that the failed group in the Buildkite output is opened (link)

Author's checklist

@mrodm mrodm self-assigned this Jun 5, 2025
@mrodm
Copy link
Contributor Author

mrodm commented Jun 6, 2025

/test

1 similar comment
@mrodm
Copy link
Contributor Author

mrodm commented Jun 6, 2025

/test

@mrodm mrodm force-pushed the update_scripts_output branch from 202d0c3 to a5ca34a Compare July 22, 2025 11:20
@mrodm
Copy link
Contributor Author

mrodm commented Jul 22, 2025

test serverless

@elastic-vault-github-plugin-prod

@mrodm
Copy link
Contributor Author

mrodm commented Jul 22, 2025

test serverless

@elastic-vault-github-plugin-prod

@mrodm mrodm changed the title Add more collapsed sections in CI output [CI] Review output in CI builds Jul 23, 2025
@mrodm
Copy link
Contributor Author

mrodm commented Jul 23, 2025

test serverless

@elastic-vault-github-plugin-prod

@mrodm
Copy link
Contributor Author

mrodm commented Jul 23, 2025

test serverless

@elastic-vault-github-plugin-prod

@mrodm
Copy link
Contributor Author

mrodm commented Jul 23, 2025

test serverless

@elastic-vault-github-plugin-prod

@mrodm
Copy link
Contributor Author

mrodm commented Jul 23, 2025

/test

Comment on lines +141 to +144
if [[ "${TARGET}" == "${TEST_BUILD_INSTALL_ZIP_TARGET}" || "${TARGET}" == "${FALSE_POSITIVES_TARGET}" ]]; then
echo "--- Install yq"
with_yq
fi
Copy link
Contributor Author

Choose a reason for hiding this comment

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

No need to install yq in other targets for now.

@@ -1,17 +1,22 @@
#!/bin/bash

set -euxo pipefail
set -euo pipefail
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed set -x from scripts/test-build*.sh shell scripts.
It looks to me that it is not needed at least in these targets.

I'm not totally sure if this flag should be kept in the other scripts (e.g. scripts/test-check-packages.sh).

WDYT ? Should we remove set -x in all these scripts ?

Copy link
Member

Choose a reason for hiding this comment

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

Umm, I find these useful when debugging, there would be some way to optionally add them?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The issue in these scripts is that there are some commands that are inside nested loops or nested ifs. That causes that set -x adds three dashes to show the command executed and Buildkite interprets that as a Collapsed group.

I've applied a workaround where it was affected via running the commands in a sub-shell and disabling that flag set +x. After that command, it continues with the previous value (set -x`).

@mrodm mrodm force-pushed the update_scripts_output branch from 61a3f54 to 9a048e1 Compare July 23, 2025 21:00
@mrodm
Copy link
Contributor Author

mrodm commented Jul 23, 2025

test serverless

@elastic-vault-github-plugin-prod

Comment on lines +5 to +13
is_stack_created() {
local files=0
files=$(find ~/.elastic-package -type f -name "docker-compose.yml" | wc -l)
if [ "${files}" -gt 0 ]; then
return 0
fi
return 1
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Helper function to know if elastic-package stack up command has been performed or not.

There could be packages that fail in elastic-package check command and if so, the Elastic stack has not been created.

This is helpful to avoid running commands like elastic-package stack <dump|down> that are going to fail.

Comment on lines +14 to +15
# Required containers could not be running, so ignore the error
elastic-package stack dump -v --output build/elastic-stack-dump/build-zip || true
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Example of the error to try to avoid:
https://buildkite.com/elastic/elastic-package/builds/5786#01983b8a-52f4-4906-a5fe-7379469778ed/350-608

This will help to continue running the other commands in the cleanup function.

@elasticmachine
Copy link
Collaborator

elasticmachine commented Jul 24, 2025

💔 Build Failed

Failed CI Steps

History

cc @mrodm

@mrodm
Copy link
Contributor Author

mrodm commented Jul 24, 2025

test serverless

@elastic-vault-github-plugin-prod

@mrodm mrodm marked this pull request as ready for review July 24, 2025 11:32
@mrodm mrodm requested a review from a team as a code owner July 24, 2025 11:32
@mrodm mrodm requested a review from jsoriano July 24, 2025 11:51
@mrodm
Copy link
Contributor Author

mrodm commented Jul 24, 2025

The error/issue of self-monitor step could be related to this elastic/integrations#14674

@mrodm
Copy link
Contributor Author

mrodm commented Jul 24, 2025

The error/issue of self-monitor step could be related to this elastic/integrations#14674

Tested with elastic-package v0.113.0 and it also happens.

Tested by changing the version of the system package to be installed to 2.4.0 and it worked successfully:

--- internal/stack/_static/kibana.yml.tmpl
+++ internal/stack/_static/kibana.yml.tmpl
@@ -56,7 +56,7 @@ xpack.cloudSecurityPosture.enabled: true
 xpack.fleet.packages:
   {{ if eq $self_monitor_enabled "true" }}
   - name: system
-    version: latest
+    version: 2.4.0
   {{ end }}
   - name: elastic_agent
     version: latest

So, I think this failure in the CI is unrelated to the changes in this PR.

@mrodm mrodm merged commit 3bac9e1 into elastic:main Jul 24, 2025
2 of 3 checks passed
@mrodm mrodm deleted the update_scripts_output branch July 24, 2025 16:24
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.

3 participants