8000 feat: Add CreatedAt and UpdatedAt to Ruleset by ivanmartos · Pull Request #3316 · google/go-github · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: Add CreatedAt and UpdatedAt to Ruleset #3316

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 < 8000 a class="Link--inTextBlock" href="https://docs.github.com/privacy" target="_blank">privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
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
16 changes: 16 additions & 0 deletions github/github-accessors.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions github/github-accessors_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions github/repos_rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,8 @@ type Ruleset struct {
Links *RulesetLinks `json:"_links,omitempty"`
Conditions *RulesetConditions `json:"conditions,omitempty"`
Rules []*RepositoryRule `json:"rules,omitempty"`
UpdatedAt *Timestamp `json:"updated_at,omitempty"`
CreatedAt *Timestamp `json:"created_at,omitempty"`
}

// rulesetNoOmitBypassActors represents a GitHub ruleset object. The struct does not omit bypassActors if the field is nil or an empty array is passed.
Expand Down
18 changes: 15 additions & 3 deletions github/repos_rules_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -489,14 +489,18 @@ func TestRepositoriesService_GetAllRulesets(t *testing.T) {
"name": "ruleset",
"source_type": "Repository",
"source": "o/repo",
"enforcement": "enabled"
"enforcement": "enabled",
"created_at": `+referenceTimeStr+`,
"updated_at": `+referenceTimeStr+`
},
{
"id": 314,
"name": "Another ruleset",
"source_type": "Repository",
"source": "o/repo",
"enforcement": "enabled"
"enforcement": "enabled", 8000
"created_at": `+referenceTimeStr+`,
"updated_at": `+referenceTimeStr+`
}
]`)
})
Expand All @@ -514,13 +518,17 @@ func TestRepositoriesService_GetAllRulesets(t *testing.T) {
SourceType: String("Repository"),
Source: "o/repo",
Enforcement: "enabled",
CreatedAt: &Timestamp{referenceTime},
UpdatedAt: &Timestamp{referenceTime},
},
{
ID: Int64(314),
Name: "Another ruleset",
SourceType: String("Repository"),
Source: "o/repo",
Enforcement: "enabled",
CreatedAt: &Timestamp{referenceTime},
UpdatedAt: &Timestamp{referenceTime},
},
}
if !cmp.Equal(ruleSet, want) {
Expand Down Expand Up @@ -683,7 +691,9 @@ func TestRepositoriesService_GetRuleset(t *testing.T) {
"name": "ruleset",
"source_type": "Organization",
"source": "o",
"enforcement": "enabled"
"enforcement": "enabled",
"created_at": `+referenceTimeStr+`,
"updated_at": `+referenceTimeStr+`
}`)
})

Expand All @@ -699,6 +709,8 @@ func TestRepositoriesService_GetRuleset(t *testing.T) {
SourceType: String("Organization"),
Source: "o",
Enforcement: "enabled",
CreatedAt: &Timestamp{referenceTime},
UpdatedAt: &Timestamp{referenceTime},
}
if !cmp.Equal(ruleSet, want) {
t.Errorf("Repositories.GetRuleset returned %+v, want %+v", ruleSet, want)
Expand Down
Loading
0