Skip to content

Commit 71c8fd3

Browse files
authored
fix(librariangen): honor original container contract (googleapis#12846)
refs: googleapis/librarian#2037
1 parent fb2bc63 commit 71c8fd3

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

internal/librariangen/release/release.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ func updateChangelog(cfg *Config, lib *Library, t time.Time) error {
117117
if changesByType[change.Type] == nil {
118118
changesByType[change.Type] = make(map[string]bool)
119119
}
120-
changesByType[change.Type][change.Description] = true
120+
changesByType[change.Type][change.Subject] = true
121121
}
122122

123123
for _, section := range changelogSections {
@@ -213,7 +213,7 @@ type Library struct {
213213
// Change represents a single commit change for a library.
214214
type Change struct {
215215
Type string `json:"type"`
216-
Description string `json:"description"`
216+
Subject string `json:"subject"`
217217
Body string `json:"body"`
218218
PiperCLNumber string `json:"piper_cl_number"`
219219
SourceCommitHash string `json:"source_commit_hash"`

internal/librariangen/release/release_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ func TestInit(t *testing.T) {
120120
"id": "secretmanager", "version": "1.16.0", "release_triggered": true,
121121
"apis": [{"path": "google/cloud/secretmanager/v1"}],
122122
"changes": [
123-
{"type": "feat", "description": "add new GetSecret API"},
124-
{"type": "fix", "description": "correct typo in documentation"}
123+
{"type": "feat", "subject": "add new GetSecret API"},
124+
{"type": "fix", "subject": "correct typo in documentation"}
125125
]
126126
}]
127127
}`,
@@ -141,7 +141,7 @@ func TestInit(t *testing.T) {
141141
},
142142
{
143143
name: "changelog already up-to-date",
144-
requestJSON: `{ "libraries": [ { "id": "secretmanager", "version": "1.16.0", "release_triggered": true, "apis": [{"path": "google/cloud/secretmanager/v1"}], "changes": [{"type": "feat", "description": "add new GetSecret API"}] } ] }`,
144+
requestJSON: `{ "libraries": [ { "id": "secretmanager", "version": "1.16.0", "release_triggered": true, "apis": [{"path": "google/cloud/secretmanager/v1"}], "changes": [{"type": "feat", "subject": "add new GetSecret API"}] } ] }`,
145145
initialRepoContent: map[string]string{
146146
"secretmanager/CHANGES.md": "# Changes\n\n### 1.16.0\n- Already there.",
147147
"internal/generated/snippets/secretmanager/apiv1/snippet_metadata.google.cloud.secretmanager.v1.json": `{"version": "1.15.0"}`,

0 commit comments

Comments
 (0)