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
220 changes: 220 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,220 @@
# File-based auto-labeling configuration
# Works with actions/labeler@v5
# This complements auto-tag.yml (title-based labeling) by detecting which files changed

# =============================================================================
# Environment Sub-Labels (trigger specific tests in test-linux-libs.yml)
# =============================================================================
"Environments/brax":
- changed-files:
- any-glob-to-any-file: ['torchrl/envs/libs/brax.py']

"Environments/dm_control":
- changed-files:
- any-glob-to-any-file: ['torchrl/envs/libs/dm_control.py']

"Environments/envpool":
- changed-files:
- any-glob-to-any-file: ['torchrl/envs/libs/envpool.py']

"Environments/gym":
- changed-files:
- any-glob-to-any-file: ['torchrl/envs/libs/gym.py', 'torchrl/envs/libs/_gym_utils.py']

"Environments/habitat":
- changed-files:
- any-glob-to-any-file: ['torchrl/envs/libs/habitat.py']

"Environments/isaaclab":
- changed-files:
- any-glob-to-any-file: ['torchrl/envs/libs/isaac_lab.py', 'torchrl/envs/libs/isaacgym.py']

"Environments/jumanji":
- changed-files:
- any-glob-to-any-file: ['torchrl/envs/libs/jumanji.py']

"Environments/meltingpot":
- changed-files:
- any-glob-to-any-file: ['torchrl/envs/libs/meltingpot.py']

"Environments/open_spiel":
- changed-files:
- any-glob-to-any-file: ['torchrl/envs/libs/openspiel.py']

"Environments/pettingzoo":
- changed-files:
- any-glob-to-any-file: ['torchrl/envs/libs/pettingzoo.py']

"Environments/procgen":
- changed-files:
- any-glob-to-any-file: ['torchrl/envs/libs/procgen.py']

"Environments/robohive":
- changed-files:
- any-glob-to-any-file: ['torchrl/envs/libs/robohive.py']

"Environments/smacv2":
- changed-files:
- any-glob-to-any-file: ['torchrl/envs/libs/smacv2.py']

"Environments/unity_mlagents":
- changed-files:
- any-glob-to-any-file: ['torchrl/envs/libs/unity_mlagents.py']

"Environments/vmas":
- changed-files:
- any-glob-to-any-file: ['torchrl/envs/libs/vmas.py']

"Environments/chess":
- changed-files:
- any-glob-to-any-file: ['torchrl/envs/custom/chess.py']

# Parent Environments label (any env lib change)
"Environments":
- changed-files:
- any-glob-to-any-file:
- 'torchrl/envs/libs/**'
- 'test/test_libs.py'

# =============================================================================
# Data Sub-Labels (trigger specific tests in test-linux-libs.yml)
# =============================================================================
"Data/gendgrl":
- changed-files:
- any-glob-to-any-file: ['torchrl/data/datasets/gen_dgrl.py']

"Data/minari":
- changed-files:
- any-glob-to-any-file: ['torchrl/data/datasets/minari_data.py']

"Data/openx":
- changed-files:
- any-glob-to-any-file: ['torchrl/data/datasets/openx.py']

"Data/roboset":
- changed-files:
- any-glob-to-any-file: ['torchrl/data/datasets/roboset.py']

"Data/vd4rl":
- changed-files:
- any-glob-to-any-file: ['torchrl/data/datasets/vd4rl.py']

# Parent Data label
"Data":
- changed-files:
- any-glob-to-any-file:
- 'torchrl/data/datasets/**'

# =============================================================================
# LLM (triggers test-linux-llm.yml)
# =============================================================================
"llm/":
- changed-files:
- any-glob-to-any-file:
- 'torchrl/envs/llm/**'
- 'torchrl/objectives/llm/**'
- 'torchrl/data/llm/**'
- 'torchrl/weight_update/llm/**'
- 'torchrl/modules/llm/**'
- 'torchrl/collectors/llm/**'
- 'test/llm/**'

# =============================================================================
# Core Module Labels (informational, core tests always run)
# =============================================================================
"Collectors":
- changed-files:
- any-glob-to-any-file:
- 'torchrl/collectors/**'
- 'test/test_collectors.py'

"Objectives":
- changed-files:
- any-glob-to-any-file:
- 'torchrl/objectives/**'
- 'test/test_objectives.py'

"Modules":
- changed-files:
- any-glob-to-any-file:
- 'torchrl/modules/**'
- 'test/test_modules.py'
- 'test/test_tensordictmodules.py'
- 'test/test_actors.py'

"Transforms":
- changed-files:
- any-glob-to-any-file:
- 'torchrl/envs/transforms/**'
- 'test/test_transforms.py'

