Skip to content

Commit 1cf466b

Browse files
authored
Don't check for "CLA signed" label. (#543)
* Don't check for "CLA signed" label. CPython is now using cpython-cla-bot, and we're not relying on the CLA Signed label anymore. CLA signed is now a status check on the CI. Also remove the DeprecationWarning from pytest by adding pytest.ini
1 parent a289eef commit 1cf466b

File tree

11 files changed

+58
-77
lines changed

11 files changed

+58
-77
lines changed

.coveragerc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[run]
2+
branch = True
3+
omit =
4+
miss_islington/tasks.py
5+
6+
[report]
7+
fail_under = 100

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ jobs:
2727
with:
2828
python-version: ${{ matrix.python-version }}
2929
- run: python3 -m pip install -U -r dev-requirements.txt
30-
- run: python3 -m coverage run --branch -m pytest tests/
31-
- uses: codecov/codecov-action@v1
30+
- run: pytest --cov=. --cov-report=xml
31+
- uses: codecov/codecov-action@v2
3232
if: always()
3333
with:
3434
token: ${{ secrets.CODECOV_TOKEN }}

miss_islington/check_run.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,6 @@ async def check_run_completed(event, gh, *args, **kwargs):
2424
pr_for_commit = await util.get_pr_for_commit(gh, sha)
2525
if pr_for_commit:
2626
pr_labels = pr_for_commit["labels"]
27-
print("is auomer")
28-
print(util.pr_is_automerge(pr_labels))
29-
print(util.pr_is_awaiting_merge(pr_labels))
30-
print("pr label")
31-
print(pr_labels)
3227
if util.pr_is_automerge(pr_labels) and util.pr_is_awaiting_merge(pr_labels):
3328
await check_ci_status_and_approval(
3429
gh,

miss_islington/status_change.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ async def check_ci_status_and_approval(
118118
else:
119119
emoji = "❌"
120120
description = "failure"
121-
print("leaving a comment")
122121
await util.leave_comment(
123122
gh,
124123
pr_number=pr_number,
@@ -133,8 +132,8 @@ async def check_ci_status_and_approval(
133132

134133
async def merge_pr(gh, pr, sha, is_automerge=False):
135134
pr_number = pr["number"]
136-
async for commit in gh.getiter(f"/repos/python/cpython/pulls/{pr_number}/commits"):
137-
if commit["sha"] == sha:
135+
async for commit in gh.getiter(f"/repos/python/cpython/pulls/{pr_number}/commits"): # pragma: no branch
136+
if commit["sha"] == sha: # pragma: no branch
138137
if is_automerge:
139138
pr_commit_msg = util.normalize_message(pr["body"])
140139
pr_title = f"{pr['title']} (GH-{pr_number})"

miss_islington/tasks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
@app.task()
3838
def setup_cpython_repo():
39-
print("Setting up CPython repository")
39+
print("Setting up CPython repository") # pragma: nocover
4040
if "cpython" not in os.listdir("."):
4141
subprocess.check_output(
4242
f"git clone https://{os.environ.get('GH_AUTH')}:[email protected]/miss-islington/cpython.git".split()

miss_islington/util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ async def is_core_dev(gh, username):
110110
org_teams = "/orgs/python/teams"
111111
team_name = "python core"
112112
async for team in gh.getiter(org_teams):
113-
if team["name"].lower() == team_name:
113+
if team["name"].lower() == team_name: # pragma: no branch
114114
break
115115
else:
116116
raise ValueError(f"{team_name!r} not found at {org_teams!r}")
@@ -133,7 +133,7 @@ def pr_is_awaiting_merge(pr_labels):
133133
if (
134134
"DO-NOT-MERGE" not in label_names
135135
and "awaiting merge" in label_names
136-
and "CLA signed" in label_names
136+
and "CLA not signed" not in label_names
137137
):
138138
return True
139139
return False

pytest.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[pytest]
2+
asyncio_mode=auto

tests/test_backport_pr.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ async def test_labeled_on_merged_pr_no_backport_label():
5858
"repository": {
5959
"issues_url": "https://api.github.com/repos/python/cpython/issues{/number}"
6060
},
61-
"label": {"name": "CLA signed"},
61+
"label": {"name": "skip news"},
6262
}
6363
event = sansio.Event(data, event="pull_request", delivery_id="1")
6464

@@ -89,7 +89,7 @@ async def test_merged_pr_no_backport_label():
8989
"labels_url": "https://api.github.com/repos/python/cpython/issues/1/labels{/name}"
9090
},
9191
"https://api.github.com/repos/python/cpython/issues/1/labels": [
92-
{"name": "CLA signed"}
92+
{"name": "skip news"}
9393
],
9494
}
9595

@@ -121,7 +121,6 @@ async def test_merged_pr_with_backport_label(branch):
121121
"labels_url": "https://api.github.com/repos/python/cpython/issues/1/labels{/name}"
122122
},
123123
"https://api.github.com/repos/python/cpython/issues/1/labels": [
124-
{"name": "CLA signed"},
125124
{"name": f"needs backport to {branch}"},
126125
],
127126
}
@@ -156,7 +155,6 @@ async def test_merged_pr_with_backport_label_thank_pr_author():
156155
"labels_url": "https://api.github.com/repos/python/cpython/issues/1/labels{/name}"
157156
},
158157
"https://api.github.com/repos/python/cpython/issues/1/labels": [
159-
{"name": "CLA signed"},
160158
{"name": "needs backport to 3.7"},
161159
],
162160
}
@@ -190,7 +188,6 @@ async def test_easter_egg():
190188
"labels_url": "https://api.github.com/repos/python/cpython/issues/1/labels{/name}"
191189
},
192190
"https://api.github.com/repos/python/cpython/issues/1/labels": [
193-
{"name": "CLA signed"},
194191
{"name": "needs backport to 3.7"},
195192
],
196193
}
@@ -236,7 +233,6 @@ async def test_backport_pr_redis_connection_error():
236233
"labels_url": "https://api.github.com/repos/python/cpython/issues/1/labels{/name}"
237234
},
238235
"https://api.github.com/repos/python/cpython/issues/1/labels": [
239-
{"name": "CLA signed"},
240236
{"name": "needs backport to 3.7"},
241237
],
242238
}
@@ -269,7 +265,6 @@ async def test_backport_pr_kombu_operational_error():
269265
"labels_url": "https://api.github.com/repos/python/cpython/issues/1/labels{/name}"
270266
},
271267
"https://api.github.com/repos/python/cpython/issues/1/labels": [
272-
{"name": "CLA signed"},
273268
{"name": "needs backport to 3.7"},
274269
],
275270
}

