Skip to content

DINO-1137: make codebloom forward autogen'd x-request-id to grpc calls + more - #1090

Merged
tahminator merged 1 commit into
mainfrom
DINO-1137
Nov 19, 2026
Merged

tahminator merged 1 commit into
mainfrom
DINO-1137

Conversation

@tahminator

@tahminator tahminator commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

make codebloom forward autogen'd x-request-id to grpc calls + more. update LAS to forward x-request-id to LASS. now, we can track the logs for one request from the top to the bottom. Add a small fix that will override locale from config-schema.json

Description of changes

Checklist

  • I self-reviewed this PR
  • All AI comments are fixed or resolved before requesting review
  • CI is green
  • Database changes follow the db repo rules, or this PR does not change the database. Comment /migrate to apply migrations to staging (Codebloom team only).
  • I QA'd this in dev and attached screenshots below. If staging could not be checked, say why.

Screenshots

Dev

Staging

Summary by CodeRabbit

  • New Features
    • Added the ff.message-winners configuration option, defaulting to false.
    • Locale values in configuration are now represented as strings rather than a predefined list.
  • Improvements
    • Request IDs are carried through authentication refresh calls and scheduled tasks, improving consistency in request tracking.
    • gRPC client channels now support centralized configuration for timeouts, request IDs, observations, and secure or plaintext connections.

…s. update LAS to forward x-request-id to LASS. now, we can track the logs for one request from the top to the bottom. Add a small fix that will override locale from config-schema.json
@tahminator
tahminator requested a review from a team November 19, 2026 18:25
@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The changes add request ID propagation and tracing across Java gRPC calls and Leetcode Auth Service refreshes. They also propagate MDC to scheduled tasks and update configuration schema generation and its generated schema.

Changes: Request ID propagation and tracing

Layer / File(s) Summary
Java request context and gRPC channel
src/main/java/org/patinanetwork/codebloom/utilities/RequestIdFilter.java, src/main/java/org/patinanetwork/codebloom/config/GrpcRequestIdInterceptor.java, src/main/java/org/patinanetwork/codebloom/config/GrpcChannelFactory.java, src/main/java/org/patinanetwork/codebloom/config/GrpcClientConfiguration.java
The request filter runs at highest precedence and exposes its MDC key. The gRPC channel factory attaches the request-ID and observation interceptors, and the request-ID interceptor reads the ID from MDC.
Scheduled task MDC propagation
src/main/java/org/patinanetwork/codebloom/utilities/MdcTaskDecorator.java, src/main/java/org/patinanetwork/codebloom/utilities/exception/ScheduledTaskExceptionHandler.java, src/test/java/org/patinanetwork/codebloom/utilities/MdcTaskDecoratorTest.java
The scheduler uses a task decorator that applies the submitting thread’s MDC during task execution and restores the worker’s previous MDC afterward. Tests cover propagation, clearing, and restoration.
Rust request ID extraction and refresh
internal/leetcode-auth-service/src/grpc/reqid.rs, internal/leetcode-auth-service/src/grpc/mod.rs, internal/leetcode-auth-service/src/main.rs, internal/leetcode-auth-service/src/grpc/auth.rs, internal/leetcode-auth-service/src/service/refresh.rs
The gRPC middleware records valid request IDs in a tracing span. The refresh RPC passes the extracted ID to TokenManager; scheduled refreshes pass no ID. The refresh task runs in the current tracing span.
LASS request ID forwarding
internal/leetcode-auth-service/src/grpc/client/lass.rs
LASS authentication adds a valid optional request ID to gRPC metadata. The fake authenticator records received IDs, and tests cover present and absent IDs.

Configuration schema updates

Layer / File(s) Summary
Schema overrides and generated configuration
src/main/java/org/patinanetwork/codebloom/utilities/generator/schema/ConfigSchemaGenerator.java, src/main/resources/config-schema.json, src/test/java/org/patinanetwork/codebloom/utilities/generator/schema/ConfigSchemaGeneratorTest.java
Schema generation replaces the Locale definition with a string schema when that definition exists. The generated schema removes the Locale enum and adds the ff.message-winners property. Tests cover the Locale override and the case where the definition is absent.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant RequestIdFilter
  participant GrpcRequestIdInterceptor
  participant GrpcRequestIdMiddleware
  participant LeetcodeAuthService
  participant TokenManager
  participant GrpcLASS
  RequestIdFilter->>GrpcRequestIdInterceptor: Provide request ID from MDC
  GrpcRequestIdInterceptor->>GrpcRequestIdMiddleware: Send gRPC request with request ID metadata
  GrpcRequestIdMiddleware->>LeetcodeAuthService: Invoke service within request span
  LeetcodeAuthService->>TokenManager: Trigger RPC refresh with request ID
  TokenManager->>GrpcLASS: Authenticate with request ID
