Commit 099d7d1
ci: Add workflows for CI label management and approvals (#115)
* ci: Add workflows for CI label management and approvals
Signed-off-by: Helber Belmiro <helber.belmiro@gmail.com>
* ci: Update approval workflow with extended author associations checks
Signed-off-by: Helber Belmiro <helber.belmiro@gmail.com>
* ci: Fix artifact path for extracting PR metadata in CI label workflow
Signed-off-by: Helber Belmiro <helber.belmiro@gmail.com>
* ci: Reset 'ci-passed' label on PR updates to maintain accurate CI status
Signed-off-by: Helber Belmiro <helber.belmiro@gmail.com>
* ci: Refactor CI label check logic to handle combined label conditions more effectively
Signed-off-by: Helber Belmiro <helber.belmiro@gmail.com>
* ci: Remove redundant checkout step from CI label workflow
Signed-off-by: Helber Belmiro <helber.belmiro@gmail.com>
* ci: Add initial implementation and unit tests for CI label checks system
Signed-off-by: Helber Belmiro <helber.belmiro@gmail.com>
* ci: Implement stricter CI label checks and enhance workflow automation
- Ensure non-member PRs without `ok-to-test` do not run CI.
- Add support for handling labels during label resets.
- Improve workflows to validate membership and manage labels dynamically.
- Update tests to cover new scenarios and stricter label conditions.
Signed-off-by: Helber Belmiro <helber.belmiro@gmail.com>
* ci: Add membership checks and enhance CI orchestration
- Introduce `is_member` and `get_own_check_run_id` to streamline membership validation and check ID retrieval.
- Replace workflow-level checks with scripted checks for consistency.
- Refactor CLI arguments in `ci_checks.py` to reduce redundancy.
- Extend tests to cover new client methods and stricter CI conditions.
Signed-off-by: Helber Belmiro <helber.belmiro@gmail.com>
* ci: Add logging and improve polling behavior in CI checks
- Introduce detailed logging to improve traceability during CI polling.
- Ensure proper logger configuration in `ci_checks.py` for consistency.
- Update CI workflow with a timeout to prevent infinite runs.
Signed-off-by: Helber Belmiro <helber.belmiro@gmail.com>
* ci: Set GITHUB_TOKEN in scripts-tests workflow for authentication
Signed-off-by: Helber Belmiro <helber.belmiro@gmail.com>
* ci: Ensure required labels exist in CI workflow
- Add logic to dynamically create missing labels (`ci-passed`, `needs-ok-to-test`, `ok-to-test`) to prevent workflow failures.
- Update permissions to include `issues: write` for label management.
Signed-off-by: Helber Belmiro <helber.belmiro@gmail.com>
* ci: Refactor environment variable usage in CI label workflow
- Consolidate environment variables (`EVENT_ACTION`, `PR_NUMBER`) for consistency across steps.
- Remove redundant `ref` configuration in `ci-checks.yml`.
Signed-off-by: Helber Belmiro <helber.belmiro@gmail.com>
* ci: Update Python version in CI workflow to 3.11
Signed-off-by: Helber Belmiro <helber.belmiro@gmail.com>
* ci: Remove custom Python setup step from CI workflow
Signed-off-by: Helber Belmiro <helber.belmiro@gmail.com>
* ci: Enhance workflow approval logic and error handling
- Add error handling for failed approval attempts, with detailed logging for 404 and 422 status codes.
- Introduce failure counting and set workflow to fail if any approvals are unsuccessful.
- Switch to bash shell for membership check step.
Signed-off-by: Helber Belmiro <helber.belmiro@gmail.com>
* ci: Add GitHub API test marker and separate API tests in CI
- Introduce `gh_api` marker for tests that require GITHUB_TOKEN and call the live GitHub API.
- Update `pytest.ini` to define the `gh_api` marker.
- Refactor tests to use the new `gh_api` decorator for API-specific cases.
- Modify `scripts-tests.yml` to split API tests
Signed-off-by: Helber Belmiro <helber.belmiro@gmail.com>
* ci: Update workflow run pagination logic in approval workflow
- Use a custom response mapping to retrieve `workflow_runs` for enhanced accuracy in pagination.
Signed-off-by: Helber Belmiro <helber.belmiro@gmail.com>
* ci: Update permissions in CI workflow to include `issues: write`
Signed-off-by: Helber Belmiro <helber.belmiro@gmail.com>
* ci: Add tests for paginated check-runs and update API logic
- Add test cases to validate behavior with multiple pages of check-runs.
- Update `gh` API command to include pagination flag (`--paginate`) for fetching check-runs.
Signed-off-by: Helber Belmiro <helber.belmiro@gmail.com>
* ci: Refactor membership checks using `author_association`
- Replace `is_member` checks with `author_association` for contributor trust determination.
- Remove membership logic from `GhClient`.
- Update test cases and workflows to reflect the new approach.
- Add dedicated tests for the `is_trusted_association` helper.
Signed-off-by: Helber Belmiro <helber.belmiro@gmail.com>
* Update .github/workflows/ci-checks.yml
Co-authored-by: Vani Haripriya Mudadla <vmudadla@redhat.com>
Signed-off-by: Helber Belmiro <helber.belmiro@gmail.com>
---------
Signed-off-by: Helber Belmiro <helber.belmiro@gmail.com>
Co-authored-by: Vani Haripriya Mudadla <vmudadla@redhat.com>1 parent bf7b8a0 commit 099d7d1
File tree
9 files changed
+1183
-1
lines changed- .github
- scripts
- ci_checks
- tests
- workflows
9 files changed
+1183
-1
lines changedWhitespace-only changes.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
Whitespace-only changes.
0 commit comments