docs(claude): capture SDK-field gotcha and update worktree workflow#56
Merged
Merged
Conversation
Three small CLAUDE.md tweaks driven by the PR #55 incident-state bug and a shift in the local worktree workflow: - Add a Gotcha for the datadog_api_client SDK: verify model field names against openapi_types before reading or writing. v2 incidents expose `state` (not `status`), and lifecycle changes flow through `fields["state"]` as a dropdown, not a top-level attribute. `getattr(obj, "wrong_name", "")` masks this silently. - Sharpen the Mock(spec_set=...) note in Testing Patterns to explain why it matters for SDK response mocks: bare Mock(field=...) accepts any attribute name, which is exactly how the incident bug shipped. - Drop the `git gtr` recommendations from Development Workflow and Gotchas. The local preference is now `claude --worktree`, falling back to plain `git worktree add` / `git worktree remove` when a session was started without it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three small CLAUDE.md tweaks driven by the PR #55 incident-state bug and a shift in the local worktree workflow.
1. Gotcha: verify SDK field names against
openapi_typesPR #55 fixed a real-tenant bug where
getattr(attrs, "status", "")always returned""because the v2 SDK exposesstate(notstatus) onIncidentResponseAttributes, and writes go throughfields["state"](dropdown), not a top-level attribute. Documenting this prevents recurrence across the ~20 other modules wrapping the same SDK.2. Sharpen the
Mock(spec_set=...)note in Testing PatternsThe existing note explains the mechanic. The new wording explains why it matters for SDK response mocks: bare
Mock(field=...)accepts any attribute name and lets typos likeMock(status=...)pass tests while breaking against the real SDK.3. Drop
git gtrfrom Development Workflow / GotchasLocal preference is now
claude --worktree(auto-creates a worktree under.claude/worktrees/), falling back to plaingit worktree add/git worktree removewhen a session was started without it. The previousgit gtrguidance predates the--worktreeCLI flag.Test plan
git diff --stat: 1 file changed, 4 insertions, 4 deletions