Skip to content

Commit

Permalink
resolve TODO around amending commits
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Mason <andrew@planetscale.com>
  • Loading branch information
Andrew Mason committed Oct 8, 2023
1 parent 51ce6ec commit 88f9f43
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
9 changes: 8 additions & 1 deletion go/cobradocs_sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,14 @@ func synchronizeCobraDocs(
return nil, errors.Wrapf(err, "Failed to run cobradoc sync script in repository %s/%s to %s on Pull Request %d", website.Owner, website.Name, newBranch, prInfo.num)
}

// TODO: do we need to amend the commit to change the author to the bot?
// Amend the commit to change the author to the bot.
if err := website.Commit(ctx, "", git.CommitOpts{
Author: botCommitAuthor,
Amend: true,
NoEdit: true,
}); err != nil {
return nil, errors.Wrapf(err, "Failed to amend commit author to %s on Pull Request %d", op, prInfo.num)
}

// Push the branch
if err := website.Push(ctx, git.PushOpts{
Expand Down
9 changes: 8 additions & 1 deletion go/release_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,14 @@ func (h *ReleaseHandler) updateReleasedCobraDocs(
return nil, errors.Wrapf(err, "Failed to run cobradoc sync script in repository %s/%s to %s for %s", website.Owner, website.Name, op, version.String())
}

// TODO: do we need to amend the commit to change the author to the bot?
// Amend the commit to change the author to the bot, and change the message
// to something more appropriate.
if err := website.Commit(ctx, fmt.Sprintf("Update released cobradocs with %s", releaseMeta.url), git.CommitOpts{
Author: botCommitAuthor,
Amend: true,
}); err != nil {
return nil, errors.Wrapf(err, "Failed to amend commit author to %s for %s", op, version.String())
}

// Push the branch
if err := website.Push(ctx, git.PushOpts{
Expand Down

0 comments on commit 88f9f43

Please sign in to comment.