Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
marc-hanheide committed Sep 6, 2023
2 parents 103f13e + ce07f8e commit fefd4e5
Show file tree
Hide file tree
Showing 17 changed files with 703 additions and 254 deletions.
13 changes: 7 additions & 6 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
---
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
# only notify on security updates and not version updates.
open-pull-requests-limit: 0
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
# only notify on security updates and not version updates.
open-pull-requests-limit: 0
43 changes: 22 additions & 21 deletions .github/labeler-config.yaml
Original file line number Diff line number Diff line change
@@ -1,38 +1,39 @@
---
# Add 'noetic' label if any files in noetic/ folder are changed by a PR
noetic:
- noetic/*
- noetic/*

# Add 'humble' label if any files in humble/ folder are changed by a PR
humble:
- humble/*
- humble/*

# Add 'iron' label if any files in iron/ folder are changed by a PR
iron:
- iron/*
- iron/*

# Add 'rolling' label if any files in rolling/ folder are changed by a PR
rolling:
- rolling/*
- rolling/*

# Add 'rosdep' label if any files in rosdep/ folder are changed by a PR
rosdep:
- rosdep/*
- rosdep/*

# Add 'end-of-life' label if any files are in folders for versions that are no longer supported
end-of-life:
# ROS 1
- groovy/*
- hydro/*
- indigo/*
- jade/*
- kinetic/*
- lunar/*
- melodic/*
# ROS 2
- ardent/*
- bouncy/*
- crystal/*
- dashing/*
- eloquent/*
- foxy/*
- galactic/*
# ROS 1
- groovy/*
- hydro/*
- indigo/*
- jade/*
- kinetic/*
- lunar/*
- melodic/*
# ROS 2
- ardent/*
- bouncy/*
- crystal/*
- dashing/*
- eloquent/*
- foxy/*
- galactic/*
48 changes: 26 additions & 22 deletions .github/mergify.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
---
pull_request_rules:
- name: Comment on PRs with an end-of-life label
conditions:
- label=end-of-life
actions:
comment:
message: This pull request changes files for a ROS distribution that is no longer supported (End Of Life) and the distribution will not have any future syncs to include this change.
- name: Close on changes only to EOL folders
conditions:
- and:
- label=end-of-life
# Active ROS 1 distros
- label!=melodic
- label!=noetic
# Active ROS 2 distros
- label!=foxy
- label!=galactic
- label!=humble
- label!=rolling
# Other labels
- label!=rosdep
actions:
close:
- name: Comment on PRs with an end-of-life label
conditions:
- label=end-of-life
actions:
comment:
message: >
This pull request changes files for a ROS distribution
that is no longer supported (End Of Life)
and the distribution will not have any future syncs to include this change.
- name: Close on changes only to EOL folders
conditions:
- and:
- label=end-of-life
# Active ROS 1 distros
- label!=melodic
- label!=noetic
# Active ROS 2 distros
- label!=foxy
- label!=galactic
- label!=humble
- label!=rolling
# Other labels
- label!=rosdep
actions:
close:
2 changes: 2 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ More info at https://github.com/ros/rosdistro/blob/master/CONTRIBUTING.md#guidel
- OPTIONAL
- openSUSE: https://software.opensuse.org/package/
- IF AVAILABLE
- rhel: https://rhel.pkgs.org/
- IF AVAILABLE

<!-- DOC_INDEX_TEMPLATE: add package to rosdistro for documentation indexing -->

Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/build_test.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
name: Validate rosdistro
on:
# this is fine since gha runs with yaml 1.2
on: # yamllint disable-line rule:truthy
push:
branches: ['master']
pull_request:
Expand Down Expand Up @@ -47,4 +49,4 @@ jobs:
python -m pip install --upgrade pip setuptools wheel
pip install yamllint
- name: Run yamllint
run: yamllint */
run: yamllint .
4 changes: 3 additions & 1 deletion .github/workflows/labeler.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
name: "Pull Request Labeler"
on:
# this is fine since gha runs with yaml 1.2
on: # yamllint disable-line rule:truthy
- pull_request_target

permissions:
Expand Down
32 changes: 21 additions & 11 deletions .github/workflows/stale_labeler.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,29 @@
---
name: 'Label inactive PRs as stale'

