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
1 change: 1 addition & 0 deletions .github-templates/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @siddhss5
13 changes: 13 additions & 0 deletions .github-templates/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Code of Conduct

This project adopts the [Contributor Covenant, version 2.1][cc].

The full text is available at <https://www.contributor-covenant.org/version/2/1/code_of_conduct/>.

## Reporting

Instances of unacceptable behavior may be reported privately to the project
maintainer at **siddhartha.srinivasa@gmail.com**. All reports will be
reviewed and investigated promptly and fairly.

[cc]: https://www.contributor-covenant.org/version/2/1/code_of_conduct/
50 changes: 50 additions & 0 deletions .github-templates/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Contributing

This repository is part of the [robot-code workspace](https://github.com/personalrobotics/robot-code).
All projects in the workspace share a common layout (`src/` + `tests/`), a single
package manager (`uv`), and a common CI setup.

## Development setup

```bash
git clone https://github.com/personalrobotics/robot-code
cd robot-code
./setup.sh
```

This clones every sibling repo (including this one) into a single uv workspace
and runs `uv sync`. You can then work in any sibling's directory.

## Running tests and linters

From inside this repo:

```bash
uv run pytest tests/ -v
uv run ruff check .
uv run ruff format --check .
```

From the workspace root, you can also run the cross-repo integration suite:

```bash
uv run pytest tests/integration -v
```

## Pull requests

- Branch from `main`. Open a PR with a clear summary and test plan.
- Per-repo CI (ruff + pytest) must pass.
- Cross-repo integration CI in robot-code runs automatically when this repo's
`main` advances, and on scheduled nightly runs.
- Review is by [@siddhss5](https://github.com/siddhss5) (enforced via CODEOWNERS).

## Package manager: uv only

We use [uv](https://docs.astral.sh/uv/) exclusively. **Do not use pip.**
The workspace layout in robot-code relies on uv's workspace resolution.

## License

By contributing, you agree that your contributions will be licensed under the
MIT License (see [LICENSE](LICENSE)).
22 changes: 22 additions & 0 deletions .github-templates/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: Bug report
about: Report a reproducible bug
labels: bug
---

## Environment
- OS:
- Python version:
- uv version:
- Package version or commit:

## Reproduction
<!-- Minimal steps to reproduce the problem. -->

## Expected behavior

## Actual behavior

## Logs / traceback
```
```
5 changes: 5 additions & 0 deletions .github-templates/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Questions and discussion
url: https://github.com/personalrobotics/robot-code/discussions
about: Ask questions or discuss design in the umbrella repo.
13 changes: 13 additions & 0 deletions .github-templates/ISSUE_TEMPLATE/improvement.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
name: Improvement
about: Propose an enhancement to existing functionality
labels: enhancement
---

## Motivation
<!-- What problem or limitation prompts this improvement? -->

## Proposal
<!-- What should change, concretely? -->

## Alternatives considered
12 changes: 12 additions & 0 deletions .github-templates/ISSUE_TEMPLATE/task.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: Task
about: A planned unit of work
labels: task
---

## Goal

## Acceptance criteria
- [ ]

## Notes
21 changes: 21 additions & 0 deletions .github-templates/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2025 Siddhartha Srinivasa <siddhartha.srinivasa@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
7 changes: 7 additions & 0 deletions .github-templates/SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Security Policy

If you discover a security vulnerability in this project, please report it
privately to **siddhartha.srinivasa@gmail.com**.

Please do not open a public issue for security reports. You can expect an
initial response within a few business days.
20 changes: 20 additions & 0 deletions .github-templates/branch-protection.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"required_status_checks": {
"strict": true,
"contexts": ["test (3.10)", "test (3.11)", "test (3.12)"]
},
"enforce_admins": false,
"required_pull_request_reviews": {
"dismiss_stale_reviews": true,
"require_code_owner_reviews": true,
"required_approving_review_count": 1,
"require_last_push_approval": false
},
"restrictions": null,
"required_linear_history": true,
"allow_force_pushes": false,
"allow_deletions": false,
"required_conversation_resolution": true,
"lock_branch": false,
"allow_fork_syncing": true
}
24 changes: 24 additions & 0 deletions .github-templates/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## Summary

<!-- One or two sentences describing what this PR does and why. -->

## Changes

<!-- Bulleted list of the concrete changes made. -->
-

## Testing

- [ ] `uv run pytest tests/ -v` passes
- [ ] `uv run ruff check .` passes
- [ ] `uv run ruff format --check .` passes
- [ ] Integration tested locally against the robot-code workspace (if cross-repo)

## Breaking changes

- [ ] None
- [ ] Yes (describe migration below):

## Related issues

<!-- e.g. Fixes #123, Part of personalrobotics/robot-code#3 -->
58 changes: 58 additions & 0 deletions .github-templates/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4

- name: Set up uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: uv sync --all-extras --dev

- name: Ruff lint
run: uv run ruff check .

- name: Ruff format check
run: uv run ruff format --check .

- name: Pytest
run: |
if [ -d tests ]; then
uv run pytest tests/ -v
else
echo "No tests/ directory; skipping pytest."
fi

notify-robot-code:
needs: test
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Dispatch integration run
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.ROBOT_CODE_DISPATCH_TOKEN }}
repository: personalrobotics/robot-code
event-type: sibling-updated
client-payload: '{"repo":"${{ github.event.repository.name }}","sha":"${{ github.sha }}"}'
107 changes: 107 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: Workspace Integration

