buildkite: skip branch validation if UI build
Motivation/summary
Utilise the BUILDKITE_SOURCE environment variable when running the DRA. If the Buildkite pipeline is triggered manually, this will skip the branch validation.
This is handy when the Unified Release process has not produced any artifacts for main yet, and main still points to the newly created minor branch. Normally it takes a few days to have new artifacts for main pointing to a new minor version.
https://github.com/elastic/apm-pipeline-library/blob/main/.ci/generate-snapshots.sh is the crazy script that generates the branches.json file.
Checklist
- [ ] Update CHANGELOG.asciidoc
- [ ] Documentation has been updated
For functional changes, consider:
- Is it observable through the addition of either logging or metrics?
- Is its use being published in telemetry to enable product improvement?
- Have system tests been added to avoid regression?
How to test these changes
Related issues
Thank you for proposing this, but I would prefer not to merge it as it creates a UI only edge case that make the process harder to debug in case of issues. The behavior that led do this PR was unexpected but correct: no DRA was executed because we needed to wait upstream (technically we may not need to, but being a unified release I think it make sense to do so).
We could address it with better documentation (on which I'm working) and having the script visibly fail/warn (not sure if this is possible) in Buildkite instead of skipping the step but looking like a success. What do you think?
We could address it with better documentation (on which I'm working) and having the script visibly fail/warn (not sure if this is possible) in Buildkite instead of skipping the step but looking like a success. What do you think?
I cannot see an easy way to skip a Buildkite build for a branch since it uses the catalog-info.yml file and does not allow runtime conditionals. For doing so, it's during the build time at the step level, see https://buildkite.com/docs/pipelines/conditionals
https://buildkite.com/docs/pipelines/skipping explains about the different options.
It will be possible to fail the build, but is that what you want? You will receive a Slack message saying it failed for every commit it merged unless we do something fancy with the Slack notifications and their conditions.
If a failure is the way then https://github.com/elastic/apm-server/pull/13001