Skip to content

Modernize LeetCode sync robustness - #54

Merged
yurirocha15 merged 16 commits into
mainfrom
refactor/modernize-code
Jun 20, 2026
Merged

yurirocha15 merged 16 commits into
mainfrom
refactor/modernize-code

Conversation

@yurirocha15

@yurirocha15 yurirocha15 commented Jun 20, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • add typed Pydantic models for config, LeetCode API payloads, and persisted question data
  • move question DB storage into the solution repo under .leet2git/database.json with legacy pickle migration
  • harden handler registration, generated Python formatting, CLI errors, and authenticated import pagination
  • refresh README and CI labels for uv, Ruff, ty, and Python 3.11+

@yurirocha15

Copy link
Copy Markdown
Owner Author

@copilot Review this PR

Copilot AI commented Jun 20, 2026

Copy link
Copy Markdown

@copilot Review this PR

I reviewed the PR and found one blocking issue: LeetcodeClient no longer exposes get_latest_submission / async_get_latest_submission, which is a public API break on main (src/leet2git/leetcode_client.py). I’d request changes to restore compatibility (or add a deprecation shim) before approving.

@yurirocha15

Copy link
Copy Markdown
Owner Author

Addressed the compatibility issue.

get_latest_submission and async_get_latest_submission are restored. They now use the typed problem-list + submissions-history APIs instead of the Cloudflare-blocked /submissions/latest/ endpoint. Added tests for the success and missing-history paths.

Validation: make format, make lint, make utest, make build.

@yurirocha15

Copy link
Copy Markdown
Owner Author

@copilot review again.

Copilot AI commented Jun 20, 2026

Copy link
Copy Markdown

@copilot review again.

Re-reviewed. The previous blocking concern is fully addressed — get_latest_submission / async_get_latest_submission are restored (commit 6a8174e) with a clean implementation that paginates the submission history API instead of the Cloudflare-blocked /submissions/latest/ endpoint. Five new tests cover the happy path, pagination, and all error branches.

Broader review findings:

  • No blocking issues.
  • Pydantic typed models for config, API payloads, and question DB are well-structured.
  • QuestionDB JSON-first storage with one-way pickle migration is correct.
  • _request_json error handling covers HTTP errors, network errors, and non-JSON responses.
  • import_all pagination with last_key / offset is consistent with the new SubmissionListResponse model.
  • DefaultHandler and PythonHandler correctly accept AppConfig instead of Dict[str, Any].
  • handler_registry.py is a clean replacement for the old subclass discovery.
  • CI is green across all workflow runs.

Approved.

@yurirocha15
yurirocha15 merged commit 82145ff into main Jun 20, 2026
5 checks passed
@yurirocha15
yurirocha15 deleted the refactor/modernize-code branch June 20, 2026 12:47
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.

2 participants