Skip to content

fix: log cached v1 org lookup failures for committee members - #200

Open
bramwelt wants to merge 2 commits into
mainfrom
fix/log-cached-org-lookup-failure
Open

bramwelt wants to merge 2 commits into
mainfrom
fix/log-cached-org-lookup-failure

Conversation

@bramwelt

Copy link
Copy Markdown
Contributor

Summary

lookupV1Org caches a failed v1 Organization Service lookup as an entry with an empty name, and returns that entry with a nil error. The committee member create and update mappers then left the organization empty without logging anything. Any retry during the cache window (up to 6h) therefore gave no indication of why the member had no organization.

This PR logs a warning in that case, matching the existing failed to lookup organization, leaving empty warning for a direct lookup failure. Behavior is otherwise unchanged.

Changes

  • handlers_committees.go: in both mapV1DataToCommitteeMemberCreatePayload and mapV1DataToCommitteeMemberUpdatePayload, a cached empty-name result now logs organization lookup returned no name (cached lookup failure), leaving empty with account_sfid.
  • handlers_committees_org_test.go: covers a cached failure (organization left empty, warning logged) and a cached success (organization mapped) for both mappers.

Supersedes #196, which sent an ID-only organization on lookup failure. That would have hidden incorrect account__c data rather than surfacing it.

Testing

  • go test ./... passes.
  • make check (gofmt, vet, golangci-lint): 0 issues.

🤖 Generated with Claude Code

lookupV1Org caches a failed organization lookup as an entry with an
empty name and returns it with a nil error. The committee member create
and update mappers then dropped the organization without logging
anything, so retries within the cache window left no trace of why the
member had no organization.

Log a warning in that case, matching the existing warning for a direct
lookup failure, and cover both mappers with a test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
@bramwelt
bramwelt requested a review from a team as a code owner October 22, 2026 22:01
Copilot AI balanced review requested due to automatic review settings October 22, 2026 22:01

dealako commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

@bramwelt I'm starting review 1 of this pull request now (started 2026-10-22 22:05 UTC). This usually takes a few minutes — I'll update this comment with the summary when I'm done.


Hi @bramwelt, thanks for this PR! 👋

This is a tight, focused fix: both committee-member mappers now log a warning when lookupV1Org returns a cached empty-name entry. This matches the existing direct-failure warning, and behavior is otherwise unchanged. The new table-driven test covers the create and update paths for both cached-failure and cached-success cases. It passes locally. Logging only the account SFID keeps the log free of PII.

No issues found in any dimension.

✅ Approved

➡️ This auto-review agent is a preview. Please send feedback to @dealako.

@dealako dealako left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Automated review found no blocking, security, privacy, or minor issues. The change is a small, well-tested logging fix. Approving.


Generated by Claude Code

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The logging-only changes preserve existing payload behavior and have focused regression coverage for both affected paths.

No open issues 🎉

What changed in this PR

Adds visibility into cached organization lookup failures during committee member synchronization, without changing payload behavior.

Changes:

  • Logs a warning with account_sfid when either member mapper receives an organization with an empty name.
  • Adds regression tests for cached failures and successful organization mappings in both create and update paths.
File Description
cmd/​lfx-v1-sync-helper/​handlers_committees.go Adds cached-failure warnings to both member mappers.
cmd/​lfx-v1-sync-helper/​handlers_committees_org_test.go Covers warning emission and organization presence for both mappers.

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 23, 2026 21:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The narrow logging change preserves mapping behavior, covers both affected paths with regression tests, and has no identified blocking issues.

No open issues 🎉

Review effort: Balanced

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.

3 participants