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

Remove GenerateReleaseNotes from RepositoriesService.EditRelease #2445

Merged
merged 1 commit into from Sep 5, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions github/repos_releases.go
Expand Up @@ -26,7 +26,9 @@ type RepositoryRelease struct {
Draft *bool `json:"draft,omitempty"`
Prerelease *bool `json:"prerelease,omitempty"`
DiscussionCategoryName *string `json:"discussion_category_name,omitempty"`
GenerateReleaseNotes *bool `json:"generate_release_notes,omitempty"`

// The following fields are not used in EditRelease:
GenerateReleaseNotes *bool `json:"generate_release_notes,omitempty"`

// The following fields are not used in CreateRelease or EditRelease:
ID *int64 `json:"id,omitempty"`
Expand Down Expand Up @@ -228,7 +230,6 @@ func (s *RepositoriesService) EditRelease(ctx context.Context, owner, repo strin
Draft: release.Draft,
Prerelease: release.Prerelease,
DiscussionCategoryName: release.DiscussionCategoryName,
GenerateReleaseNotes: release.GenerateReleaseNotes,
}

req, err := s.client.NewRequest("PATCH", u, releaseReq)
Expand Down
27 changes: 13 additions & 14 deletions github/repos_releases_test.go
Expand Up @@ -273,20 +273,20 @@ func TestRepositoriesService_EditRelease(t *testing.T) {
input := &RepositoryRelease{
Name: String("n"),
DiscussionCategoryName: String("General"),
GenerateReleaseNotes: Bool(true),
// Fields to be removed:
ID: Int64(2),
CreatedAt: &Timestamp{referenceTime},
PublishedAt: &Timestamp{referenceTime},
URL: String("http://url/"),
HTMLURL: String("http://htmlurl/"),
AssetsURL: String("http://assetsurl/"),
Assets: []*ReleaseAsset{{ID: Int64(5)}},
UploadURL: String("http://uploadurl/"),
ZipballURL: String("http://zipballurl/"),
TarballURL: String("http://tarballurl/"),
Author: &User{Name: String("octocat")},
NodeID: String("nodeid"),
GenerateReleaseNotes: Bool(true),
ID: Int64(2),
CreatedAt: &Timestamp{referenceTime},
PublishedAt: &Timestamp{referenceTime},
URL: String("http://url/"),
HTMLURL: String("http://htmlurl/"),
AssetsURL: String("http://assetsurl/"),
Assets: []*ReleaseAsset{{ID: Int64(5)}},
UploadURL: String("http://uploadurl/"),
ZipballURL: String("http://zipballurl/"),
TarballURL: String("http://tarballurl/"),
Author: &User{Name: String("octocat")},
NodeID: String("nodeid"),
}

mux.HandleFunc("/repos/o/r/releases/1", func(w http.ResponseWriter, r *http.Request) {
Expand All @@ -297,7 +297,6 @@ func TestRepositoriesService_EditRelease(t *testing.T) {
want := &repositoryReleaseRequest{
Name: String("n"),
DiscussionCategoryName: String("General"),
GenerateReleaseNotes: Bool(true),
}
if !cmp.Equal(v, want) {
t.Errorf("Request body = %+v, want %+v", v, want)
Expand Down