refactor(http): extract BaseHTTPResource base class from 9 API resources#3558
refactor(http): extract BaseHTTPResource base class from 9 API resources#3558
Conversation
Elevate design specs directive to top-level Working Convention in CLAUDE.md. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add InitResourceContext types, check.not_none pattern, teardown net-new note, tenacity cancellation caveat, and OAuth2Session typing guidance. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Fix "see note below/above" reference direction and clarify request pipeline diagram to show _prepare_request destructuring. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Audit found FinalsiteResource is vestigial (code locations use SFTP), Overgrad/DeansList use page-based pagination (not offset), and ADP WFN stops on HTTP 204. Updated spec with all resolutions and wrote 13-task implementation plan for BaseHTTPResource extraction. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…d URL construction Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…h mTLS and offset pagination Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…tion and beta URL logic Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Claude finished @cbini's task in 14m 26s —— View job Code Review: PR #3558 —
|
- Add cursor_param to paginate_cursor (was hardcoded to page[after]) - Clean up HTTP-date test (remove dead code, use pytest.approx) - Rename _post_request to _strip_api_key in DeansListResource - Document session replacement in _setup_session docstring - Clamp Zendesk _get_retry_after to max(..., 0.0) - Add try/finally for DeansList _current_school_id reset - Guard ADP extract_records against 204 No Content Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
#1 — bare raise is correct. _reauthenticate() is called from within the except HTTPError block in _request_with_retry (line 224). Python's exception context persists through nested function calls. Verified with a reproducer. update your review |
|
Claude finished @cbini's task in 1m 24s —— View job Code Review Update: PR #3558
Updated FindingsIssue #1 — retracted. The bare Issue #9 — acknowledged as by design. StatusAll other issues from the original review have been addressed in
The PR looks good to merge. |
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Pull Request
Summary & Motivation
Extract a reusable
BaseHTTPResourcebase class from 9 existing Dagster HTTPresource classes, eliminating duplicated session lifecycle, retry, error
handling, and pagination logic.
What changed:
src/teamster/libraries/http/package withBaseHTTPResource(lifecycle,request pipeline with tenacity retry, error handling with rate-limit awareness,
re-auth guard) and three pagination helpers (cursor, offset, page)
BaseHTTPResource:SmartRecruiters, PowerSchool Enrollment, Overgrad, KnowBe4 (Tier 1);
Zendesk, Coupa, Grow (Tier 2); ADP WFN, DeansList (Tier 3)
post()renamed topost_action()(4 callers updated) to avoidbase class conflict
Vestigial resources left untouched: AdpWorkforceManagerResource,
MClassResource, DibelsDataSystemResource, CouchdropResource,
AlchemerResource, FinalsiteResource.
AI Assistance
Implementation was AI-assisted (Claude Code) following a human-directed spec and
implementation plan. Spec design, audit, and all architectural decisions were
human-directed. Implementation was subagent-driven with review between tasks.
Self-review
General
TEAMster Asana Project
feedback; dismiss false positives with a brief reply explaining why.
(Claude is advisory — use your judgement, but don't ignore it.)
Dagster (skip if no Dagster changes)
uv run dagster definitions validatefor any modified code locationuv run pytest tests/test_dagster_definitions.pyfor any modifiedcode location
Library + Config pattern
with the correct asset key format and IO manager
CI checks
trunk checkandtrunk fmtlocally, fix any issues, and push again.
expand Invoke
dbt build ...→ Debug Logs. Or tag Claude onthe PR with the error details.
change and the PR is not a draft). If it fails: check the Actions tab
for the workflow run logs. Re-run failed jobs if the failure looks
transient; otherwise check the Dagster Cloud branch deployment for
error details. Or tag Claude on the PR for help.
🤖 Generated with Claude Code