diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 00000000..0e2f86eb --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,16 @@ +# Repository Guidelines + +## Project Structure & Module Organization +The core Python package lives in `mozilla_bitbar_devicepool/`, with vendor-specific logic in `bitbar/` and `lambdatest/`. Supporting CLI entry points are defined in `pyproject.toml` and mirrored as helper scripts in `bin/`. Shared utils and report generators sit under `util/` and `device_group_report*.py`, while environment and service configuration lives in `config/` and `service/`. Tests reside in `mozilla_bitbar_devicepool/test/`, alongside fixture data in `test_data/`. + +## Build, Test, and Development Commands +Run `poetry install --with=dev` to sync dependencies, then `poetry shell` for an interactive environment. Use `pre-commit install` once per clone to enable formatting and lint hooks. Execute unit tests with `pytest` or the coverage variant `pytest --cov --cov-report=term`. CLI entry points run via `poetry run`, e.g., `poetry run mld` for LambdaTest device runs or `poetry run dgr` for Bitbar reports. + +## Coding Style & Naming Conventions +Stick to Python 3.9+ with 4-space indentation and descriptive, snake_case names for modules, functions, and variables. Formatting and imports are enforced by `ruff-format` with a 120-character line limit; structural linting runs via `ruff check --select I --fix` and `pylint` in CI/pre-commit. Configuration files use YAML or TOML—mirror existing key naming and comment styles. + +## Testing Guidelines +Place new tests in `mozilla_bitbar_devicepool/test/` following the `_test.py` pattern and reuse helpers in `util_test.py`. Prefer `pytest` fixtures over ad-hoc setup; store serialized inputs in `test_data/`. Validate coverage locally with `pytest --cov --cov-report=html` and ensure critical branches that touch vendor APIs are exercised via mocks. + +## Commit & Pull Request Guidelines +Commit messages are short (≤72 characters), lowercase, and often scoped (`lt status: refresh cache`). Group related edits per commit and reference Bugzilla or GitHub IDs when applicable. Pull requests should describe vendor impact, outline testing (`pytest`, manual device run), and include screenshots or log snippets when UI or report output changes. Link configuration updates to rollout plans so reviewers can validate credentials and scheduling. diff --git a/bin/start_mbd_new_server.sh b/bin/start_mbd_new_server.sh index cd026cf0..35478290 100755 --- a/bin/start_mbd_new_server.sh +++ b/bin/start_mbd_new_server.sh @@ -4,4 +4,4 @@ set -e set -x . ./bitbar_env-v3-server.sh -mbd start-test-run-manager -b config/config-v3-server.yml --update-bitbar +poetry run mbd start-test-run-manager -b config/config-v3-server.yml --update-bitbar diff --git a/config/lambdatest.yml b/config/lambdatest.yml index dbd8548b..15b6b563 100644 --- a/config/lambdatest.yml +++ b/config/lambdatest.yml @@ -48,7 +48,6 @@ device_groups: R5CXC1AHV4M: # 9/10/25: recabled and verified by jmaher R5CXC1ASA3P: # 9/11/25: recabled and verified by jmaher R5CXC1AP2KT: # 9/11/25: recabled and verified by jmaher - R5CXC1HZK0W: # 9/11/25: recabled and verified by jmaher R5CXC1ASA2E: # 9/11/25: recabled and verified by jmaher R5CXC1ARM0A: # 9/11/25: recabled and verified by jmaher R5CXC1AMNFY: # 9/15/25: recabled and verified by jmaher @@ -92,9 +91,10 @@ device_groups: R5CXC1AHXYD: # 10/20/25: tested by joel, power meter good R5CXC1ARZDN: # 10/20/25: tested by joel, power meter good R5CXC1HZA6V: # 10/20/25: tested by joel, power meter good + RZCY10LGB6W: # 2/23/26: had bad rotation, rotation code landed on master + RZCY2011M7N: # 2/23/26: had bad rotation, rotation code landed on master a55-alpha: - RZCY2011M7N: # 11/6/25: bad rotation, testing in alpha - RZCY10LGB6W: # 11/6/25: bad rotation, testing in alpha + R5CXC1HZK0W: # now on android 15, move to alpha for testing a55-android16: R5CXC1ASA0L: # 12/1/25: lt is attempting to upgrade to android 16, had bad power meter RZCY203N75Z: # 12/1/25: lt is attempting to upgrade to android 16, had bad power meter diff --git a/mozilla_bitbar_devicepool/configuration_device_mover.py b/mozilla_bitbar_devicepool/configuration_device_mover.py index 6f759945..a5ef6ecb 100644 --- a/mozilla_bitbar_devicepool/configuration_device_mover.py +++ b/mozilla_bitbar_devicepool/configuration_device_mover.py @@ -162,7 +162,7 @@ def move_devices_from_any_pool( # Initialize target group if it's None/empty if device_groups[target_group] is None: - device_groups[target_group] = {} + device_groups[target_group] = CommentedMap() # Track results results = {"moved": [], "not_found": [], "already_in_target": [], "errors": []} diff --git a/service/bitbar.service b/service/bitbar.service index 62e14dd1..c2cdbc58 100644 --- a/service/bitbar.service +++ b/service/bitbar.service @@ -1,5 +1,7 @@ [Unit] Description=Bitbar Testrun manager service +# retry forever, no rate limiting +StartLimitBurst=0 [Service] Type=simple @@ -7,6 +9,7 @@ ExecStart=/bin/bash /home/bitbar/mozilla-bitbar-devicepool/bin/start_android_har # disable execstop, let systemd track the pid and manage shutdown #ExecStop=/bin/bash /home/bitbar/mozilla-bitbar-devicepool/bin/stop_android_hardware_testing.sh Restart=always +RestartSec=30s # address intermittent hangs by restarting hourly (mega-punt), haven't been able to find deadlocks/source. RuntimeMaxSec=1h WorkingDirectory=/home/bitbar/mozilla-bitbar-devicepool diff --git a/service/lambdatest.service b/service/lambdatest.service index 8a7fb33a..aa0c87a3 100644 --- a/service/lambdatest.service +++ b/service/lambdatest.service @@ -1,5 +1,7 @@ [Unit] Description=Lambdatest Testrun manager service +# retry forever, no rate limiting +StartLimitBurst=0 [Service] Type=simple @@ -7,6 +9,7 @@ ExecStart=/bin/bash /home/bitbar/mozilla-bitbar-devicepool/bin/start_ltdp.sh # disable execstop, let systemd track the pid and manage shutdown #ExecStop=/bin/bash /home/bitbar/mozilla-bitbar-devicepool/bin/stop_ltdp.sh Restart=always +RestartSec=30s # restart process 24 hours to avoid any funk building up # - disabled to find long-term bugs #RuntimeMaxSec=24h