"Trainers":
- changed-files:
- any-glob-to-any-file:
- 'torchrl/trainers/**'
- 'test/test_trainer.py'

"Record":
- changed-files:
- any-glob-to-any-file:
- 'torchrl/record/**'
- 'test/test_loggers.py'

"WeightUpdate":
- changed-files:
- any-glob-to-any-file:
- 'torchrl/weight_update/**'

"ReplayBuffers":
- changed-files:
- any-glob-to-any-file:
- 'torchrl/data/replay_buffers/**'
- 'test/test_rb.py'
- 'test/test_storage_map.py'

"Services":
- changed-files:
- any-glob-to-any-file:
- 'torchrl/services/**'
- 'test/services/**'

"distributions":
- changed-files:
- any-glob-to-any-file:
- 'torchrl/modules/distributions/**'
- 'test/test_distributions.py'

# =============================================================================
# Documentation & CI
# =============================================================================
"Documentation":
- changed-files:
- any-glob-to-any-file:
- 'docs/**'
- '*.md'
- '*.rst'

"CI":
- changed-files:
- any-glob-to-any-file:
- '.github/**'

"sota-implementations/":
- changed-files:
- any-glob-to-any-file:
- 'sota-implementations/**'

"tutorials/":
- changed-files:
- any-glob-to-any-file:
- 'tutorials/**'

"Examples":
- changed-files:
- any-glob-to-any-file:
- 'examples/**'

"Benchmarks":
- changed-files:
- any-glob-to-any-file:
- 'benchmarks/**'
62 changes: 62 additions & 0 deletions .github/labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,22 @@
description: "Triggers chess environment tests only"
color: "0E8A16"

- name: Environments/dm_control
description: "Triggers dm_control environment tests"
color: "0E8A16"

- name: Environments/envpool
description: "Triggers envpool environment tests only"
color: "0E8A16"

- name: Environments/gym
description: "Triggers gym environment tests only"
color: "0E8A16"

- name: Environments/habitat
description: "Triggers habitat environment tests"
color: "0E8A16"

- name: Environments/isaaclab
description: "Triggers Isaac Lab environment tests only"
color: "0E8A16"
Expand Down Expand Up @@ -164,6 +176,10 @@
description: "Triggers robohive environment tests only"
color: "0E8A16"

- name: Environments/sklearn
description: "Triggers sklearn tests only"
color: "0E8A16"

- name: Environments/smacv2
description: "Triggers smacv2 environment tests only"
color: "0E8A16"
Expand Down Expand Up @@ -230,3 +246,49 @@
- name: benchmarks/upload
description: "Upload results of the PR to benchmarks"
color: "5319E7"

# =============================================================================
# TorchRL Module Component Labels
# =============================================================================
- name: Objectives
description: "Changes to torchrl/objectives/"
color: "1D76DB"

- name: Modules
description: "Changes to torchrl/modules/"
color: "1D76DB"

- name: Transforms
description: "Changes to torchrl/envs/transforms/"
color: "1D76DB"

- name: Record
description: "Changes to torchrl/record/"
color: "1D76DB"

- name: Trainers
description: "Changes to torchrl/trainers/"
color: "1D76DB"

- name: WeightUpdate
description: "Changes to torchrl/weight_update/"
color: "1D76DB"

- name: Services
description: "Changes to torchrl/services/"
color: "1D76DB"

- name: ReplayBuffers
description: "Changes to torchrl/data/replay_buffers/"
color: "1D76DB"

# =============================================================================
# Other Useful Labels
# =============================================================================
- name: sota-implementations/
description: "Changes to sota-implementations/"
color: "5319E7"

- name: tutorials/
description: "Changes to tutorials/"
color: "0075ca"
31 changes: 31 additions & 0 deletions .github/workflows/auto-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Automatically add labels to PRs based on which files changed
#
# This complements auto-tag.yml (title-based labeling):
# - auto-tag.yml: Labels based on PR title prefix ([BugFix], [Feature], etc.)
# - auto-labeler.yml: Labels based on which files/directories changed
#
# Together they provide complete PR categorization:
# - Title-based labels capture the INTENT (bug fix, feature, etc.)
# - File-based labels capture the SCOPE (which components changed)
#------------------------------------------------------------

name: Auto Label PR (File-Based)

on:
pull_request_target:
types: [opened, synchronize]

jobs:
label:
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: read
steps:
- name: Apply labels based on changed files
uses: actions/labeler@v5
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
# Don't remove labels that aren't in the config
# This preserves manually-added labels and title-based labels from auto-tag.yml
sync-labels: false
Loading
Loading