Loading

Possibly related PRs

Suggested labels: java

Suggested reviewers: angelayu0530, schen25

Merge Risk: Minimal · up to 8a800

This change forwards the request ID through gRPC calls and applies the locale schema override. No concrete defect was found, so the merge risk is minimal.

Pre-merge checks: Passed 3 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Description check Warning The description has a summary line that states the goal: forward the autogenerated x-request-id to gRPC calls, have LAS forward it to LASS, and add a locale override from config-schema.json. The 'Desc… Fill in the 'Description of changes' section. List the request-ID propagation path (Java Codebloom to LAS over gRPC, then LAS to LASS), the new MDC-aware task decorator, the RequestIdFilter ordering change, and the config-schema locale over…
Passed Passed checks: 3 passed

Check name Status Explanation
Title check Passed The title names the ticket and its main goal: codebloom forwards the autogenerated x-request-id to gRPC calls. The diff supports this. The diff also adds a LAS-to-LASS request-ID path, MDC propagation…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the ticket and its main goal: codebloom forwards the autogenerated x-request-id to gRPC calls. The diff supports this. The diff also adds a LAS-to-LASS request-ID path, MDC propagation to scheduled tasks, and a locale schema override. The phrase “+ more” is vague, but the main change is clear.

Full details: Description check

Explanation

The description has a summary line that states the goal: forward the autogenerated x-request-id to gRPC calls, have LAS forward it to LASS, and add a locale override from config-schema.json. The 'Description of changes' section is empty, so the PR does not describe the specific changes to files or behavior. The checklist items are all unchecked. The Dev and Staging screenshot sections contain only placeholder comments. No QA result or reason for skipping staging is given. The template's required sections are therefore largely unfilled, although the intent is clear from the opening sentence.

Resolution

Fill in the 'Description of changes' section. List the request-ID propagation path (Java Codebloom to LAS over gRPC, then LAS to LASS), the new MDC-aware task decorator, the RequestIdFilter ordering change, and the config-schema locale override. Tick the checklist items that apply, or state why they do not. Add QA notes for dev and attach screenshots, or state why staging could not be checked.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

Clippy (1.99.1)

Clippy execution failed

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4612a6f4-1361-4748-b119-f6264139b984
Commits

Reviewing files that changed from the base of the PR and between 6f41ada and 8a80040.

Files selected for processing: 16

  • internal/leetcode-auth-service/src/grpc/auth.rs
  • internal/leetcode-auth-service/src/grpc/client/lass.rs
  • internal/leetcode-auth-service/src/grpc/mod.rs
  • internal/leetcode-auth-service/src/grpc/reqid.rs
  • internal/leetcode-auth-service/src/main.rs
  • internal/leetcode-auth-service/src/service/refresh.rs
  • src/main/java/org/patinanetwork/codebloom/config/GrpcChannelFactory.java
  • src/main/java/org/patinanetwork/codebloom/config/GrpcClientConfiguration.java
  • src/main/java/org/patinanetwork/codebloom/config/GrpcRequestIdInterceptor.java
  • src/main/java/org/patinanetwork/codebloom/utilities/MdcTaskDecorator.java
  • src/main/java/org/patinanetwork/codebloom/utilities/RequestIdFilter.java
  • src/main/java/org/patinanetwork/codebloom/utilities/exception/ScheduledTaskExceptionHandler.java
  • src/main/java/org/patinanetwork/codebloom/utilities/generator/schema/ConfigSchemaGenerator.java
  • src/main/resources/config-schema.json
  • src/test/java/org/patinanetwork/codebloom/utilities/MdcTaskDecoratorTest.java
  • src/test/java/org/patinanetwork/codebloom/utilities/generator/schema/ConfigSchemaGeneratorTest.java

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@tahminator tahminator changed the title DINO-1137: make codebloom forward autogen'd x-request-id to grpc call… DINO-1137: make codebloom forward autogen'd x-request-id to grpc calls. Nov 19, 2026
@tahminator tahminator changed the title DINO-1137: make codebloom forward autogen'd x-request-id to grpc calls. DINO-1137: make codebloom forward autogen'd x-request-id to grpc calls + more Nov 19, 2026
@pat-agent

