Skip to content

Commit

Permalink
[smp]: prevent empty regression detector comments
Browse files Browse the repository at this point in the history
If the Regression Detector fails to submit a job to SMP, an empty
Regression Detector PR comment is posted to PRs. This empty comment is
noise and undesirable, so this commit tests whether the Regression
Detector generated a Markdown report before attempting to post. If the
Markdown report does not exist, the Regression Detector PR comment
will echo an error message and emit a non-zero exit code so that the
PR comment job fails before posting.

Signed-off-by: Geoffrey M. Oxberry <geoffrey.oxberry@datadoghq.com>
  • Loading branch information
goxberry committed Nov 6, 2024
1 parent 47294c1 commit 726d372
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .gitlab/functional_test/regression_detector.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ single-machine-performance-regression_detector:
script:
# Ensure output files exist for artifact downloads step
- mkdir outputs # Also needed for smp job sync step
- touch outputs/report.md # Will be emitted by smp job sync
# Compute merge base of current commit and `main`
- git fetch origin
- SMP_BASE_BRANCH=$(inv release.get-release-json-value base_branch)
Expand Down Expand Up @@ -158,6 +157,14 @@ single-machine-performance-regression_detector-pr-comment:
FF_KUBERNETES_HONOR_ENTRYPOINT: false
allow_failure: true # allow_failure here should have same setting as in job above
script: # ignore error message about no PR, because it happens for dev branches without PRs
# Prevent posting empty Regression Detector report if Markdown report is not found or
# has zero size.
- |
if [[ ! -s "outputs/report.md" ]]
then
echo "ERROR: Regression Detector report not found -- no PR comment posted"
exit 1
fi
# We need to transform the Markdown report into a valid JSON string (without
# quotes) in order to pass a well-formed payload to the PR commenting
# service. Note that on macOS, the "-z" flag is invalid for `sed` (but
Expand Down

0 comments on commit 726d372

Please sign in to comment.