Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PTFE-742 Fix github group update 422 errors #453

Merged
merged 1 commit into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion runner_manager/clients/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@ def update_self_hosted_runner_group_for_org(
url = f"/orgs/{org}/actions/runner-groups/{runner_group_id}"

# exclude id from data
json = data.dict(exclude_unset=True, exclude={"id"}) if data else None
json = (
data.dict(exclude_unset=True, exclude={"id", "default"}) if data else None
)

headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}

Expand Down
1 change: 0 additions & 1 deletion runner_manager/models/runner_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,6 @@ def create_github_group(self, github: GitHub) -> GitHubRunnerGroup:
group: Response[GitHubRunnerGroup]
data = GitHubRunnerGroup(
name=self.name,
default=self.default,
allows_public_repositories=self.allows_public_repositories,
)
if self.id is None:
Expand Down
7 changes: 7 additions & 0 deletions tests/unit/clients/test_github.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ def test_get_runner_group(github, runner_group, org):
assert group.name == runner_group.name


def test_update_runner_group(github, runner_group, org):
resp: Response = github.rest.actions.update_self_hosted_runner_group_for_org(
org=org, runner_group_id=runner_group.id, data=runner_group
)
assert resp.status_code == 200


def test_delete_runner_group(github, runner_group, org):
resp: Response = github.rest.actions.delete_self_hosted_runner_group_from_org(
org=org, runner_group_id=runner_group.id
Expand Down
Loading