Skip to content

fix: SDK bug fixes — truthiness guards, goal owner overwrite, meeting details rewrite#15

Merged
franccesco merged 10 commits intomainfrom
fix/sdk-bugfixes-v0.21.1
Mar 20, 2026
Merged

fix: SDK bug fixes — truthiness guards, goal owner overwrite, meeting details rewrite#15
franccesco merged 10 commits intomainfrom
fix/sdk-bugfixes-v0.21.1

Conversation

@franccesco
Copy link
Copy Markdown
Owner

Summary

Systematic bug hunt across the entire SDK using a team of 8 specialized agents (4 dev + 4 QA) running TDD and adversarial code review against the real Bloom Growth API. Found and fixed 8 bugs, added 319 new tests.

Bug Fixes

  • Truthiness bug in mutual exclusion guardsif user_id and meeting_id: silently failed when user_id=0, replaced with proper is not None checks in issues, headlines, and scorecard operations (6 files)
  • Goal update() overwrites owner — Previously always defaulted accountable_user to the current user, silently overwriting the existing owner when only updating title or status. Now truly optional.
  • Meeting details() only found user's own meetings — Rewrote to call GET L10/{id} directly instead of filtering from list(). Fields start_date_utc, created_date, organization_id are now populated.
  • Goals Origins[0] unsafe access — Crash on empty or malformed Origins arrays in goal transforms
  • Headline create DetailsUrl=None crashdata.get("DetailsUrl", "") didn't handle explicit None; fixed to data.get("DetailsUrl") or ""
  • Whitespace-only API key accepted — Configuration now strips whitespace from API keys
  • Todo create naive datetime fallback — Changed datetime.now() to datetime.now(UTC) for timezone-aware fallback
  • Metrics transform zero-ID filteringif not measurable_id filtered out ID=0; fixed to is None check

Test Changes

  • Updated existing meeting and goal tests to match new behavior
  • Added 134 integration tests hitting the real API (all operations, sync + async)
  • Added 185 adversarial tests for edge cases and malformed data
  • Registered integration pytest marker for selective test execution
  • Total: 197 → 516 tests, 95% → 98% coverage

Test plan

  • All 516 tests pass (uv run pytest)
  • All ruff lint checks pass (uv run ruff check .)
  • All files properly formatted (uv run ruff format --check .)
  • 134 integration tests validated against real Bloom Growth API
  • 185 adversarial tests cover edge cases and malformed inputs
  • No regressions in existing 197 unit tests

🤖 Generated with Claude Code

franccesco and others added 10 commits March 20, 2026 10:42
Replace `if user_id and meeting_id:` with `if user_id is not None and
meeting_id is not None:` in issues, headlines, and scorecard operations
(sync + async). The truthiness check failed silently when user_id=0,
allowing both params to be used simultaneously instead of raising
ValueError. Also fix downstream `if meeting_id:` to `if meeting_id is
not None:` and headline create DetailsUrl null handling.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ccess

Goal update() previously always defaulted accountable_user to the
current user, silently overwriting the existing owner when only updating
the title or status. Now accountable_user is only included in the API
payload when explicitly provided. Also add safety checks for empty or
malformed Origins arrays in goal transform functions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Meeting details() previously called self.list() which only returned the
current user's meetings, then filtered by ID. This meant meetings the
user was an attendee of (but didn't own) could not be found, and fields
like start_date_utc, created_date, and organization_id were always None.
Now calls GET L10/{meeting_id} directly, populating all fields from the
API response. Also harden metrics transform measurable_id check and
Owner null handling in meeting issues transform.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Strip whitespace from API keys in Configuration to reject whitespace-only
keys. Make UserSearchResult and UserListItem model fields optional where
API may return None. Use timezone-aware UTC datetime in todo create
fallback. Fix user list placeholder filtering to use email check.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Update mock expectations in meeting tests to match the new direct API
call pattern (GET L10/{id} instead of list-then-filter). Update goal
tests to reflect that accountable_user is no longer auto-populated.
Update bulk operation tests for new meeting details behavior.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add 134 integration tests that validate all operations against the real
Bloom Growth API, covering users, meetings, scorecard, todos, goals,
issues, and headlines (sync + async). Tests are marked with
@pytest.mark.integration and can be deselected for CI with
-m "not integration".

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add 185 adversarial tests covering edge cases: zero IDs bypassing
truthiness guards, malformed API responses, missing/None fields in
transforms, empty Origins arrays, whitespace-only API keys, and
Pydantic model coercion boundaries.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Exclude integration tests from CI runs with -m "not integration" since
they require BG_API_KEY. Fix pyright type error in meetings transform
by extracting Owner dict to a typed local variable.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@franccesco franccesco merged commit df740f4 into main Mar 20, 2026
6 checks passed
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.

1 participant