Skip to content

Commit 3fb2f28

Browse files
authored
Merge pull request #3033 from athenianco/reviews-cfg
[DEV-5362] Add the review action rules
2 parents 4b1f386 + 57341da commit 3fb2f28

File tree

4 files changed

+122
-1
lines changed

4 files changed

+122
-1
lines changed

.github/request-review-rules.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
"**.pyx":
2+
- team: api-admin
3+
"**.pyd":
4+
- team: api-admin
5+
"**.h":
6+
- team: api-admin
7+
8+
"server/athenian/api/internal/features/**":
9+
- team: api-admin
10+
"server/athenian/api/internal/miners/**":
11+
- team: api-admin
12+
"server/athenian/api/internal/prefixer.py":
13+
- team: api-admin
14+
15+
"server/athenian/api/models/metadata/**":
16+
- team: api-admin
17+
"server/athenian/api/models/precomputed/**":
18+
- team: api-admin
19+
"server/athenian/api/models/persistentdata/**":
20+
- team: api-admin
21+
22+
"server/athenian/api/async_utils.py":
23+
- team: api-admin
24+
"server/athenian/api/auth.py":
25+
- team: api-admin
26+
"server/athenian/api/cache.py":
27+
- team: api-admin
28+
"server/athenian/api/defer.py":
29+
- team: api-admin
30+
"server/athenian/api/faster_pandas.py":
31+
- team: api-admin
32+
"server/athenian/api/int_to_str.py":
33+
- team: api-admin
34+
"server/athenian/api/serialization.py":
35+
- team: api-admin
36+
"server/athenian/api/tracing.py":
37+
- team: api-admin
38+
"server/athenian/api/typing_utils.py":
39+
- team: api-admin
40+
"Dockerfile":
41+
- team: api-admin
42+
"pyproject.toml":
43+
- team: api-admin
44+
"requirements.txt":
45+
- team: api-admin
46+
"setup.py":
47+
- team: api-admin
48+
".github/**":
49+
- team: api-admin

.github/require-review-rules.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
- name: Native
2+
paths:
3+
- "**.pyx"
4+
- "**.pyd"
5+
- "**.h"
6+
teams:
7+
- api-admin
8+
- name: Guts
9+
paths:
10+
- "server/athenian/api/internal/features/**"
11+
- "server/athenian/api/internal/miners/**"
12+
- "server/athenian/api/internal/prefixer.py"
13+
teams:
14+
- api-admin
15+
- name: DB
16+
paths:
17+
- "server/athenian/api/models/metadata/**"
18+
- "server/athenian/api/models/precomputed/**"
19+
- "server/athenian/api/models/persistentdata/**"
20+
teams:
21+
- api-admin
22+
- name: Engine
23+
paths:
24+
- "server/athenian/api/async_utils.py"
25+
- "server/athenian/api/auth.py"
26+
- "server/athenian/api/cache.py"
27+
- "server/athenian/api/defer.py"
28+
- "server/athenian/api/faster_pandas.py"
29+
- "server/athenian/api/int_to_str.py"
30+
- "server/athenian/api/serialization.py"
31+
- "server/athenian/api/tracing.py"
32+
- "server/athenian/api/typing_utils.py"
33+
- "Dockerfile"
34+
- "pyproject.toml"
35+
- "requirements.txt"
36+
- "setup.py"
37+
- ".github/**"
38+
teams:
39+
- api-admin

.github/workflows/reviews.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: 👤 Review
2+
3+
on:
4+
pull_request:
5+
pull_request_review:
6+
7+
jobs:
8+
require_reviewer:
9+
name: require
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: actions/checkout
13+
uses: actions/checkout@v3
14+
with:
15+
submodules: false
16+
- uses: Automattic/action-required-review@v3
17+
with:
18+
requirements-file: .github/require-review-rules.yml
19+
status: Review by athenianco/api-admin is required
20+
fail: true
21+
token: ${{ secrets.GKWILLIE_REVIEW_TOKEN }}
22+
assign_reviewer:
23+
name: request
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: actions/checkout
27+
uses: actions/checkout@v3
28+
with:
29+
submodules: false
30+
- uses: shufo/[email protected]
31+
with:
32+
config: .github/request-review-rules.yml
33+
token: ${{ secrets.GKWILLIE_REVIEW_TOKEN }}

server/athenian/api/internal/features/github/pull_request_metrics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ def _analyze(
320320
) -> np.ndarray:
321321
result = np.full((len(min_times), len(facts)), self.nan, self.dtype)
322322
merge_end = result.copy().astype(min_times.dtype)
323-
closed_indexes = np.nonzero(facts[PullRequestFacts.f.merged].notnull().values)[0]
323+
closed_indexes = np.flatnonzero(facts[PullRequestFacts.f.merged].notnull().values)
324324
closed = facts[PullRequestFacts.f.merged].values[closed_indexes]
325325
closed_in_range = (min_times[:, None] <= closed) & (closed < max_times[:, None])
326326
closed_indexes = np.broadcast_to(

0 commit comments

Comments
 (0)