From 78bb163dad4b48a40bfc0873e9230ac2115d54cc Mon Sep 17 00:00:00 2001 From: Sarah Funkhouser Date: Mon, 18 Oct 2021 16:56:06 -0400 Subject: [PATCH 1/2] runnerID and runnerGroupID are int64, not string --- github/github-accessors.go | 8 ++++---- github/github-accessors_test.go | 4 ++-- github/orgs_audit_log.go | 4 ++-- github/orgs_audit_log_test.go | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 12dc2ca6a6f..6f5f229e0ad 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -869,9 +869,9 @@ func (a *AuditEntry) GetRepositoryPublic() bool { } // GetRunnerGroupID returns the RunnerGroupID field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetRunnerGroupID() string { +func (a *AuditEntry) GetRunnerGroupID() int64 { if a == nil || a.RunnerGroupID == nil { - return "" + return 0 } return *a.RunnerGroupID } @@ -885,9 +885,9 @@ func (a *AuditEntry) GetRunnerGroupName() string { } // GetRunnerID returns the RunnerID field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetRunnerID() string { +func (a *AuditEntry) GetRunnerID() int64 { if a == nil || a.RunnerID == nil { - return "" + return 0 } return *a.RunnerID } diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index e18d6787e77..fdf75a8c7c7 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -1024,7 +1024,7 @@ func TestAuditEntry_GetRepositoryPublic(tt *testing.T) { } func TestAuditEntry_GetRunnerGroupID(tt *testing.T) { - var zeroValue string + var zeroValue int64 a := &AuditEntry{RunnerGroupID: &zeroValue} a.GetRunnerGroupID() a = &AuditEntry{} @@ -1044,7 +1044,7 @@ func TestAuditEntry_GetRunnerGroupName(tt *testing.T) { } func TestAuditEntry_GetRunnerID(tt *testing.T) { - var zeroValue string + var zeroValue int64 a := &AuditEntry{RunnerID: &zeroValue} a.GetRunnerID() a = &AuditEntry{} diff --git a/github/orgs_audit_log.go b/github/orgs_audit_log.go index 4b98ba690e3..ca931a09d15 100644 --- a/github/orgs_audit_log.go +++ b/github/orgs_audit_log.go @@ -70,9 +70,9 @@ type AuditEntry struct { Repo *string `json:"repo,omitempty"` Repository *string `json:"repository,omitempty"` RepositoryPublic *bool `json:"repository_public,omitempty"` - RunnerGroupID *string `json:"runner_group_id,omitempty"` + RunnerGroupID *int64 `json:"runner_group_id,omitempty"` RunnerGroupName *string `json:"runner_group_name,omitempty"` - RunnerID *string `json:"runner_id,omitempty"` + RunnerID *int64 `json:"runner_id,omitempty"` RunnerLabels []string `json:"runner_labels,omitempty"` RunnerName *string `json:"runner_name,omitempty"` SecretsPassed []string `json:"secrets_passed,omitempty"` diff --git a/github/orgs_audit_log_test.go b/github/orgs_audit_log_test.go index 95b0a0cf604..823ce17dcfe 100644 --- a/github/orgs_audit_log_test.go +++ b/github/orgs_audit_log_test.go @@ -200,9 +200,9 @@ func TestAuditEntry_Marshal(t *testing.T) { Repo: String("r"), Repository: String("repo"), RepositoryPublic: Bool(false), - RunnerGroupID: String("rgid"), + RunnerGroupID: Int64(1), RunnerGroupName: String("rgn"), - RunnerID: String("rid"), + RunnerID: Int64(1), RunnerLabels: []string{"s"}, RunnerName: String("rn"), SecretsPassed: []string{"s"}, From fcec11229e3ed830280224d7a7ed3a55073b41b2 Mon Sep 17 00:00:00 2001 From: Sarah Funkhouser Date: Mon, 18 Oct 2021 18:21:35 -0400 Subject: [PATCH 2/2] fix broken test --- github/orgs_audit_log_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/github/orgs_audit_log_test.go b/github/orgs_audit_log_test.go index 823ce17dcfe..1537877f4d3 100644 --- a/github/orgs_audit_log_test.go +++ b/github/orgs_audit_log_test.go @@ -268,9 +268,9 @@ func TestAuditEntry_Marshal(t *testing.T) { "repo": "r", "repository": "repo", "repository_public": false, - "runner_group_id": "rgid", + "runner_group_id": 1, "runner_group_name": "rgn", - "runner_id": "rid", + "runner_id": 1, "runner_labels": [ "s" ],