Skip to content

Commit 00d90d9

Browse files
committed
feat(all|pr_compliance): add PR validator, tests, and templates
[What] Add PR/commit compliance validator script, unit tests with 100% coverage, a reusable PR Compliance workflow, and updated PR templates (12 required sections + RU/EN guidance). Wire main workflow to depend on PR Compliance via needs. [Why] - Enforce consistent PR titles, bodies, and commit messages. - Provide clear, actionable CI feedback and stop early on non-compliance. - Ensure local/CI parity and maintainable validation with tests. [How] - .github/scripts/validate_pr.py: strict title/body/commit checks; flexible Group in title; clear EN messages with RU/EN examples; GitHub API for commits; robust output + exit codes. - tests/: add tests for title/body/commit + CLI paths; reach 100% coverage. - .github/workflows/pr-compliance.yml: split jobs (unit tests → title → body → commits) and expose as workflow_call. - .github/workflows/main.yml: add pr_compliance job and make downstream jobs depend on it via needs. - .github/*templates*: replace with 12-section skeleton and visible title/body/commit instructions. - setup.cfg: align flake8 (E203) with formatter; long lines wrapped in tests. Scope: - Task: 0 - Variant: 0 - Technology: all - Folder: pr_compliance Tests: - Local: python -m unittest -v tests/test_validate_pr.py tests/test_validate_pr_main.py - Coverage: coverage run -m unittest -v tests/test_validate_pr.py tests/test_validate_pr_main.py && coverage report -m .github/scripts/validate_pr.py (100%) - Pre-commit: pre-commit run --all-files (all hooks pass) Local runs: - Validator: GITHUB_TOKEN=<token> python .github/scripts/validate_pr.py --repo <owner>/<repo> --pr <number> --checks all --verbose
1 parent e5ccec0 commit 00d90d9

File tree

9 files changed

+1391
-82
lines changed

9 files changed

+1391
-82
lines changed
Lines changed: 76 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,76 @@
1-
<!--
2-
Pull request title requirement:
3-
4-
"<LastName> <FirstName>. Technology <TECHNOLOGY_NAME:SEQ|OMP|TBB|STL|MPI>. <Full Task Name>. Variant <Number>"
5-
-->
6-
7-
## Description
8-
<!--
9-
Please provide a detailed description of your implementation, including:
10-
- key solution details (chosen algorithm description)
11-
- parallelism technology application (if applicable)
12-
-->
13-
14-
- **Task**: _Enter the full task name here_
15-
- **Variant**: _Enter the variant number here_
16-
- **Technology**: _Enter technology (e.g., SEQ, OMP, TBB, STL, MPI)_
17-
- **Description** of your implementation and report.
18-
_Provide a concise summary of your implementation and report here._
19-
20-
---
21-
22-
## Checklist
23-
<!--
24-
Please ensure the following items are completed **before** submitting your pull request and requesting a review:
25-
-->
26-
27-
- [ ] **CI Status**: All CI jobs (build, tests, report generation) are passing on my branch in my fork
28-
- [ ] **Task Directory & Naming**: I have created a directory named `<lastName>_<firstInitial>_<short_task_name>`
29-
- [ ] **Full Task Definition**: I have provided the complete task description in the pull request body.
30-
- [ ] **clang-format**: My changes pass `clang-format` locally in my fork (no formatting errors)
31-
- [ ] **clang-tidy**: My changes pass `clang-tidy` locally in my fork (no warnings/errors)
32-
- [ ] **Functional Tests**: All functional tests are passing locally on my machine
33-
- [ ] **Performance Tests**: All performance tests are passing locally on my machine
34-
- [ ] **Branch**: I am working on a branch named exactly as my task directory (e.g., `nesterov_a_vector_sum`), not on `master`.
35-
- [ ] **Truthful Content**: I confirm that every detail provided in this pull request is accurate and truthful to the best of my knowledge.
36-
37-
<!--
38-
NOTE: Untruthful entries in this checklist may result in PR rejection and zero points for the associated task.
39-
-->
1+
PR Title (enforced by CI):
2+
- Pattern: [TASK] <Task>-<Variant>. <Last Name> <First Name> <Middle Name>. <Group>. <Task name>.
3+
- Notes: `[TASK]` is optional; <Group> can be any text; there must be a dot and a space after each block.
4+
- Example (RU): 2-12. Иванов Иван Иванович. 2341-а234. Вычисление суммы элементов вектора.
5+
- Example (EN): 2-12. Ivanov Ivan Ivanovich. 2341-a234. Vector elements sum calculation.
6+
7+
PR Body (enforced by CI):
8+
- Use the 12 sections below exactly as titled; do not include HTML comments.
9+
- After each label line (e.g., `Assignment:`), provide non-empty text.
10+
11+
Commit Messages (enforced by CI):
12+
- Subject pattern: <type>(<technology>|<task_folder>): <short_change_summary>
13+
- Allowed types: feat, fix, perf, test, refactor, docs, build, chore
14+
- Allowed technology: seq, omp, mpi, stl, tbb, all; or use your task folder name instead of a technology
15+
- Subject length: ≤ 72 characters, then one blank line
16+
- Required body sections: [What], [Why], [How], Scope: (Task/Variant/Technology/Folder), Tests:, Local runs:
17+
- Example subject: feat(omp|nesterov_a_vector_sum): implement parallel vector sum
18+
- Example body:
19+
[What]
20+
Add OMP reduction for vector sum.
21+
22+
[Why]
23+
Improve performance and parallel coverage.
24+
25+
[How]
26+
Use #pragma omp parallel for reduction(+:sum).
27+
28+
Scope:
29+
- Task: 2
30+
- Variant: 12
31+
- Technology: omp
32+
- Folder: nesterov_a_vector_sum
33+
34+
Tests:
35+
Added unit and perf tests.
36+
37+
Local runs:
38+
make test
39+
40+
Please fill in ALL sections below (no HTML comments). Use English headers as given.
41+
42+
## 1. Full name and group
43+
Name and group:
44+
45+
## 2. Assignment / Topic / Task
46+
Assignment:
47+
48+
## 3. Technology / Platform used
49+
Technology:
50+
51+
## 4. Goals of the work
52+
Goals:
53+
54+
## 5. Solution description and structure
55+
Description:
56+
57+
## 6. System requirements and build instructions
58+
Build & Run:
59+
60+
## 7. Testing and verification
61+
Testing:
62+
63+
## 8. Results
64+
Results:
65+
66+
## 9. Performance analysis
67+
Analysis:
68+
69+
## 10. Conclusions and possible improvements
70+
Conclusions:
71+
72+
## 11. Limitations / known issues
73+
Limitations:
74+
75+
## 12. CI / static analysis / code style
76+
CI & Style:
Lines changed: 76 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,76 @@
1-
<!--
2-
Требования к названию pull request:
3-
4-
"<Фамилия> <Имя>. Технология <TECHNOLOGY_NAME:SEQ|OMP|TBB|STL|MPI>. <Полное название задачи>. Вариант <Номер>"
5-
-->
6-
7-
## Описание
8-
<!--
9-
Пожалуйста, предоставьте подробное описание вашей реализации, включая:
10-
- основные детали решения (описание выбранного алгоритма)
11-
- применение технологии параллелизма (если применимо)
12-
-->
13-
14-
- **Задача**: _Введите здесь полное название задачи_
15-
- **Вариант**: _Введите здесь номер варианта_
16-
- **Технология**: _Введите технологию (например, SEQ, OMP, TBB, STL, MPI)_
17-
- **Описание** вашей реализации и отчёта.
18-
_Кратко опишите вашу реализацию и содержание отчёта здесь._
19-
20-
---
21-
22-
## Чек-лист
23-
<!--
24-
Пожалуйста, убедитесь, что следующие пункты выполнены **до** отправки pull request'а и запроса его ревью:
25-
-->
26-
27-
- [ ] **Статус CI**: Все CI-задачи (сборка, тесты, генерация отчёта) успешно проходят на моей ветке в моем форке
28-
- [ ] **Директория и именование задачи**: Я создал директорию с именем `<фамилия>_<первая_буква_имени>_<короткое_название_задачи>`
29-
- [ ] **Полное описание задачи**: Я предоставил полное описание задачи в теле pull request
30-
- [ ] **clang-format**: Мои изменения успешно проходят `clang-format` локально в моем форке (нет ошибок форматирования)
31-
- [ ] **clang-tidy**: Мои изменения успешно проходят `clang-tidy` локально в моем форке (нет предупреждений/ошибок)
32-
- [ ] **Функциональные тесты**: Все функциональные тесты успешно проходят локально на моей машине
33-
- [ ] **Тесты производительности**: Все тесты производительности успешно проходят локально на моей машине
34-
- [ ] **Ветка**: Я работаю в ветке, названной точно так же, как директория моей задачи (например, `nesterov_a_vector_sum`), а не в `master`
35-
- [ ] **Правдивое содержание**: Я подтверждаю, что все сведения, указанные в этом pull request, являются точными и достоверными
36-
37-
<!--
38-
ПРИМЕЧАНИЕ: Ложные сведения в этом чек-листе могут привести к отклонению PR и получению нулевого балла за соответствующую задачу.
39-
-->
1+
Формат заголовка PR (проверяется CI):
2+
- Шаблон: [TASK] <Task>-<Variant>. <Last Name> <First Name> <Middle Name>. <Group>. <Task name>.
3+
- Примечания: `[TASK]` — опционально; <Group> может быть любым текстом; после каждого блока — точка и пробел.
4+
- Пример (RU): 2-12. Иванов Иван Иванович. 2341-а234. Вычисление суммы элементов вектора.
5+
- Example (EN): 2-12. Ivanov Ivan Ivanovich. 2341-a234. Vector elements sum calculation.
6+
7+
Описание PR (проверяется CI):
8+
- Используйте 12 разделов ниже с точными заголовками; не добавляйте HTML-комментарии.
9+
- После каждой метки (например, `Assignment:`) укажите непустой текст.
10+
11+
Описания коммитов (проверяется CI):
12+
- Паттерн заголовка: <type>(<technology>|<task_folder>): <short_change_summary>
13+
- Допустимые type: feat, fix, perf, test, refactor, docs, build, chore
14+
- Допустимые technology: seq, omp, mpi, stl, tbb, all; либо используйте имя папки задачи вместо technology
15+
- Длина первой строки ≤ 72 символа, затем пустая строка
16+
- Обязательные секции тела: [What], [Why], [How], Scope: (Task/Variant/Technology/Folder), Tests:, Local runs:
17+
- Пример subject: feat(omp|nesterov_a_vector_sum): implement parallel vector sum
18+
- Пример тела:
19+
[What]
20+
Add OMP reduction for vector sum.
21+
22+
[Why]
23+
Improve performance and parallel coverage.
24+
25+
[How]
26+
Use #pragma omp parallel for reduction(+:sum).
27+
28+
Scope:
29+
- Task: 2
30+
- Variant: 12
31+
- Technology: omp
32+
- Folder: nesterov_a_vector_sum
33+
34+
Tests:
35+
Added unit and perf tests.
36+
37+
Local runs:
38+
make test
39+
40+
Заполните ВСЕ разделы ниже (без HTML-комментариев). Заголовки разделов оставьте на английском, как указано.
41+
42+
## 1. Full name and group
43+
Name and group:
44+
45+
## 2. Assignment / Topic / Task
46+
Assignment:
47+
48+
## 3. Technology / Platform used
49+
Technology:
50+
51+
## 4. Goals of the work
52+
Goals:
53+
54+
## 5. Solution description and structure
55+
Description:
56+
57+
## 6. System requirements and build instructions
58+
Build & Run:
59+
60+
## 7. Testing and verification
61+
Testing:
62+
63+
## 8. Results
64+
Results:
65+
66+
## 9. Performance analysis
67+
Analysis:
68+
69+
## 10. Conclusions and possible improvements
70+
Conclusions:
71+
72+
## 11. Limitations / known issues
73+
Limitations:
74+
75+
## 12. CI / static analysis / code style
76+
CI & Style:

.github/pull_request_template.md

Lines changed: 74 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,76 @@
1-
<!-- Solution for PR template choice: https://stackoverflow.com/a/75030350/24543008 -->
1+
PR Title (enforced by CI):
2+
- Pattern: [TASK] <Task>-<Variant>. <Last Name> <First Name> <Middle Name>. <Group>. <Task name>.
3+
- Notes: `[TASK]` is optional; <Group> can be any text; there must be a dot and a space after each block.
4+
- Example (RU): 2-12. Иванов Иван Иванович. 2341-а234. Вычисление суммы элементов вектора.
5+
- Example (EN): 2-12. Ivanov Ivan Ivanovich. 2341-a234. Vector elements sum calculation.
26

3-
Please go to the `Preview` tab and select the appropriate template:
7+
PR Body (enforced by CI):
8+
- Use the 12 sections below exactly as titled; do not include HTML comments.
9+
- After each label line (e.g., `Assignment:`), provide non-empty text.
410

5-
* [Submit Student task (English)](?expand=1&template=task_submission_en.md)
6-
* [Submit Student task (Russian)](?expand=1&template=task_submission_ru.md)
11+
Commit Messages (enforced by CI):
12+
- Subject pattern: <type>(<technology>|<task_folder>): <short_change_summary>
13+
- Allowed types: feat, fix, perf, test, refactor, docs, build, chore
14+
- Allowed technology: seq, omp, mpi, stl, tbb, all; or use your task folder name instead of a technology
15+
- Subject length: ≤ 72 characters, then one blank line
16+
- Required body sections: [What], [Why], [How], Scope: (Task/Variant/Technology/Folder), Tests:, Local runs:
17+
- Example subject: feat(omp|nesterov_a_vector_sum): implement parallel vector sum
18+
- Example body:
19+
[What]
20+
Add OMP reduction for vector sum.
21+
22+
[Why]
23+
Improve performance and parallel coverage.
24+
25+
[How]
26+
Use #pragma omp parallel for reduction(+:sum).
27+
28+
Scope:
29+
- Task: 2
30+
- Variant: 12
31+
- Technology: omp
32+
- Folder: nesterov_a_vector_sum
33+
34+
Tests:
35+
Added unit and perf tests.
36+
37+
Local runs:
38+
make test
39+
40+
Please fill in ALL sections below (no HTML comments).
41+
42+
## 1. Full name and group
43+
Name and group:
44+
45+
## 2. Assignment / Topic / Task
46+
Assignment:
47+
48+
## 3. Technology / Platform used
49+
Technology:
50+
51+
## 4. Goals of the work
52+
Goals:
53+
54+
## 5. Solution description and structure
55+
Description:
56+
57+
## 6. System requirements and build instructions
58+
Build & Run:
59+
60+
## 7. Testing and verification
61+
Testing:
62+
63+
## 8. Results
64+
Results:
65+
66+
## 9. Performance analysis
67+
Analysis:
68+
69+
## 10. Conclusions and possible improvements
70+
Conclusions:
71+
72+
## 11. Limitations / known issues
73+
Limitations:
74+
75+
## 12. CI / static analysis / code style
76+
CI & Style:

0 commit comments

Comments
 (0)