Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
37 changes: 37 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# AGENTS.md — MonkeyTester-Plugin-Build-Local

## Purpose
`build-local`, a MonkeyTester build plugin: it implements `BUILD_PLUGIN_API.md` (contract
`monkeytester-build-plugin`, kept in the MonkeyTester repo) and builds an app repo's branch on
its own host (Android and iOS on a Mac, Android only on Linux), then uploads the result to the
viewer. See README.md (setup, configuration, API) and SECURITY.md (threat model).

## Setup (do this first)
README.md → **Install** is the single source for dependencies. The code is Python 3.10+,
standard library only. With Nix, `nix run .` starts the plugin on :8094 and `nix run .#tests`
runs the tests.

## Tests
`nix run .#tests`, or `python3 -m unittest discover -s tests -v`. They use a fake Gitea, a fake
GitHub and a fake viewer in-process, so no real forge or viewer is contacted. Gitea and GitHub
here are product features (the code hosts the plugin builds from), not where this repo is hosted.

## Hosting and review workflow
This repo isn't tied to one code host: it can live on GitHub, Gitea/Forgejo, GitLab, Bitbucket or a
mirror. Find the host from the remote you were asked to work against (`git remote -v`, usually
`origin`) and use that host's tools; the docs never assume one.

| Remote host | Review is called | CLI |
|---|---|---|
| github.com or GitHub Enterprise | pull request | `gh pr create` |
| Gitea / Forgejo | pull request | `tea pr create` |
| GitLab | merge request | `glab mr create` |
| Bitbucket | pull request | web UI or REST API |

- `master` changes only through a reviewed PR/MR that a maintainer merges. Never push to `master`
and never merge your own PR/MR.
- Work on a feature branch in its own git worktree, based on the remote's `master`.
- CI is in `.github/workflows/`, which both GitHub Actions and Gitea Actions run. Its test job runs the same command as `nix run .#tests`; on a host without Actions, run that locally before opening the PR/MR.
- In docs, name sibling repos (e.g. MonkeyTester-Plugin-AI) instead of linking a host URL, link
files in this repo with relative paths, and stick to CommonMark plus GFM tables and code
fences (no host-only syntax such as `> [!NOTE]` callouts or `#123` autolinks).
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# MonkeyTester-Plugin-Build-Local

`build-local` is a MonkeyTester build plugin: it implements
[BUILD_PLUGIN_API.md](https://github.com/yurivibes/MonkeyTester/blob/master/BUILD_PLUGIN_API.md) (contract `monkeytester-build-plugin`,
`BUILD_PLUGIN_API.md` (contract `monkeytester-build-plugin`,
version 1, kept in the MonkeyTester repo) with builds that run **on the plugin's
own host**. The viewer's Build & Test page asks it for a repo's branches and test
cases and to build a branch; the plugin fetches the code from Gitea or GitHub with
Expand Down Expand Up @@ -38,7 +38,7 @@ log is tail-able (`GET /builds/<ref>/log?offset=` with `X-Log-Size` /
### With Nix (Linux or macOS)

```sh
git clone <the repo url> # https://github.com/yurivibes/MonkeyTester-Plugin-Build-Local.git
git clone <repo-url> MonkeyTester-Plugin-Build-Local
cd MonkeyTester-Plugin-Build-Local
nix run . # plugin on :8094
nix run .#tests # unit tests against the fake Gitea/GitHub
Expand Down Expand Up @@ -141,4 +141,4 @@ doing.

`python3 -m unittest discover -s tests -v` — fake Gitea, fake GitHub and a fake
viewer, all in-process on 127.0.0.1; a real forge or viewer is never contacted.
`.gitea/workflows/test.yml` runs the same command.
`nix run .#tests` and CI (`.github/workflows/test.yml`) run the same command.
3 changes: 1 addition & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,5 @@ To rotate: set a new `PLUGIN_TOKEN`, restart the plugin, update the viewer's Set

## Reporting a problem

Open an issue in this repo
(`https://github.com/yurivibes/MonkeyTester-Plugin-Build-Local/issues`), or tell the
Open an issue in this repository's issue tracker, or tell the
owner directly for anything that should not be written down first.
Loading