on:
pull_request:
branches: [main]
schedule:
# 08:00 UTC nightly
- cron: "0 8 * * *"
workflow_dispatch:
inputs:
override_repo:
description: "Sibling repo name to pin to a specific sha (optional)"
required: false
override_sha:
description: "Commit sha for the override_repo (optional)"
required: false
repository_dispatch:
types: [sibling-updated]

concurrency:
group: integration-${{ github.ref }}
cancel-in-progress: false

jobs:
integration:
runs-on: ubuntu-latest
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.12"]
steps:
- name: Checkout robot-code
uses: actions/checkout@v4

- name: Set up uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
python-version: ${{ matrix.python-version }}

- name: Bootstrap siblings
env:
# While any sibling repo is still private, setup.sh needs auth to clone.
# Once all repos are public, GH_TOKEN can be removed.
GH_TOKEN: ${{ secrets.SIBLING_CHECKOUT_TOKEN || secrets.GITHUB_TOKEN }}
run: |
# Configure git to use the token for personalrobotics clones.
git config --global url."https://x-access-token:${GH_TOKEN}@github.com/personalrobotics/".insteadOf "https://github.com/personalrobotics/"
./setup.sh

- name: Override sibling at specific sha (dispatch)
if: github.event_name == 'repository_dispatch'
working-directory: ${{ github.event.client_payload.repo }}
run: |
git fetch origin "${{ github.event.client_payload.sha }}"
git checkout "${{ github.event.client_payload.sha }}"

- name: Override sibling at specific sha (manual)
if: github.event_name == 'workflow_dispatch' && inputs.override_repo != ''
working-directory: ${{ inputs.override_repo }}
run: |
git fetch origin "${{ inputs.override_sha }}"
git checkout "${{ inputs.override_sha }}"

- name: Re-sync after override
if: github.event_name == 'repository_dispatch' || (github.event_name == 'workflow_dispatch' && inputs.override_repo != '')
run: uv sync

- name: Per-sibling unit tests
run: |
set +e
fail=0
for d in asset_manager geodude geodude_assets mj_environment mj_manipulator mj_viser prl_assets pycbirrt tsr; do
if [ -d "$d/tests" ]; then
echo "::group::$d tests"
(cd "$d" && uv run pytest tests/ -q) || fail=1
echo "::endgroup::"
fi
done
exit $fail

- name: Cross-repo integration tests
run: uv run pytest tests/integration -v

- name: Import smoke check
run: |
uv run python -c "import asset_manager, geodude, geodude_assets, mj_environment, mj_manipulator, mj_viser, prl_assets, pycbirrt, tsr; print('all imports OK')"

notify-on-nightly-failure:
needs: integration
if: failure() && github.event_name == 'schedule'
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- uses: actions/github-script@v7
with:
script: |
const runUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`;
await github.rest.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: `Nightly integration failed (run ${context.runId})`,
body: `Nightly workspace-integration run failed.\n\nSee: ${runUrl}`,
labels: ["ci", "nightly-fail"],
});
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ pr_assets/
*.txt
*.md.bak
# Explicitly tracked: CLAUDE.md, README.md, GEODUDE_DESIGN.md
!scripts/*.py
!tests/**/*.py
*.zip
*.jpg
*.png
Expand Down
Loading
Loading