pat-agent Bot commented Nov 19, 2026

Copy link
Copy Markdown

Available PR Commands

  • /migrate - Applies this PR's database migrations to the staging DB (can only be run by someone on @Patina-Network/codebloom)
  • /copy - Triggers copy from production to staging db (can only be run by tahminator or angelayu0530)
  • /e2e-test - Runs E2E tests on this PR's head commit (requires write access to the repo)

@pat-agent

pat-agent Bot commented Nov 19, 2026

Copy link
Copy Markdown

The image has been uploaded to https://hub.docker.com/r/patinanetwork/codebloom-leetcode-auth-service-arm/tags under the following tags:

  • codebloom-leetcode-auth-service-arm:staging-latest
  • codebloom-leetcode-auth-service-arm:staging-2026.11.19-13.25.41
  • codebloom-leetcode-auth-service-arm:staging-7bac5be

@pat-agent

pat-agent Bot commented Nov 19, 2026

Copy link
Copy Markdown

The image has been uploaded to https://hub.docker.com/r/patinanetwork/codebloom-leetcode-auth-stealer-service/tags under the following tags:

  • codebloom-leetcode-auth-stealer-service:staging-latest
  • codebloom-leetcode-auth-stealer-service:staging-2026.11.19-13.25.37
  • codebloom-leetcode-auth-stealer-service:staging-7bac5be

@pat-agent

pat-agent Bot commented Nov 19, 2026

Copy link
Copy Markdown

The image has been uploaded to https://hub.docker.com/r/patinanetwork/codebloom-leetcode-auth-service/tags under the following tags:

  • codebloom-leetcode-auth-service:staging-latest
  • codebloom-leetcode-auth-service:staging-2026.11.19-13.25.35
  • codebloom-leetcode-auth-service:staging-7bac5be

@sonarqubecloud

Copy link
Copy Markdown

@sonarqubecloud

Copy link
Copy Markdown

@pat-agent

pat-agent Bot commented Nov 19, 2026

Copy link
Copy Markdown

The image has been uploaded to https://hub.docker.com/r/patinanetwork/codebloom-standup-bot-arm/tags under the following tags:

  • codebloom-standup-bot-arm:staging-latest
  • codebloom-standup-bot-arm:staging-2026.11.19-13.25.43
  • codebloom-standup-bot-arm:staging-7bac5be

@pat-agent

pat-agent Bot commented Nov 19, 2026

Copy link
Copy Markdown

The image has been uploaded to https://hub.docker.com/r/patinanetwork/codebloom-standup-bot/tags under the following tags:

  • codebloom-standup-bot:staging-latest
  • codebloom-standup-bot:staging-2026.11.19-13.25.43
  • codebloom-standup-bot:staging-7bac5be

@pat-agent

pat-agent Bot commented Nov 19, 2026

Copy link
Copy Markdown

The image has been uploaded to https://hub.docker.com/r/patinanetwork/codebloom/tags under the following tags:

  • codebloom:staging-latest
  • codebloom:staging-2026.11.19-13.28.26
  • codebloom:staging-7bac5be

@tahminator
tahminator enabled auto-merge (squash) November 19, 2026 18:33
@pat-agent

pat-agent Bot commented Nov 19, 2026

Copy link
Copy Markdown

The image has been uploaded to https://hub.docker.com/r/patinanetwork/codebloom-leetcode-auth-stealer-service-arm/tags under the following tags:

  • codebloom-leetcode-auth-stealer-service-arm:staging-latest
  • codebloom-leetcode-auth-stealer-service-arm:staging-2026.11.19-13.25.38
  • codebloom-leetcode-auth-stealer-service-arm:staging-7bac5be

@pat-agent

pat-agent Bot commented Nov 19, 2026

Copy link
Copy Markdown

The image has been uploaded to https://hub.docker.com/r/patinanetwork/codebloom-arm/tags under the following tags:

  • codebloom-arm:staging-latest
  • codebloom-arm:staging-2026.11.19-15.03.06
  • codebloom-arm:staging-7bac5be

@tahminator
tahminator merged commit dad6aa3 into main Nov 19, 2026
52 of 53 checks passed
@tahminator
tahminator deleted the DINO-1137 branch November 19, 2026 20:08
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