Skip to content

Commit 5afbc56

Browse files
authored
Merge branch 'main' into feature/enable-mr
2 parents 4c057a4 + f8ddbc1 commit 5afbc56

File tree

243 files changed

+19542
-2335
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

243 files changed

+19542
-2335
lines changed

.flake8

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ fcn_exclude_functions =
2727
addoption,
2828
write,
2929
from_pytest_fixture,
30-
QueueListener
30+
QueueListener,
31+
yaml
3132

3233

3334
enable-extensions =

.github/CODEOWNERS

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Lines starting with '#' are comments.
2+
# Each line is a file pattern followed by one or more owners.
3+
4+
# More details are here: https://help.github.com/articles/about-codeowners/
5+
6+
# The '*' pattern is global owners.
7+
8+
# Order is important. The last matching pattern has the most precedence.
9+
10+
# Global rule:
11+
* @opendatahub-io/opendatahub-tests-contributors

.github/workflows/add-remove-labels.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ on:
33
pull_request_target:
44
types: [synchronize]
55

6+
pull_request_review:
7+
68
issue_comment:
79
types: [created, edited, deleted]
810
if: |
@@ -15,6 +17,7 @@ on:
1517
permissions:
1618
pull-requests: write
1719
contents: write
20+
issues: write
1821

1922
jobs:
2023
add-remove-labels:
@@ -38,7 +41,9 @@ jobs:
3841
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3942
GITHUB_PR_NUMBER: "${{ github.event.pull_request.number || github.event.issue.number }}"
4043
GITHUB_EVENT_ACTION: ${{ github.event.action }}
44+
GITHUB_EVENT_REVIEW_STATE: ${{ github.event.review.state }}
4145
GITHUB_EVENT_NAME: ${{ github.event_name }}
4246
COMMENT_BODY: ${{ github.event.comment.body }}
47+
GITHUB_USER_LOGIN: ${{ github.event.sender.login }}
4348
ACTION: "add-remove-labels"
4449
run: uv run python .github/workflows/scripts/pr_workflow.py
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
LABEL_PREFIX: str = "/"
2+
SIZE_LABEL_PREFIX: str = f"size{LABEL_PREFIX}"
3+
WIP_LABEL_STR: str = "wip"
4+
LGTM_LABEL_STR: str = "lgtm"
5+
VERIFIED_LABEL_STR: str = "verified"
6+
HOLD_LABEL_STR: str = "hold"
7+
APPROVED_BY_LABEL_PREFIX: str = "approved-by-"
8+
LGTM_BY_LABEL_PREFIX: str = f"{LGTM_LABEL_STR}-by-"
9+
CHANGED_REQUESTED_BY_LABEL_PREFIX: str = "changes-requested-by-"
10+
COMMENTED_BY_LABEL_PREFIX: str = "commented-by-"
11+
SUCCESS_STR: str = "success"
12+
FAILURE_STR: str = "failure"
13+
QUEUED_STR: str = "queued"
14+
15+
SUPPORTED_LABELS: set[str] = {
16+
f"{LABEL_PREFIX}{WIP_LABEL_STR}",
17+
f"{LABEL_PREFIX}{LGTM_LABEL_STR}",
18+
f"{LABEL_PREFIX}{VERIFIED_LABEL_STR}",
19+
f"{LABEL_PREFIX}{HOLD_LABEL_STR}",
20+
}
21+
22+
CANCEL_ACTION: str = "cancel"
23+
WELCOME_COMMENT: str = f"""
24+
The following are automatically added/executed:
25+
* PR size label.
26+
* Run [pre-commit](https://pre-commit.ci/)
27+
* Run [tox](https://tox.wiki/)
28+
29+
Available user actions:
30+
* To mark a PR as `WIP`, add `/wip` in a comment. To remove it from the PR comment `/wip cancel` to the PR.
31+
* To block merging of a PR, add `/hold` in a comment. To un-block merging of PR comment `/hold cancel`.
32+
* To mark a PR as approved, add `/lgtm` in a comment. To remove, add `/lgtm cancel`.
33+
`lgtm` label removed on each new commit push.
34+
* To mark PR as verified comment `/verified` to the PR, to un-verify comment `/verified cancel` to the PR.
35+
`verified` label removed on each new commit push.
36+
37+
<details>
38+
<summary>Supported labels</summary>
39+
40+
{SUPPORTED_LABELS}
41+
</details>
42+
"""
43+
44+
45+
DEFAULT_LABEL_COLOR = "B60205"
46+
USER_LABELS_DICT: dict[str, str] = {
47+
HOLD_LABEL_STR: DEFAULT_LABEL_COLOR,
48+
VERIFIED_LABEL_STR: "0E8A16",
49+
WIP_LABEL_STR: DEFAULT_LABEL_COLOR,
50+
LGTM_LABEL_STR: "0E8A16",
51+
}
52+
53+
STATIC_LABELS_DICT: dict[str, str] = {
54+
**USER_LABELS_DICT,
55+
f"{SIZE_LABEL_PREFIX}l": "F5621C",
56+
f"{SIZE_LABEL_PREFIX}m": "F09C74",
57+
f"{SIZE_LABEL_PREFIX}s": "0E8A16",
58+
f"{SIZE_LABEL_PREFIX}xl": "D93F0B",
59+
f"{SIZE_LABEL_PREFIX}xs": "ededed",
60+
f"{SIZE_LABEL_PREFIX}xxl": DEFAULT_LABEL_COLOR,
61+
}
62+
63+
DYNAMIC_LABELS_DICT: dict[str, str] = {
64+
LGTM_BY_LABEL_PREFIX: "DCED6F",
65+
COMMENTED_BY_LABEL_PREFIX: "D93F0B",
66+
CHANGED_REQUESTED_BY_LABEL_PREFIX: "F5621C",
67+
}
68+
69+
ALL_LABELS_DICT: dict[str, str] = {**STATIC_LABELS_DICT, **DYNAMIC_LABELS_DICT}

0 commit comments

Comments
 (0)