BED-9505: canonicalize organization login before collection - #45
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
Included review availability: 4 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour. WalkthroughOrganization sources now canonicalize configured organization names through GitHub, cache valid responses, and reuse those responses when generating organization resources. Tests cover canonicalization, cache reuse, and both token and GitHub App sources. ChangesOrganization canonicalization and caching
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This PR canonicalizes organization login values before resource collection and adds regression coverage; no actionable merge-blocking risk remains beyond normal checks and review. Sequence Diagram(s)sequenceDiagram
participant SourceInitialization
participant GitHubRESTClient
participant SourceContext
participant OrganizationResource
SourceInitialization->>GitHubRESTClient: Fetch configured organization
GitHubRESTClient-->>SourceInitialization: Return canonical login and response
SourceInitialization->>SourceContext: Store canonical name and response
OrganizationResource->>SourceContext: Read organizations_cache
SourceContext-->>OrganizationResource: Return cached organization response
OrganizationResource->>GitHubRESTClient: Request organization permissions
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
Canonicalize org-only collection contexts from GitHub's returned organization login before resource fan-out so downstream resources use the same org_login value as the organizations table. Reuse the preflight organization response through a small cache and add regression coverage for token and org-app collection paths.
Testing: uv run pytest tests/test_source_org_canonicalization.py tests/test_org_scim_resources.py tests/test_app_auth.py tests/test_error_resilience.py
Lint: uv run ruff check src/openhound_github/source.py src/openhound_github/resources/organization.py tests/test_source_org_canonicalization.py
Summary by CodeRabbit
Improvements
Tests