Skip to content

[feat][backend] Add openapi src params.#441

Merged
taoyifan89 merged 4 commits intomainfrom
feat/oapi_src
Mar 2, 2026
Merged

[feat][backend] Add openapi src params.#441
taoyifan89 merged 4 commits intomainfrom
feat/oapi_src

Conversation

@taoyifan89
Copy link
Collaborator

Change-Id: I09011617cf91421324b9336eb4965b1e709a4b5c

What type of PR is this?

Check the PR title

  • This PR title match the format: [<type>][<scope>] <description>. For example: [fix][backend] flaky fix
  • The description of this PR title is user-oriented and clear enough for others to understand.
  • Add documentation if the current PR requires user awareness at the usage level.
  • This PR is written in English. PRs not in English will not be reviewed.

(Optional) Translate the PR title into Chinese

(Optional) More detailed description for this PR(en: English/zh: Chinese)

en:
zh(optional):

(Optional) Which issue(s) this PR fixes

Change-Id: I09011617cf91421324b9336eb4965b1e709a4b5c
@codecov
Copy link

codecov bot commented Mar 2, 2026

Codecov Report

❌ Patch coverage is 88.46154% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...ckend/modules/observability/application/openapi.go 90.90% 1 Missing and 1 partial ⚠️
...s/observability/infra/collector/event_collector.go 0.00% 1 Missing ⚠️

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #441      +/-   ##
==========================================
- Coverage   73.77%   73.77%   -0.01%     
==========================================
  Files         625      625              
  Lines       64805    64818      +13     
==========================================
+ Hits        47813    47822       +9     
- Misses      13748    13750       +2     
- Partials     3244     3246       +2     
Flag Coverage Δ
unittests 73.77% <88.46%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...end/modules/observability/infra/metrics/metrics.go 86.95% <100.00%> (+0.38%) ⬆️
...s/observability/infra/collector/event_collector.go 0.00% <0.00%> (ø)
...ckend/modules/observability/application/openapi.go 79.25% <90.90%> (+0.03%) ⬆️

... and 2 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d773c66...ec195fc. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Change-Id: I367fa09e23fe05f4f8d015d70fbd3e57afad5183
Change-Id: I766b4cf718da0468d7e195802a02554304c331f7
Copy link
Collaborator

@CozeLoop CozeLoop left a comment

Choose a reason for hiding this comment

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

Aime backend Go review: adding openapi src header wiring for observability tracing.

All inspected changes are low-risk from correctness, concurrency, and performance perspectives. Adding Extra.src is backward compatible and only surfaces additional metadata into the collector layer.

Inline comments will mark the touched call sites and type signatures as "No risk change" for traceability.

Copy link
Collaborator

@CozeLoop CozeLoop left a comment

Choose a reason for hiding this comment

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

Aime backend Go CR summary for PR #441

All touched observability OpenAPI entrypoints now thread an optional Extra.src field from the new thrift IDL through to the collector interface. The additional src dimension is read from an HTTP header and does not alter existing query semantics, authorization, or rate limiting logic.

I reviewed the following areas:

  • Thrift IDL: new Extra struct and extra field on four OpenAPI requests use high, optional field IDs and keep Base at 255, so wire format remains backward compatible.
  • Generated kitex code (types, validators, fast-path codecs): changes are mechanical and consistent with existing patterns.
  • Application layer (OpenAPIApplication): new Extra.src is read safely (nil-checked) and only passed to the collector; metrics remain unchanged; no new error handling, concurrency, or performance risks identified.
  • Domain & infra collector: ICollectorProvider and its implementation gained a src parameter; all call sites and mocks compile against the new signature, and the implementation remains a no-op as before.

Given the narrow scope and additive nature of these changes, I consider this PR low-risk. Inline comments are marked as "No risk change" on the modified call sites, interface signatures, and IDL definition for traceability.

Change-Id: Id7fed1e456df83f0c45610e878a70891e3d9cdd6
@taoyifan89 taoyifan89 merged commit 4b62939 into main Mar 2, 2026
16 checks passed
@taoyifan89 taoyifan89 deleted the feat/oapi_src branch March 2, 2026 13:28
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.

5 participants