Skip to content

export driver tags with unit - #2956

Merged
fengzeroz merged 2 commits into
emqx:mainfrom
fengzeroz:main
Nov 10, 2026
Merged

fengzeroz merged 2 commits into
emqx:mainfrom
fengzeroz:main

Conversation

@fengzeroz

Copy link
Copy Markdown
Member

No description provided.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-09T08:42:55.447168Z 152205c PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 152205cc6f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

cmd.tags[i].name = strdup(data->tags[i].name);
cmd.tags[i].description =
strdup(data->tags[i].description ? data->tags[i].description : "");
cmd.tags[i].unit = strdup(data->tags[i].unit ? data->tags[i].unit : "");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve units in global-config exports

When PUT /api/v2/global/config receives a non-empty tag unit, this line now preserves it in the live tag, but the corresponding GET path builds its response in get_tags_resp without assigning tags_res.tags[index].unit (the assignments at lines 1143-1151 omit it). neu_json_encode_tag consequently serializes the zero-initialized pointer as "", so the new nonempty round-trip assertion fails and exporting then re-importing the configuration silently clears the unit; copy tag->unit into the response tags in this sibling export path.

Useful? React with 👍 / 👎.

@codecov-commenter

codecov-commenter commented Nov 9, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.16599% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.85%. Comparing base (12f93a8) to head (da2ca56).

Files with missing lines Patch % Lines
plugins/restful/read_response.c 91.83% 4 Missing ⚠️
plugins/restful/rw_handle.c 88.23% 2 Missing ⚠️
plugins/restful/global_config_handle.c 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2956      +/-   ##
==========================================
+ Coverage   68.73%   68.85%   +0.12%     
==========================================
  Files         135      137       +2     
  Lines       34411    34649     +238     
==========================================
+ Hits        23653    23859     +206     
- Misses      10758    10790      +32     

☔ View full report in Codecov by Harness.
📢 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.

@fengzeroz
fengzeroz merged commit ad8a4da into emqx:main Nov 10, 2026
14 checks passed
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.

2 participants