Skip to content

Commit

Permalink
[Contributions] Add reviewers statistics (#204)
Browse files Browse the repository at this point in the history
(cherry picked from commit 5e1f1d6)

# Conflicts:
#	.github/workflows/sphinx-check-warnings-humble.yml
#	.github/workflows/sphinx-check-warnings-iron.yml
#	.github/workflows/sphinx-make-page.yml
  • Loading branch information
christophfroehlich authored and mergify[bot] committed Dec 13, 2023
1 parent 5600398 commit 667650a
Show file tree
Hide file tree
Showing 18 changed files with 898 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .github/workflows/ci-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Restore stats
uses: actions/cache/restore@v3
with:
key: reviewer-stats-${{ github.run_id }}
restore-keys: |
reviewer-stats
path: ~/reviews
- name: Copy stats
run: ./make_help_scripts/add_review_stats
- uses: pre-commit/[email protected]
with:
extra_args: --all-files --hook-stage manual
45 changes: 45 additions & 0 deletions .github/workflows/reviewer-stats.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: "Create Reviewer Stats"

on:
workflow_dispatch:
pull_request: # run if the file changed on a PR to master
branches:
- master
paths:
- 'make_help_scripts/create_reviewer_stats.py'
push: # run if the file changed by pushes to master
branches:
- master
paths:
- 'make_help_scripts/create_reviewer_stats.py'
schedule:
# Run every morning to ensure component documentation is up to date on deployment
- cron: '23 3 * * *'

jobs:
create-reviewer-stats:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip'
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade --requirement requirements.txt
shell: bash
- name: Get stats
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
python make_help_scripts/create_reviewer_stats.py
shell: bash
- name: Cache stats
uses: actions/cache/save@v3
with:
key: reviewer-stats-${{ github.run_id }}
path: ~/reviews
7 changes: 7 additions & 0 deletions .github/workflows/sphinx-check-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ jobs:
shell: bash
- name: Install doxygen and graphviz
run: sudo apt-get install -y doxygen graphviz
- name: Restore stats
uses: actions/cache/restore@v3
with:
key: reviewer-stats-${{ github.run_id }}
restore-keys: |
reviewer-stats
path: ~/reviews
- name: Build page with API and run linkchecker
run: |
git config --local user.email "[email protected]"
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/sphinx-check-warnings-humble.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: "Check Page for Warnings Humble"
on:
workflow_dispatch:
push:
branches:
- humble
schedule:
# Run every morning to ensure component documentation is up to date on deployment
- cron: '23 5 * * *'

jobs:
build-halt-on-warnings:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: humble
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade --requirement requirements.txt
shell: bash
- name: Install generate_parameter_library
run: |
cd
git clone https://github.com/PickNikRobotics/generate_parameter_library.git
cd generate_parameter_library/generate_parameter_library_py/
python -m pip install .
shell: bash
- name: Restore stats
uses: actions/cache/restore@v3
with:
key: reviewer-stats-${{ github.run_id }}
restore-keys: |
reviewer-stats
path: ~/reviews
- name: Build single version considering warnings as errors
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
make html-all-subrepos-with-errors
46 changes: 46 additions & 0 deletions .github/workflows/sphinx-check-warnings-iron.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: "Check Page for Warnings Iron"
on:
workflow_dispatch:
push:
branches:
- iron
schedule:
# Run every morning to ensure component documentation is up to date on deployment
- cron: '23 5 * * *'

jobs:
build-halt-on-warnings:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: iron
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade --requirement requirements.txt
shell: bash
- name: Install generate_parameter_library
run: |
cd
git clone https://github.com/PickNikRobotics/generate_parameter_library.git
cd generate_parameter_library/generate_parameter_library_py/
python -m pip install .
shell: bash
- name: Restore stats
uses: actions/cache/restore@v3
with:
key: reviewer-stats-${{ github.run_id }}
restore-keys: |
reviewer-stats
path: ~/reviews
- name: Build single version considering warnings as errors
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
make html-all-subrepos-with-errors
7 changes: 7 additions & 0 deletions .github/workflows/sphinx-check-warnings-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ jobs:
cd generate_parameter_library/generate_parameter_library_py/
python -m pip install .
shell: bash
- name: Restore stats
uses: actions/cache/restore@v3
with:
key: reviewer-stats-${{ github.run_id }}
restore-keys: |
reviewer-stats
path: ~/reviews
- name: Build single version considering warnings as errors
run: |
git config --local user.email "[email protected]"
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/sphinx-check-warnings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ jobs:
cd generate_parameter_library/generate_parameter_library_py/
python -m pip install .
shell: bash
- name: Restore stats
uses: actions/cache/restore@v3
with:
key: reviewer-stats-${{ github.run_id }}
restore-keys: |
reviewer-stats
path: ~/reviews
- name: Build single version considering warnings as errors
run: |
git config --local user.email "[email protected]"
Expand Down
60 changes: 60 additions & 0 deletions .github/workflows/sphinx-make-page.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: "Build & Deploy Page"
on:
workflow_dispatch:
push:
branches:
- master
schedule:
# Run every morning to ensure component documentation is up to date on deployment
- cron: '23 5 * * *'

jobs:
build-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade --requirement requirements.txt
shell: bash
- name: Install generate_parameter_library
run: |
cd
git clone https://github.com/PickNikRobotics/generate_parameter_library.git
cd generate_parameter_library/generate_parameter_library_py/
python -m pip install .
shell: bash
- name: Install doxygen and graphviz
run: sudo apt-get install -y doxygen graphviz
- name: Restore stats
uses: actions/cache/restore@v3
with:
key: reviewer-stats-${{ github.run_id }}
restore-keys: |
reviewer-stats
path: ~/reviews
- name: Build multiversion with API
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
make multiversion-with-api
- name: clone gh-pages branch
uses: actions/checkout@v4
if: ${{ success() && github.event_name != 'pull_request' && !env.ACT }}
with:
ref: gh-pages
path: gh-pages
- name: Deploy Pages
if: ${{ success() && github.event_name != 'pull_request' && !env.ACT }}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./_build/html
cname: control.ros.org
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ There are `make` commands available which automate the process of building and i
* ```make multiversion``` - Builds multiversion version, changes are only visible after commit. **Make sure to commit everything before running!**
* For each command, a ```make <command>-with-api``` exists, which in addition builds the `doxygen` api.

# Fetch reviewer stats
First, you need to fetch the reviewer stats from ros2_control org. To do so, you need to have a github token with the `repo` scope. Then run

```bash
export GITHUB_TOKEN=<your token>
python3 ./make_help_scripts/create_reviewer_stats.py
```
which will create `~/reviews/reviewers_stats_with_graph.html`. Then you can build the documentation as usual, it will copy the file from this folder.

# Build Instructions:
1. If you are running inside a docker container, be sure to open a port so the website can be accessed.
Expand Down
41 changes: 41 additions & 0 deletions _static/reviewer_stats.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/* reviewer_stats.css */
table {
font-family: Arial, sans-serif;
border-collapse: collapse;
width: 100%;
}

th, td {
border: 1px solid #dddddd;
text-align: left;
padding: 8px;
}

tr:nth-child(even) {
background-color: #f2f2f2;
}

.progress-bar {
width: 100%;
height: 20px;
margin: 0;
background-color: #ddd;
border-radius: 5px;
overflow: hidden;
}

.progress-value-reviews {
display: block;
height: 100%;
width: 0;
background-color: #2980b9;
border-radius: 5px;
}

.progress-value-ratio {
display: block;
height: 100%;
width: 0;
background-color: rgba(47, 64, 95, 0.5); /* Adjusted to 50% transparent */
border-radius: 5px;
}
8 changes: 7 additions & 1 deletion conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,13 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
# html_static_path = ["_static"]
html_static_path = ["_static"]

# These paths are either relative to html_static_path
# or fully qualified paths (eg. https://...)
html_css_files = [
'reviewer_stats.css',
]

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
Expand Down
43 changes: 43 additions & 0 deletions doc/acknowledgements/acknowledgements.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,49 @@

Acknowledgements
================

Maintainers
----------------
The following people were maintaining the ``ros2_control`` framework, showing their all-time review activity:

.. raw:: html
:file: maintainers_stats.html

Activity during the past 12 months:

.. raw:: html
:file: maintainers_stats_recent.html

Reviewers' Stats
----------------
The following people have contributed to the development of this project by giving valuable reviews for pull requests, see :ref:`doc/contributing/contributing:contributing` for more information.

.. raw:: html
:file: reviewers_stats.html

Activity during the past 12 months:

.. raw:: html
:file: reviewers_stats_recent.html

Contributors
----------------

The following links lists people who have contributed to the development of this project by submitting pull requests to the respective repository, see :ref:`doc/contributing/contributing:contributing` for more information.

* `ros2_control <https://github.com/ros-controls/ros2_control/graphs/contributors>`_
* `ros2_controllers <https://github.com/ros-controls/ros2_controllers/graphs/contributors>`_
* `ros2_control_demos <https://github.com/ros-controls/ros2_control_demos/graphs/contributors>`_
* `control_toolbox <https://github.com/ros-controls/control_toolbox/graphs/contributors>`_
* `gazebo_ros2_control <https://github.com/ros-controls/gazebo_ros2_control/graphs/contributors>`_
* `gz_ros2_control <https://github.com/ros-controls/gz_ros2_control/graphs/contributors>`_
* `realtime_tools <https://github.com/ros-controls/realtime_tools/graphs/contributors>`_
* `kinematics_interface <https://github.com/ros-controls/kinematics_interface/graphs/contributors>`_
* `control_msgs <https://github.com/ros-controls/control_msgs/graphs/contributors>`_


Companies and Institutions
--------------------------
The project has received major contributions from the following companies and institutions.

|palroboticslogo|
Expand Down
9 changes: 9 additions & 0 deletions make_help_scripts/add_review_stats
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

# shellckeck source=deploy_defines
# source deploy_defines regardless of startingpoint
DIR="${BASH_SOURCE%/*}"
if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi
. "$DIR/deploy_defines" || { echo "Could not source deploy_defines script. This is needed for correct execution. Exiting!"; exit; }

add_reviewer_stats_file
1 change: 1 addition & 0 deletions make_help_scripts/add_sub_repos
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ add_sub_repositories () {
}

add_sub_repositories
add_reviewer_stats_file
Loading

0 comments on commit 667650a

Please sign in to comment.