Skip to content

Commit a2ceb1b

Browse files
authored
fix: assigning issues permission error (#187)
Assign issues to charm tech members and mention interface maintainers in the issue body.
1 parent 58d49b4 commit a2ceb1b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

run_matrix.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -357,18 +357,24 @@ def create_issue(
357357
):
358358
gh = Github(os.getenv("GITHUB_TOKEN"))
359359
repo = gh.get_repo("canonical/charm-relation-interfaces")
360+
issue_assignees = ["IronCore864", "tonyandrewmeyer"]
360361
workflow_url = ""
361362
github_run_id = os.getenv("GITHUB_RUN_ID")
362363
if github_run_id:
363364
workflow_url = f"https://github.com/canonical/charm-relation-interfaces/actions/runs/{github_run_id}"
364365
result = flatten_test_result(result_per_role)
365366
title = f"Interface test for {interface} {version} failed."
367+
mention_team_members = ", ".join(
368+
["@" + member for member in get_team_members_from_team_slug(maintainer)]
369+
)
366370
body = f"""\
367371
Tests for interface {interface} {version} failed.
368372
369373
{result}
370374
371375
See the workflow {workflow_url} for more detail.
376+
377+
{mention_team_members}
372378
"""
373379

374380
issue = None
@@ -378,18 +384,12 @@ def create_issue(
378384
issue = existing_issue
379385
break
380386

381-
# Issues in public repositories can have up to 10 people assigned.
382-
# https://github.com/canonical/charm-relation-interfaces/actions/runs/11318866281
383-
team_members = get_team_members_from_team_slug(maintainer)[:10]
384387
if issue:
385388
issue.create_comment(body)
386389
print(f"GitHub issue updated: {issue.html_url}")
387-
if team_members:
388-
issue.edit(assignees=team_members)
389-
print(f"GitHub issue assigned to {team_members}")
390390
else:
391391
issue = repo.create_issue(
392-
title=title, body=body, assignees=team_members, labels=labels
392+
title=title, body=body, assignees=issue_assignees, labels=labels
393393
)
394394
print(f"GitHub issue created: {issue.html_url}")
395395

0 commit comments

Comments
 (0)