Skip to content

Conversation

@everfid-ever
Copy link
Contributor

Which issue(s) this PR fixes:

Fixes #950

@slievrly slievrly requested a review from Copilot November 5, 2025 03:25
@slievrly slievrly added this to the 2.1.0 milestone Nov 5, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds comprehensive test coverage for the Gin transaction middleware, which handles distributed transaction context propagation in HTTP requests. The middleware extracts transaction IDs (XID) from HTTP headers and initializes the Seata transaction context.

Key changes:

  • Adds 8 test cases covering various XID header scenarios (primary key, fallback key, precedence, empty values, missing values)
  • Includes integration tests with full Gin router setup
  • Validates both success and error paths of the middleware

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov-commenter
Copy link

codecov-commenter commented Nov 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 46.38%. Comparing base (4420143) to head (3ffbd0e).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #969      +/-   ##
==========================================
+ Coverage   46.33%   46.38%   +0.04%     
==========================================
  Files         195      196       +1     
  Lines       11887    11901      +14     
==========================================
+ Hits         5508     5520      +12     
- Misses       5943     5944       +1     
- Partials      436      437       +1     

☔ 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
Contributor

@Code-Fight Code-Fight left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@slievrly slievrly left a comment

Choose a reason for hiding this comment

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

LGTM

@slievrly slievrly merged commit c26ad1c into apache:master Nov 6, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve test coverage for pkg/integration/gin

4 participants