From f6cd009c77a560a87e31d8918bab0f08c567cc1c Mon Sep 17 00:00:00 2001 From: Justin Newberry Date: Wed, 17 Jan 2024 13:36:47 -0500 Subject: [PATCH] Update PR templates + autogenerate (#31032) * update templates * same as before * no tuning * same as before * move up --- .github/PULL_REQUEST_TEMPLATE/car_port.md | 2 +- .github/PULL_REQUEST_TEMPLATE/fingerprint.md | 6 ++-- .github/PULL_REQUEST_TEMPLATE/tuning.md | 3 +- .github/build.py | 30 ++++++++++++++++ .github/pull_request_template.md | 38 +++++++++++++++----- 5 files changed, 65 insertions(+), 14 deletions(-) create mode 100644 .github/build.py diff --git a/.github/PULL_REQUEST_TEMPLATE/car_port.md b/.github/PULL_REQUEST_TEMPLATE/car_port.md index 4264363ba2..690c24c9b0 100644 --- a/.github/PULL_REQUEST_TEMPLATE/car_port.md +++ b/.github/PULL_REQUEST_TEMPLATE/car_port.md @@ -8,7 +8,7 @@ assignees: '' **Checklist** -- [ ] added to README +- [ ] added entry to CarInfo in selfdrive/car/*/values.py and ran `selfdrive/car/docs.py` to generate new docs - [ ] test route added to [routes.py](https://github.com/commaai/openpilot/blob/master/selfdrive/car/tests/routes.py) - [ ] route with openpilot: - [ ] route with stock system: diff --git a/.github/PULL_REQUEST_TEMPLATE/fingerprint.md b/.github/PULL_REQUEST_TEMPLATE/fingerprint.md index 466d4f98f4..b94f7dc53f 100644 --- a/.github/PULL_REQUEST_TEMPLATE/fingerprint.md +++ b/.github/PULL_REQUEST_TEMPLATE/fingerprint.md @@ -6,6 +6,8 @@ labels: 'fingerprint' assignees: '' --- -Discord username: [] +**Car** +Which car (make, model, year) this fingerprint is for -Route: [] +**Route** +A route with the fingerprint \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE/tuning.md b/.github/PULL_REQUEST_TEMPLATE/tuning.md index 05e4312699..4397e5ad20 100644 --- a/.github/PULL_REQUEST_TEMPLATE/tuning.md +++ b/.github/PULL_REQUEST_TEMPLATE/tuning.md @@ -28,5 +28,4 @@ Longitudinal: Lateral: * Straight driving at ~25, ~45 and ~65mph * Turns driving at ~25, ~45 and ~65mph - ---> +--> \ No newline at end of file diff --git a/.github/build.py b/.github/build.py new file mode 100644 index 0000000000..e141ea05df --- /dev/null +++ b/.github/build.py @@ -0,0 +1,30 @@ +import pathlib + +GITHUB_FOLDER = pathlib.Path(__file__).parent + +PULL_REQUEST_TEMPLATES = (GITHUB_FOLDER / "PULL_REQUEST_TEMPLATE") + +order = ["fingerprint", "car_bugfix", "bugfix", "car_port", "refactor"] + +def create_pull_request_template(): + with open(GITHUB_FOLDER / "pull_request_template.md", "w") as f: + f.write("\n\n") + + for t in order: + template = PULL_REQUEST_TEMPLATES / f"{t}.md" + text = template.read_text() + + # Remove metadata for GitHub + start = text.find("---") + end = text.find("---", start+1) + text = text[end + 4:] + + # Remove comments + text = text.replace("", "") + + f.write(f"\n\n") + +create_pull_request_template() diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 6fbccfbdbb..3e3f42dcbc 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -10,39 +10,59 @@ A route with the fingerprint --> - - - +