Skip to content

fix: edge cases parsing of DD_TAGS#233

Merged
dmehala merged 1 commit intomainfrom
dmehala/fix-tags-parsing
Sep 3, 2025
Merged

fix: edge cases parsing of DD_TAGS#233
dmehala merged 1 commit intomainfrom
dmehala/fix-tags-parsing

Conversation

@dmehala
Copy link
Copy Markdown
Collaborator

@dmehala dmehala commented Aug 15, 2025

Description

This pull request addresses a bug in the tag parsing logic where space-separated values were incorrectly considered even when comma separators were present in the DD_TAGS environment variable. According to the RFC:

"This is a (mostly) backwards-compatible change to DD_TAGS parsing where we use comma-separated tags if there are any commas present in the DD_TAGS variable, and use space-separation otherwise."

The fix ensures that the presence of commas takes precedence, aligning the parsing behavior with the intended specification.

Motivation

The bug was identified during system tests, which rely on correct tag parsing to function as expected. This fix brings the implementation into compliance with the RFC and prevents inconsistent behavior in environments where mixed separators may be present.

@dmehala dmehala requested a review from a team as a code owner August 15, 2025 21:39
@dmehala dmehala requested review from zacharycmontoya and removed request for a team August 15, 2025 21:39
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Aug 15, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.55%. Comparing base (52597cf) to head (eaf206b).
⚠️ Report is 56 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #233      +/-   ##
==========================================
- Coverage   86.56%   86.55%   -0.01%     
==========================================
  Files          82       82              
  Lines        5358     5357       -1     
==========================================
- Hits         4638     4637       -1     
  Misses        720      720              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@zacharycmontoya zacharycmontoya left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for your patience 🙏🏼

Copy link
Copy Markdown
Contributor

@dubloom dubloom left a comment

Choose a reason for hiding this comment

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

Nits but LGTM

}

for (; i < end; ++i) {
for (i = beg; i < end; ++i) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we put i = 0 instead ? I'm almost sure that beg is 0 at this time and it makes the code a slightly more readable

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Make sens. Unfortunately, this PR has been opened for too long, and revisiting it for a nit is not a priority. However, please don’t hesitate to open a new PR if you'd like to revisit or continue the work

continue;
}
if (key.empty()) continue;
value = std::string{trim(token.substr(separator + 1))};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could it be interesting to ignore the key with no value ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

that's done in parse_tags l.210

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry my comment was obviously wrong, to ignore the value with empty value*

@dmehala dmehala merged commit 94493a2 into main Sep 3, 2025
24 checks passed
@dmehala dmehala deleted the dmehala/fix-tags-parsing branch September 3, 2025 08:43
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.

4 participants