tests/test_check_run.py

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,15 @@ async def test_check_run_completed_ci_passed_with_awaiting_merge_label_pr_is_mer
3838
"user": {"login": "miss-islington"},
3939
"merged_by": {"login": "Mariatta"},
4040
},
41-
"/repos/python/cpython/pulls/5547": {
42-
"labels": [{"name": "awaiting merge"}, {"name": "CLA signed"}]
43-
},
41+
"/repos/python/cpython/pulls/5547": {"labels": [{"name": "awaiting merge"}]},
4442
f"/search/issues?q=type:pr+repo:python/cpython+sha:{sha}": {
4543
"total_count": 1,
4644
"items": [
4745
{
4846
"number": 5547,
4947
"title": "[3.6] bpo-32720: Fixed the replacement field grammar documentation. (GH-5544)",
5048
"body": "\n\n`arg_name` and `element_index` are defined as `digit`+ instead of `integer`.\n(cherry picked from commit 7a561afd2c79f63a6008843b83733911d07f0119)\n\nCo-authored-by: Mariatta <[email protected]>",
51-
"labels": [{"name": "awaiting merge"}, {"name": "CLA signed"}],
49+
"labels": [{"name": "awaiting merge"}],
5250
}
5351
],
5452
},
@@ -120,17 +118,15 @@ async def test_check_run_completed_other_check_run_pending_with_awaiting_merge_l
120118
"user": {"login": "miss-islington"},
121119
"merged_by": {"login": "Mariatta"},
122120
},
123-
"/repos/python/cpython/pulls/5547": {
124-
"labels": [{"name": "awaiting merge"}, {"name": "CLA signed"}]
125-
},
121+
"/repos/python/cpython/pulls/5547": {"labels": [{"name": "awaiting merge"}]},
126122
f"/search/issues?q=type:pr+repo:python/cpython+sha:{sha}": {
127123
"total_count": 1,
128124
"items": [
129125
{
130126
"number": 5547,
131127
"title": "[3.6] bpo-32720: Fixed the replacement field grammar documentation. (GH-5544)",
132128
"body": "\n\n`arg_name` and `element_index` are defined as `digit`+ instead of `integer`.\n(cherry picked from commit 7a561afd2c79f63a6008843b83733911d07f0119)\n\nCo-authored-by: Mariatta <[email protected]>",
133-
"labels": [{"name": "awaiting merge"}, {"name": "CLA signed"}],
129+
"labels": [{"name": "awaiting merge"}],
134130
}
135131
],
136132
},
@@ -183,17 +179,15 @@ async def test_check_run_completed_other_check_run_queued_with_awaiting_merge_la
183179
"user": {"login": "miss-islington"},
184180
"merged_by": {"login": "Mariatta"},
185181
},
186-
"/repos/python/cpython/pulls/5547": {
187-
"labels": [{"name": "awaiting merge"}, {"name": "CLA signed"}]
188-
},
182+
"/repos/python/cpython/pulls/5547": {"labels": [{"name": "awaiting merge"}]},
189183
f"/search/issues?q=type:pr+repo:python/cpython+sha:{sha}": {
190184
"total_count": 1,
191185
"items": [
192186
{
193187
"number": 5547,
194188
"title": "[3.6] bpo-32720: Fixed the replacement field grammar documentation. (GH-5544)",
195189
"body": "\n\n`arg_name` and `element_index` are defined as `digit`+ instead of `integer`.\n(cherry picked from commit 7a561afd2c79f63a6008843b83733911d07f0119)\n\nCo-authored-by: Mariatta <[email protected]>",
196-
"labels": [{"name": "awaiting merge"}, {"name": "CLA signed"}],
190+
"labels": [{"name": "awaiting merge"}],
197191
}
198192
],
199193
},
@@ -246,17 +240,15 @@ async def test_check_run_completed_failure_with_awaiting_merge_label_pr_is_not_m
246240
"user": {"login": "miss-islington"},
247241
"merged_by": {"login": "Mariatta"},
248242
},
249-
"/repos/python/cpython/pulls/5547": {
250-
"labels": [{"name": "awaiting merge"}, {"name": "CLA signed"}]
251-
},
243+
"/repos/python/cpython/pulls/5547": {"labels": [{"name": "awaiting merge"}]},
252244
f"/search/issues?q=type:pr+repo:python/cpython+sha:{sha}": {
253245
"total_count": 1,
254246
"items": [
255247
{
256248
"number": 5547,
257249
"title": "[3.6] bpo-32720: Fixed the replacement field grammar documentation. (GH-5544)",
258250
"body": "\n\n`arg_name` and `element_index` are defined as `digit`+ instead of `integer`.\n(cherry picked from commit 7a561afd2c79f63a6008843b83733911d07f0119)\n\nCo-authored-by: Mariatta <[email protected]>",
259-
"labels": [{"name": "awaiting merge"}, {"name": "CLA signed"}],
251+
"labels": [{"name": "awaiting merge"}],
260252
}
261253
],
262254
},
@@ -309,17 +301,15 @@ async def test_check_run_completed_timed_out_with_awaiting_merge_label_pr_is_not
309301
"user": {"login": "miss-islington"},
310302
"merged_by": {"login": "Mariatta"},
311303
},
312-
"/repos/python/cpython/pulls/5547": {
313-
"labels": [{"name": "awaiting merge"}, {"name": "CLA signed"}]
314-
},
304+
"/repos/python/cpython/pulls/5547": {"labels": [{"name": "awaiting merge"}]},
315305
f"/search/issues?q=type:pr+repo:python/cpython+sha:{sha}": {
316306
"total_count": 1,
317307
"items": [
318308
{
319309
"number": 5547,
320310
"title": "[3.6] bpo-32720: Fixed the replacement field grammar documentation. (GH-5544)",
321311
"body": "\n\n`arg_name` and `element_index` are defined as `digit`+ instead of `integer`.\n(cherry picked from commit 7a561afd2c79f63a6008843b83733911d07f0119)\n\nCo-authored-by: Mariatta <[email protected]>",
322-
"labels": [{"name": "awaiting merge"}, {"name": "CLA signed"}],
312+
"labels": [{"name": "awaiting merge"}],
323313
}
324314
],
325315
},
@@ -460,7 +450,6 @@ async def test_ci_passed_automerge():
460450
"merged_by": None,
461451
"labels": [
462452
{"name": "awaiting merge"},
463-
{"name": "CLA signed"},
464453
{"name": AUTOMERGE_LABEL},
465454
],
466455
},
@@ -474,7 +463,6 @@ async def test_ci_passed_automerge():
474463
"labels": [
475464
{"name": "awaiting merge"},
476465
{"name": AUTOMERGE_LABEL},
477-
{"name": "CLA signed"},
478466
],
479467
}
480468
],
@@ -542,7 +530,7 @@ async def test_ci_passed_not_automerge():
542530
"/repos/python/cpython/pulls/5547": {
543531
"user": {"login": "bedevere-bot"},
544532
"merged_by": None,
545-
"labels": [{"name": "awaiting merge"}, {"name": "CLA signed"}],
533+
"labels": [{"name": "awaiting merge"}],
546534
},
547535
f"/search/issues?q=type:pr+repo:python/cpython+sha:{sha}": {
548536
"total_count": 1,
@@ -551,7 +539,7 @@ async def test_ci_passed_not_automerge():
551539
"number": 5547,
552540
"title": "bpo-32720: Fixed the replacement field grammar documentation.",
553541
"body": "\n\n`arg_name` and `element_index` are defined as `digit`+ instead of `integer`.\n(cherry picked from commit 7a561afd2c79f63a6008843b83733911d07f0119)\n\nCo-authored-by: Mariatta <[email protected]>",
554-
"labels": [{"name": "awaiting merge"}, {"name": "CLA signed"}],
542+
"labels": [{"name": "awaiting merge"}],
555543
}
556544
],
557545
},

0 commit comments

Comments
 (0)