Repository navigation
Add POST /repos/<owner>/<repo>/tests (write_tests) for Gitea and GitHub - #6
Merged
Merged
Conversation
…ea and GitHub Opens a pull request adding a test recorded on the viewer's Devices page: validates case/file/content, checks the case and file on base, then creates mt-record/<case>-<stem>-<timestamp> with one commit (GitHub git data API, Gitea POST contents with new_branch) and opens a PR into base. Errors: unknown_branch, unknown_case, case_exists, file_exists, forbidden. Fake forges accept the writes; README and SECURITY.md document the route.
yurivibes
force-pushed
the
feat/record-test
branch
from
December 2, 2026 22:16
7fd16a8 to
109cfb8
Compare
yurivibes
added a commit
to yurivibes/MonkeyTester
that referenced
this pull request
Dec 2, 2026
…PR via build plugin) (#33) Devices page **Record test** (spec: vt-specs/record-test.md). - Record test section under Apps: AI plugin dropdown (the configured plugin for now), Start/Stop/Add check. - Actions sent through the remote control are recorded server-side (`recorder.py`) with a frame each. - After Stop, one batch conversion: tap → `<NAME>: CLICK …`, text → `<NAME>: INPUT <field> "<text>"`, check → `<NAME>: VERIFY …`, swipe → `SWIPE: <dir>`; verbs come from the AI plugin's `/health` `commands`. Back/Home/Recents/long-press → `#` comment + warning. Pauses > 2 s → `WAIT: <rounded 0.5 s, max 10>`. - Editable steps → project → branch → case (existing or new with INSTRUCTION.txt) → file → Open PR through the build plugin's new `POST /repos/<o>/<r>/tests` (capability `write_tests`, documented in BUILD_PLUGIN_API.md). Existing file refused. - Routes: `GET /api/record/plugins`, `GET /api/record/projects`, `POST /api/record/start`, `/api/record/<id>/check`, `/api/record/<id>/stop`, `/api/record/pr`. - Tests: `tests/test_record_test.py` (29), full suite 829 OK; AGENTS.md updated. Companion PRs (deploy these first): yurivibes/MonkeyTester-Plugin-AI#8, yurivibes/MonkeyTester-Plugin-Build-Local#6, yurivibes/MonkeyTester-Plugin-Build-GitHub#3.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the build-plugin route from the record-test spec:
POST /repos/<owner>/<repo>/tests(optional capabilitywrite_tests, contract_version stays 1), for both the Gitea and GitHub sources./healthcapabilitiesnow["logs", "cancel", "write_tests"]; same pairing-token auth.case^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$,file^[A-Za-z0-9][A-Za-z0-9_.-]{0,99}\.txt$(notINSTRUCTION.txt),contentnon-empty UTF-8 ≤ 256 KiB,instructionrequired fornew_case.base:unknown_branch(404),unknown_case(404),case_exists(409),file_exists(409); refused write →forbidden(403) carrying the forge message.mt-record/<case>-<file stem>-<yyyymmddHHMMSS>(UTC), ONE commit (message =title), PR intobase→200 {"ok", "branch", "pr_url", "pr_number"}.POST /pulls. Gitea: onePOST /contentswithnew_branch(Gitea ≥ 1.20) +POST /pulls. If the PR fails, the new branch is deleted. No local clone.api()helpers gained an optional JSONbody.tests/test_write_tests.pycovers success (existing + new case), file_exists, case_exists, unknown_case, unknown_branch, bad names/content, 401 pairing token, 403 read-only forge token, PR failure cleanup — on both forges.Tests:
python3 -m unittest discover -s tests→ 143 tests OK.