elastic / elastic/integrations

[CI] [flaky-tests] Include stack service SHA refs in automated flaky-test issue descriptions

Open
#18,938 1 comment 0 reactions 0 assignees View on GitHub
Team:Ecosystem
Dominant language
Handlebars
Stars
333
Forks
647
Avg merge
3d 4h
Merged PRs (30d)
209

Description

## Context

Relates to https://github.com/elastic/integrations/issues/18803 ([comment](https://github.com/elastic/integrations/issues/18803#issuecomment-4416840208))

Automated GitHub issues for failing daily jobs are created by the `report-failed-tests`
Buildkite step, which parses jUnit XML artifacts and renders issue descriptions using
Go templates (`dev/testsreporter/`).

Issue descriptions currently include the stack version, package name, failing test, and
build links, but do **not** include the exact SHA commit of each service image
(Elastic Agent, Elasticsearch, Kibana, Fleet Server) that was running during the failed
test. This makes it harder to correlate failures with specific upstream changes,
requiring engineers to manually open the Buildkite log and run `elastic-package stack
status` to find that information.

This issue is the integrations-side counterpart of
https://github.com/elastic/elastic-package/issues/3536, which adds
the VCS SHA refs as `` elements inside `` blocks of the jUnit
XML reports generated by `elastic-package test`. Once that change lands, the data will
be available in the XML artifacts already downloaded by the reporting pipeline.

## Proposal

Update the `dev/testsreporter` package to read `` from the jUnit XML
`` elements and include the service SHA refs in the generated issue
description.

### Example of what the XML will contain (after elastic-package change)

```xml











...

```

### Example of the updated issue description

```
- Stack version: 9.5.0-SNAPSHOT
- Packages:
- aws
- cel
- ...
- Owners:
- @elastic/ecosystem
- Services:
| Service | VCS Ref | Build Date |
|------------------|------------|----------------------|
| elastic-agent | eac42baa7d | 2026-05-10T03:11Z |
| elasticsearch | 78c313d002 | 2026-05-08T16:38Z |
| kibana | 1dfe3071d2 | 2026-05-10T11:27Z |
| fleet-server | eac42baa7d | 2026-05-10T03:11Z |
```

## Implementation notes

The changes are confined to `dev/testsreporter/`:

- **`xunit.go`**: Add `property`, `properties` structs and a `Properties` field to
`testSuite` to unmarshal `` from the XML. Expose a method to collect
unique service properties across all suites in a file.
- **`packageerror.go` / `builderror.go`**: Pass the collected properties through
`SummaryData()` / `DescriptionData()` so they reach the templates.
- **`_static/description.tmpl`** (or `summary.tmpl`): Render the service table when
the properties map is non-empty.

The section should be omitted gracefully when properties are absent (e.g., older
elastic-package versions, serverless runs).

## Acceptance criteria

- [ ] `dev/testsreporter/xunit.go` parses `` from `` elements.
- [ ] Service VCS refs and build dates appear in the body of newly created issues when
present in the XML.
- [ ] The section is silently omitted when no properties are found in the XML (backwards
compatible with reports generated by older elastic-package versions).
- [ ] Existing unit tests for `testsreporter` are updated; new tests cover the property
parsing and template rendering.

## Dependencies

- Depends on https://github.com/elastic/elastic-package/issues/3536 — adds `` to the jUnit XML output.
This issue can be implemented and merged independently; the services section will
simply not appear until the elastic-package change is also deployed.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.