-
Notifications
You must be signed in to change notification settings - Fork 75
0-0. Иванов Иван Иванович. 1234567890а. Проверка имени, описание и коммитов реквеста #636
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
33cc233 to
f346046
Compare
bb422f2 to
24efd2c
Compare
[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
4e30867 to
00d90d9
Compare
[What] Remove duplicated pre-commit invocation from main workflow and make platform jobs depend directly on PR Compliance via needs. [Why] Avoid running pre-commit twice on PRs and ensure all jobs are strictly gated by PR Compliance. [How] - .github/workflows/main.yml: drop pre-commit job; set ubuntu/mac/windows to needs: [pr_compliance]. Scope: - Task: 0 - Variant: 0 - Technology: all - Folder: pr_compliance Tests: - CI: workflow graph shows no duplicate pre-commit; downstream jobs start only after pr_compliance. Local runs: - N/A (workflow change only)
979ab14 to
7e32f9e
Compare
|
@aobolensk prepared full check of PR |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #636 +/- ##
=======================================
Coverage 95.35% 95.35%
=======================================
Files 11 11
Lines 366 366
Branches 133 133
=======================================
Hits 349 349
Partials 17 17 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
This pull request is stale for 2 weeks and is going to be closed in a week |
|
This pull request is stale for 2 weeks and is going to be closed in a week |
1. Full name and group
Name and group: Anesterov A., 2341-a234
2. Assignment / Topic / Task
Assignment: Add PR/commit compliance validator, tests, and CI gating
3. Technology / Platform used
Technology: Python 3.11, GitHub Actions, GitHub REST API
4. Goals of the work
Goals: Enforce strict PR title/body/commit formats; provide clear error messages
with EN+RU examples; enable local and CI usage; achieve 100% test coverage; gat
e other PR workflows on compliance
5. Solution description and structure
Description: Implemented .github/scripts/validate_pr.py for title/body/commit va
lidation; added .github/workflows/pr-compliance.yml split into four jobs (unit t
ests first, then title/body/commits); introduced unit tests covering helpers, CL
I flows, and edges; enforced 100% coverage; updated PR templates to match valida
tor (12 sections, no HTML comments) and added visible EN/RU title examples; rela
xed PR title “group” field to allow any text before “. ”
6. System requirements and build instructions
Build & Run:
repo / --pr --checks all --verbose
e_pr_main.py
s/test_validate_pr_main.py && coverage report -m .github/scripts/validate_pr.py
7. Testing and verification
Testing: Added comprehensive unittests for title/body/commit validation, helpers
(_trim, payload loading), API fetch (mocked), and CLI code paths including inte
rnal-error branch; verified local runs with valid/invalid payloads; CI enforces
coverage == 100%
8. Results
Results: Validator outputs clear sections and summaries; CI workflow runs tests
first, then validates title/body/commits; failing checks stop downstream workflo
ws; PR templates now guide authors to pass checks on first try
9. Performance analysis
Analysis: Validator uses stdlib only; API calls limited to PR commits list; runt
ime negligible relative to overall CI; coverage steps add minimal overhead
10. Conclusions and possible improvements
Conclusions: The pipeline is now robust and transparent; quality gates prevent n
on-compliant PRs early; future improvements could add GitHub annotations or path
-based filtering for workflow_run-triggered jobs
11. Limitations / known issues
Limitations: Commit validation requires GITHUB_TOKEN; body checks require exact
headers/labels; “Performance:” section in commits is optional unless perf change
s are made; current workflow_run triggers don’t apply file path filters (can be
emulated if needed)
12. CI / static analysis / code style
CI & Style: PR Compliance gates other PR workflows via workflow_run; unit tests
run with coverage fail-under=100; pre-commit/static analysis/Docker PR jobs run
only after PR Compliance succeeds