Skip to content

Propagate build description through all log lines#94

Merged
yushan8 merged 1 commit into
mainfrom
propagate-builddesc
May 29, 2026
Merged

Propagate build description through all log lines#94
yushan8 merged 1 commit into
mainfrom
propagate-builddesc

Conversation

@yushan8
Copy link
Copy Markdown
Contributor

@yushan8 yushan8 commented May 29, 2026

Every log line now carries the full request context, making it possible to filter logs by a specific request in production.

Problem: The request fields (build_description, first_revision, second_revision) were attached to a context logger at the top of each RPC handler, but most
subsequent log calls — including inside compareTargetGraphs, compareTargetGraphsAndEdges, and throughout the orchestrator — used c.logger/b.logger directly,
silently dropping that context.

Changes:

  • orchestrator/native_orchestrator.go: Creates a context logger with build_description at the start of GetTargetGraph and uses it for all subsequent calls.
    Removes the per-call repetition of zap.Any("request build description", ...) (also fixes the inconsistent field name). Adds stage-level info logs: processing
    start, checkout done, requests applied, cache hit/miss, and computation complete.
  • controller/getchangedtargets.go and getchangedtargetsandedges.go: All log calls inside the RPC handlers now use the context logger (carrying
    first_revision/second_revision) instead of the bare c.logger. The compareTargetGraphs and compareTargetGraphsAndEdges helpers now accept a *zap.Logger parameter
    (replacing the unused ctx parameter) so their logs also carry the request context.
  • core/workspace/gitrequest.go: Adds a logger to gitRequest (inherited from the orchestrator's context logger, so it carries build_description). Each step of
    Apply() — fetch, diff, apply patch, commit, submodule update — now logs on start and on failure with request_id, base_ref, and commit.
  • core/workspace/workspace.go: The Checkout warn log now includes remote and ref as structured fields

@yushan8 yushan8 marked this pull request as ready for review May 29, 2026 18:18
@yushan8 yushan8 requested review from a team as code owners May 29, 2026 18:18
@yushan8 yushan8 merged commit f87e593 into main May 29, 2026
6 checks passed
@yushan8 yushan8 deleted the propagate-builddesc branch May 29, 2026 18:46
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