on:
# this is fine since gha runs with yaml 1.2
on: # yamllint disable-line rule:truthy
schedule:
- cron: '0 11 * * *' # runs at 11am UTC every day => early morning in US
- cron: '0 11 * * *' # runs at 11am UTC every day => early morning in US

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v8 # https://github.com/marketplace/actions/close-stale-issues
with:
stale-pr-label: 'stale'
stale-pr-message: "This PR hasn't been activity in 14 days. If you are still are interested in getting it merged please provide an update. Otherwise it will likely be closed by a rosdistro maintainer following our [contributing policy](https://github.com/ros/rosdistro/blob/master/CONTRIBUTING.md). It's been labeled \"stale\" for visibility to the maintainers. If this label isn't appropriate, you can ask a maintainer to remove the label and add the 'persistent' label."
days-before-pr-stale: 14
days-before-pr-close: -1 # don't close PRs automatically
days-before-issue-stale: -1 # don't label issues as stale
days-before-issue-close: -1 # don't close issues automatically
exempt-pr-labels: 'persistent'
- uses: actions/stale@v8 # https://github.com/marketplace/actions/close-stale-issues
with:
stale-pr-label: 'stale'
stale-pr-message: >
This PR hasn't been activity in 14 days.
If you are still are interested in getting it merged
please provide an update.
Otherwise it will likely be closed by a rosdistro maintainer
following our [contributing policy](https://github.com/ros/rosdistro/blob/master/CONTRIBUTING.md).
It's been labeled "stale" for visibility to the maintainers.
If this label isn't appropriate,
you can ask a maintainer to remove the label and add the 'persistent' label.
days-before-pr-stale: 14
days-before-pr-close: -1 # don't close PRs automatically
days-before-issue-stale: -1 # don't label issues as stale
days-before-issue-close: -1 # don't close issues automatically
exempt-pr-labels: 'persistent'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*~
.DS_STORE
*.pyc
.venv/*
8 changes: 6 additions & 2 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
extends:
default

Expand All @@ -8,10 +9,13 @@ rules:
rosdep/*.yaml
indentation:
spaces: consistent
indent-sequences: no
indent-sequences: false
key-duplicates: enable
line-length:
max: 125
allow-non-breakable-words: yes
allow-non-breakable-words: true
ignore: |
rosdep/*.yaml

ignore: |
.venv
44 changes: 20 additions & 24 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -297,31 +297,27 @@ How to submit pull requests
When submitting pull requests it is expected that they pass the unit tests for formatting.
The unit tests enforce alphabetization of elements and a consistent formatting to keep merging as clean as possible.

If you want to run the tests before submitting, first install the dependencies. Using `pip` is recommended.
### Unit Testing

```bash
python3 -m pip install -r test/requirements.txt
```
It is recommended to use a virtual environment and pip to install the unit test dependencies.
The test dependencies are listed in tests/requirements.txt.

To run the tests run ``pytest -s test`` in the root of the repository.
These tests require several dependencies that can be installed either from the ROS repositories or via pip (list built based on the content of [test/requirements.txt](https://github.com/ros/rosdistro/blob/master/test/requirements.txt):

| Dependency | Ubuntu package (<=22.04)| Pip package |
| :------------: | --------------------------------- | -------------- |
| catkin_pkg | python3-catkin-pkg | catkin-pkg |
| github | python3-github | PyGithub |
| pytest | python3-pytest | pytest |
| yaml | python3-yaml | PyYAML |
| rosdep | python3-rosdep | rosdep |
| rosdistro | python3-rosdistro | rosdistro |
| ros_buildfarm | python3-ros-buildfarm | ros-buildfarm |
| unidiff | python3-unidiff (Zesty and higher) | unidiff |
| yamllint | yamllint | yamllint |

There is a tool [scripts/check_rosdep](./scripts/check_rosdep.py) which will check most formatting errors such as alphabetization and correct formatting.
It is recommended to run it before submitting your contribution.

For example, to check a change to `rosdep/base.yaml`:
```bash
python3 scripts/check_rosdep.py rosdep/base.yaml
# create the virtual environment
python3 -m venv .venv
# "activate" the virtual environment
# this will let pip install dependencies into the virtual environment
# use activate.zsh if you use zsh, activate.fish if you use fish, etc.
source .venv/bin/activate
# install the dependencies
pip3 install -r test/requirements.txt
# run the tests!
pytest
```

It is highly recommended to run the unit tests before submitting a pull request.
(the CI system will run them anyways, but it will save you time)

Loading

0 comments on commit fefd4e5

Please sign in to comment.