Skip to content
Draft
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
23 changes: 12 additions & 11 deletions pkg/cli/alpha/internal/update/helpers/open_gh_issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,24 +82,25 @@ Create a Pull Request using the URL below to review the changes and resolve conf

## Next steps

### 1. Resolve conflicts
After fixing conflicts, run:
1. Fetch the **%[4]s** branch locally:

~~~bash
make manifests generate fmt vet lint-fix
git fetch https://github.com/%[5]s %[4]s:%[4]s
git checkout %[4]s
~~~

### 2. Optional: work on a new branch
To apply the update in a clean branch, run:
2. Locate and resolve the merge conflicts.

3. After fixing conflicts, run:

~~~bash
kubebuilder alpha update --output-branch my-fix-branch
make manifests generate fmt vet lint-fix
~~~

This will create a new branch (my-fix-branch) with the update applied.
Resolve conflicts there, complete the merge locally, and push the branch.
4. Verify the changes:

### 3. Verify the changes
- Build the project
- Run tests
- Build the project
- Run tests
- Confirm everything still works

:book: **More info:** https://kubebuilder.io/reference/commands/alpha_update
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to share something like If you want to run this update manually then use alpha update.
WDYT?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the workflow has already created the updated branch, is it still necessary to run alpha update locally?

Then we would also need to inform users that they need to install the latest binary to do that...

I was also thinking about adding a link to the workflow that created the issue, so users can inspect the logs and understand what happened.

It could be something like this:


Description

Upgrade your project to use the latest scaffold changes introduced in Kubebuilder %[1]s.

See the release notes from %[3]s to %[1]s for details about the changes included in this upgrade.

What to do

A scheduled workflow already attempted this upgrade and created the branch (%[4]s) to help you in this process. You can see the logs from the workflow run in here: %[6]s 👈 ADD THIS

⚠️ Conflicts were detected during the merge.

Create a Pull Request using the URL below to review the changes and resolve conflicts manually:
%[2]s
👈 REMOVE THIS

Next steps

  1. Fetch the %[4]s branch locally:
git fetch https://github.com/%[5]s %[4]s:%[4]s
git checkout %[4]s
  1. Locate and resolve the merge conflicts.

  2. After fixing conflicts, run:

make manifests generate fmt vet lint-fix
  1. Verify the changes:
  • Build the project
  • Run tests
  • Confirm everything still works

Optional

If you wish to run this migration locally, please refer to the docs: 👈 ADD THIS TOO

📖 https://kubebuilder.io/reference/commands/alpha_update


WDYT?

Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/alpha/internal/update/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ func (opts *Update) openGitHubIssue(hasConflicts bool) error {
// Base issue body
var body string
if hasConflicts {
body = fmt.Sprintf(helpers.IssueBodyTmplWithConflicts, opts.ToVersion, createPRURL, opts.FromVersion, out)
body = fmt.Sprintf(helpers.IssueBodyTmplWithConflicts, opts.ToVersion, createPRURL, opts.FromVersion, out, repo)
} else {
body = fmt.Sprintf(helpers.IssueBodyTmpl, opts.ToVersion, createPRURL, opts.FromVersion, out)
}
Expand Down
Loading