Skip to content
Open
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
16 changes: 16 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -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 `<module>_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.
2 changes: 1 addition & 1 deletion bin/start_mbd_new_server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 3 additions & 3 deletions config/lambdatest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion mozilla_bitbar_devicepool/configuration_device_mover.py
Original file line number Diff line number Diff line change
Expand Up @@ -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": []}
Expand Down
3 changes: 3 additions & 0 deletions service/bitbar.service
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
[Unit]
Description=Bitbar Testrun manager service
# retry forever, no rate limiting
StartLimitBurst=0

[Service]
Type=simple
ExecStart=/bin/bash /home/bitbar/mozilla-bitbar-devicepool/bin/start_android_hardware_testing.sh
# 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
Expand Down
3 changes: 3 additions & 0 deletions service/lambdatest.service
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
[Unit]
Description=Lambdatest Testrun manager service
# retry forever, no rate limiting
StartLimitBurst=0

[Service]
Type=simple
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
Expand Down