Skip to content

feat: Implement custom flags support for coverage reports#2070

Merged
nikita-tkachenko-datadog merged 4 commits intomasterfrom
nikita-tkachenko/coverage-flags
Jan 30, 2026
Merged

feat: Implement custom flags support for coverage reports#2070
nikita-tkachenko-datadog merged 4 commits intomasterfrom
nikita-tkachenko/coverage-flags

Conversation

@nikita-tkachenko-datadog
Copy link
Contributor

Summary

Implement custom flags support in the datadog-ci coverage upload command to allow users to tag and group coverage reports. This enables use cases like splitting coverage by test type (unit/integration) or language version (jvm-21, jvm-17), supporting future carryforward functionality.

Changes

  • Add --flags CLI option with repeatable usage: --flags type:unit-tests --flags jvm-21
  • Send flags as array of strings in report.flags tag
  • Implement maximum 32 flags per report validation
  • Remove leftover --tags and --measures CLI options that were unused
  • Update tests to cover flags functionality (5 new tests for getFlags, 1 integration test)
  • Update renderer to display flags in dry-run output
  • Remove unused imports for tag/metric parsing

Key Implementation Details

  • Flags are optional and omitted from API payload when not provided
  • Validation throws error if more than 32 flags supplied
  • Removed environment variable support (DD_TAGS, DD_MEASURES)
  • All 60 existing tests pass; breaking change removes unused --tags/--measures options

Test Plan

  • All unit tests passing (60/60)
  • Manual testing: datadog-ci coverage upload --flags type:unit-tests --flags jvm-21 . --dry-run
  • Flags appear correctly in dry-run output
  • Error thrown when exceeding 32 flags limit

🤖 Generated with Claude Code

@nikita-tkachenko-datadog nikita-tkachenko-datadog requested a review from a team as a code owner January 23, 2026 16:52
@nikita-tkachenko-datadog nikita-tkachenko-datadog marked this pull request as draft January 23, 2026 16:53
@nikita-tkachenko-datadog nikita-tkachenko-datadog added the software-delivery Related to [coverage, deployment, dora, junit, measure, tag, trace] label Jan 23, 2026
Add support for the --flags CLI option to allow users to tag and group coverage reports. This enables use cases like splitting coverage by test type (unit/tests) or language version (jvm-21, jvm-17).

Changes:
- Add --flags CLI option with repeatable usage
- Send flags as array of strings in report.flags tag
- Implement max 32 flags per report validation
- Remove leftover --tags and --measures CLI options
- Update tests to cover new flags functionality
- Update renderer to display flags in output

Flags are sent to the backend API and can be used for carryforward and report filtering.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@nikita-tkachenko-datadog nikita-tkachenko-datadog force-pushed the nikita-tkachenko/coverage-flags branch from 55c86df to e9c4a94 Compare January 23, 2026 16:57
@nikita-tkachenko-datadog nikita-tkachenko-datadog marked this pull request as ready for review January 26, 2026 11:21
@nikita-tkachenko-datadog nikita-tkachenko-datadog requested a review from a team as a code owner January 26, 2026 11:21
@rtrieu rtrieu self-requested a review January 26, 2026 20:04
Copy link
Contributor

@Drarig29 Drarig29 left a comment

Choose a reason for hiding this comment

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

How are you sure tags and measures were unused?

@nikita-tkachenko-datadog
Copy link
Contributor Author

How are you sure tags and measures were unused?

There was never any support for them in the backend, so adding them was effectively a no-op. The only place they were mentioned is the README file here, which never explained how and why to use them

Copy link
Contributor

@Drarig29 Drarig29 left a comment

Choose a reason for hiding this comment

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

LGTM

@nikita-tkachenko-datadog nikita-tkachenko-datadog merged commit d7c5736 into master Jan 30, 2026
26 checks passed
@nikita-tkachenko-datadog nikita-tkachenko-datadog deleted the nikita-tkachenko/coverage-flags branch January 30, 2026 14:23
@Drarig29 Drarig29 mentioned this pull request Feb 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

software-delivery Related to [coverage, deployment, dora, junit, measure, tag, trace]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants