Skip to content

tools/mpy-triage: Add database layer and GitHub API wrapper#32

Draft
andrewleech wants to merge 4 commits intoreview/mpy-github-triagefrom
mpy-github-triage
Draft

tools/mpy-triage: Add database layer and GitHub API wrapper#32
andrewleech wants to merge 4 commits intoreview/mpy-github-triagefrom
mpy-github-triage

Conversation

@andrewleech
Copy link
Copy Markdown
Owner

Summary

Adds the foundational database and GitHub API modules for mpy-triage, a CLI tool for detecting duplicate/related MicroPython issues and PRs using semantic search.

  • db.py: SQLite connection management with WAL mode, schema initialization, sync state key-value store, and sqlite-vec extension loading.
  • gh.py: gh CLI wrapper with paginated response parsing (handles concatenated JSON arrays), rate-limit detection with sleep-until-reset backoff, search queries with date range filtering, and PR diff fetching.
  • Tests for both modules (27 tests total) using tmp_path fixtures and mocked subprocess calls.

Testing

uv run pytest tests/test_db.py tests/test_gh.py -v - 27 tests pass.
uv run ruff check src/ tests/ - clean.
uv run mpy-triage --help - works.

Generative AI

I used generative AI tools when creating this PR, but a human has checked the
code and is responsible for the code and the description above.

pi-anl added 4 commits March 25, 2026 06:45
Remove the VS 2017 build matrix entry and the Chocolatey installation step.
Use the v142 toolset pre-installed on windows-2022 runners for VS 2019
testing, and explicitly set PlatformToolset for both VS 2019 (v142) and
VS 2022 (v143) builds.

Pin the runner to windows-2022 for the MSVC build matrix to ensure the
v142 toolset remains available.
setup-msbuild requires a matching VS installation, not just a toolset
component.  Use VS 2022's MSBuild (vs-version [17,18)) for both v142
and v143 builds — the PlatformToolset property selects the compiler.
Implements db.py (SQLite connection, schema init, sync state, sqlite-vec
loading) and gh.py (gh CLI wrapper with pagination multiparse, rate-limit
backoff, search, and diff fetching). Includes tests for both modules.

Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
@codecov-commenter
Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.46%. Comparing base (5c00edc) to head (5284bef).
⚠️ Report is 6 commits behind head on review/mpy-github-triage.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@                    Coverage Diff                    @@
##           review/mpy-github-triage      #32   +/-   ##
=========================================================
  Coverage                     98.46%   98.46%           
=========================================================
  Files                           176      176           
  Lines                         22784    22784           
=========================================================
  Hits                          22435    22435           
  Misses                          349      349           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Copy Markdown

Code size report:

Reference:  esp32/boards/SEEED_XIAO_ESP32C6: Add new XIAO board definition. [2dc2e30]
Comparison: tools/mpy-triage: Add gitignore and remove egg-info from tracking. [merge of 5284bef]
  mpy-cross:    +0 +0.000% 
   bare-arm:    +0 +0.000% 
minimal x86:    +0 +0.000% 
   unix x64:    +0 +0.000% standard
      stm32:    +0 +0.000% PYBV10
      esp32:    +0 +0.000% ESP32_GENERIC
     mimxrt:    +0 +0.000% TEENSY40
        rp2:    +0 +0.000% RPI_PICO_W
       samd:    +0 +0.000% ADAFRUIT_ITSYBITSY_M4_EXPRESS
  qemu rv32:    +0 +0.000% VIRT_RV32

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.

3 participants