You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/book/src/plugins/available/autoupdate-v1-alpha.md
+24-6Lines changed: 24 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,10 +11,12 @@ refresh your project scaffold, and wraps it in a GitHub Actions workflow that op
11
11
12
12
- When you don’t deviate too much from the default scaffold — ensure that you see the note about customization [here](https://book.kubebuilder.io/versions_compatibility_supportability#project-customizations).
13
13
- When you want to reduce the burden of keeping the project updated and well-maintained.
14
+
- When you want to guidance and help from AI to know what changes are needed to keep your project up to date
15
+
as to solve conflicts.
14
16
15
17
## How to Use It
16
18
17
-
0 If you want to add the `autoupdate` plugin to your project:
19
+
- If you want to add the `autoupdate` plugin to your project:
This will scaffold and GitHub Actions workflow that runs the [kubebuilder alpha update][alpha-update-command] command.
32
-
Then, whenever a new Kubebuilder release is available, it will open an Issue with a
33
-
Pull Request compare link so you can create the PR and review it, such as:
33
+
This will scaffold a GitHub Actions workflow that runs the [kubebuilder alpha update][alpha-update-command] command.
34
+
Whenever a new Kubebuilder release is available, the workflow will automatically open an **Issue** with a Pull Request compare link so you can easily create the PR and review it, such as:
The workflow will check once a week for new releases, and if there are any, it will create an Issue with a Pull Request compare link so you can create the PR and review it.
38
54
The command called by the workflow is:
39
55
@@ -45,12 +61,14 @@ The command called by the workflow is:
45
61
# --force: Completes the merge even if conflicts occur, leaving conflict markers.
46
62
# --push: Automatically pushes the resulting output branch to the 'origin' remote.
47
63
# --restore-path: Preserves specified paths (e.g., CI workflow files) when squashing.
48
-
# --open-gh-issue: Creates a GitHub issue with a link to the generated PR for review.
64
+
# --open-gh-models: Adds an AI-generated comment to the created Issue with
65
+
# a short overview of the scaffold changes and conflict-resolution guidance (If Any).
Copy file name to clipboardExpand all lines: docs/book/src/reference/commands/alpha_update.md
+71-13Lines changed: 71 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,6 +17,9 @@ You can reduce the burden of keeping your project up to date by using the
17
17
automates the process of running `kubebuilder alpha update` on a schedule
18
18
workflow when new Kubebuilder releases are available.
19
19
20
+
Moreover, you will be able to get help from AI models to understand what changes are needed to keep your project up to date
21
+
and how to solve conflicts if any be faced.
22
+
20
23
</aside>
21
24
22
25
## When to Use It
@@ -27,6 +30,7 @@ Use this command when you:
27
30
- Prefer automation over manual file editing
28
31
- Want to review scaffold changes on a separate branch
29
32
- Want to focus on resolving merge conflicts (not re-applying your custom code)
33
+
- Want an **AI-generated** overview of changes and guidance for resolving conflicts
30
34
31
35
## How It Works
32
36
@@ -64,6 +68,9 @@ The command creates three temporary branches:
64
68
-`--output-branch`: pick a custom branch name.
65
69
-`--push`: push the result to `origin` automatically.
66
70
-`--git-config`: sets git configurations.
71
+
-`--open-gh-issue`: create a GitHub issue with a checklist and compare link (requires `gh`).
72
+
-`--use-gh-models[=<model>]`: add an AI overview **comment** to that issue using `gh models`
73
+
(requires the `gh-models` extension). If used without a value, default
67
74
68
75
### Step 5: Cleanup
69
76
- Once the output branch is ready, all the temporary working branches are deleted.
@@ -143,7 +150,56 @@ make manifests generate fmt vet lint-fix
143
150
make all
144
151
```
145
152
146
-
### Changing Extra Git configs only during the run (does not change your ~/.gitconfig)_
153
+
## Using with GitHub Issues (`--open-gh-issue`) and AI (`--use-gh-models`) assistance
154
+
155
+
Pass `--open-gh-issue` to have the command create a GitHub **Issue** in your repository with:
156
+
- a pre-filled checklist of follow-up steps, and
157
+
- a compare link so you can open a PR and review the update.
158
+
159
+
If you also pass `--use-gh-models[=<model>]`, the tool posts a follow-up comment on that Issue with an AI-generated overview of the most important changes plus brief conflict-resolution guidance. When the flag is provided without a value, the default model is `openai/gpt-4o`. The AI comment uses simple, Kubebuilder-style wording and, when relevant, adds a short **Conflicts** section with commands to regenerate files. *(If the `gh models` command isn’t available, the Issue is still created; only the AI comment is skipped.)*
160
+
161
+
> **Tip:** You can run with `--dry-run` first to preview changes locally, then re-run with `--open-gh-issue` (and optionally `--use-gh-models`) when you’re ready to file the Issue.
162
+
163
+
### Examples
164
+
165
+
Create an Issue with a compare link:
166
+
```shell
167
+
kubebuilder alpha update --open-gh-issue
168
+
```
169
+
170
+
Create an Issue **and** add an AI summary using the default model:
With `--use-gh-models`, an AI comment highlights key changes and suggests how to resolve any conflicts (e.g., which files to regenerate and which commands to run):
This integrates cleanly with automation. The [`autoupdate.kubebuilder.io/v1-alpha`][autoupdate-plugin] plugin can scaffold a GitHub Actions workflow that runs the command on a schedule (e.g., weekly). When a new Kubebuilder release is available, it opens an Issue with a compare link so you can create the PR and review it.
201
+
202
+
## Changing Extra Git configs only during the run (does not change your ~/.gitconfig)_
147
203
148
204
By default, `kubebuilder alpha update` applies safe Git configs:
|`--from-version`| Kubebuilder release to update **from** (e.g., `v4.6.0`). If unset, read from the `PROJECT` file when possible. |
177
-
|`--to-version`| Kubebuilder release to update **to** (e.g., `v4.7.0`). If unset, defaults to the latest available release. |
178
-
|`--from-branch`| Git branch that holds your current project code. Defaults to `main`. |
179
-
|`--force`| Continue even if merge conflicts happen. Conflicted files are committed with conflict markers (CI/cron friendly). |
180
-
|`--show-commits`| Keep full history (do not squash). **Not compatible** with `--preserve-path`. |
181
-
|`--restore-path`| Repeatable. Paths to preserve from the base branch (repeatable). Not supported with --show-commits. (e.g., `.github/workflows`). |
182
-
|`--output-branch`| Name of the output branch. Default: `kubebuilder-update-from-<from-version>-to-<to-version>`. |
183
-
|`--push`| Push the output branch to the `origin` remote after the update completes. |
184
-
|`--git-config`| Repeatable. Pass per-invocation Git config as `-c key=value`. **Default** (if omitted): `-c merge.renameLimit=999999 -c diff.renameLimit=999999`. Your configs are applied on top. To disable defaults, include `--git-config disable`|
|`--force`| Continue even if merge conflicts happen. Conflicted files are committed with conflict markers (CI/cron friendly). |
233
+
|`--from-branch`| Git branch that holds your current project code. Defaults to `main`. |
234
+
|`--from-version`| Kubebuilder release to update **from** (e.g., `v4.6.0`). If unset, read from the `PROJECT` file when possible. |
235
+
|`--git-config`| Repeatable. Pass per-invocation Git config as `-c key=value`. **Default** (if omitted): `-c merge.renameLimit=999999 -c diff.renameLimit=999999`. Your configs are applied on top. To disable defaults, include `--git-config disable`. |
236
+
|`--open-gh-issue`| Create a GitHub issue with a pre-filled checklist and compare link after the update completes (requires `gh`). |
237
+
|`--output-branch`| Name of the output branch. Default: `kubebuilder-update-from-<from-version>-to-<to-version>`. |
238
+
|`--push`| Push the output branch to the `origin` remote after the update completes. |
239
+
|`--restore-path`| Repeatable. Paths to preserve from the base branch when squashing (e.g., `.github/workflows`). **Not supported** with `--show-commits`. |
240
+
|`--show-commits`| Keep full history (do not squash). **Not compatible** with `--restore-path`. |
241
+
|`--to-version`| Kubebuilder release to update **to** (e.g., `v4.7.0`). If unset, defaults to the latest available release. |
242
+
|`--use-gh-models`| Post an AI overview as an issue comment using `gh models`. Provide a model name; if the flag is used without a value it defaults to `openai/gpt-4o`. Requires `gh` + `gh-models` extension. Effective only when `--open-gh-issue` is also set. |
243
+
|`-h, --help`| Show help for this command. |
186
244
187
245
<asideclass="note warning">
188
246
<h1>You might need to upgrade your project first</h1>
0 commit comments