Skip to content

Commit 710e85a

Browse files
authored
feat(librarian): rename source_commit_hash to commit_hash (#2224)
For now we will support the old field as well until currently onboarded languages have a chance to source the new field instead. Fixes: #2107
1 parent dd44dbf commit 710e85a

File tree

11 files changed

+207
-175
lines changed

11 files changed

+207
-175
lines changed

doc/language-onboarding.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,14 +272,14 @@ global file edits. The libraries that are being released will be marked by the `
272272
"subject": "add new UpdateRepository API",
273273
"body": "This adds the ability to update a repository's properties.",
274274
"piper_cl_number": "786353207",
275-
"source_commit_hash": "9461532e7d19c8d71709ec3b502e5d81340fb661"
275+
"commit_hash": "9461532e7d19c8d71709ec3b502e5d81340fb661"
276276
},
277277
{
278278
"type": "docs",
279279
"subject": "fix typo in BranchRule comment",
280280
"body": "",
281281
"piper_cl_number": "786353207",
282-
"source_commit_hash": "9461532e7d19c8d71709ec3b502e5d81340fb661"
282+
"commit_hash": "9461532e7d19c8d71709ec3b502e5d81340fb661"
283283
}
284284
],
285285
"apis": [

internal/conventionalcommits/conventional_commits.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,10 @@ type ConventionalCommit struct {
6464
// IsNested indicates if the commit is a nested commit.
6565
IsNested bool `yaml:"-" json:"-"`
6666
// SHA is the full commit hash.
67+
// Deprecated: use CommitHash instead.
6768
SHA string `yaml:"-" json:"source_commit_hash,omitempty"`
69+
// CommitHash is the full commit hash.
70+
CommitHash string `yaml:"-" json:"commit_hash,omitempty"`
6871
// When is the timestamp of the commit.
6972
When time.Time `yaml:"-" json:"-"`
7073
}
@@ -218,6 +221,7 @@ func parseSimpleCommit(commitPart commitPart, commit *gitrepo.Commit, libraryID
218221
IsBreaking: header.IsBreaking || footerIsBreaking,
219222
IsNested: commitPart.isNested,
220223
SHA: commit.Hash.String(),
224+
CommitHash: commit.Hash.String(),
221225
When: commit.When,
222226
})
223227
}

0 commit comments

Comments
 (0)