Skip to content

Conversation

@camilamacedo86
Copy link
Member

No description provided.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Aug 18, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: camilamacedo86

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 18, 2025
Comment on lines 117 to 125
Keep built-in defaults (renameLimit tweaks) AND add more by repeating them explicitly

```shell
kubebuilder alpha update \
--git-config merge.renameLimit=999999 \
--git-config diff.renameLimit=999999 \
--git-config merge.conflictStyle=diff3 \
--git-config rerere.enabled=true
```

Copy link
Contributor

Choose a reason for hiding this comment

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

@camilamacedo86 This section may mislead the user into thinking that those configs in the codeblock are the defaults. WDYT?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point I changed
Let me know wdyt now

@camilamacedo86
Copy link
Member Author

c/c @vitorfloriano could you please review this one?

Comment on lines 164 to 175
| `--git-config` | Repeatable. Pass per-invocation Git config as `-c key=value`. **Default** (if omitted): `-c merge.renameLimit=999999 -c diff.renameLimit=999999`. **Important**: if you pass this flag, your values **replace** the defaults. To keep them *and* add more, re-specify the defaults explicitly. |
| `-h, --help` | Show help for this command. |
Copy link
Contributor

Choose a reason for hiding this comment

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

Just to check that I understand this:

By default we set those two configs, right? If we pass any values to this flag, we won't have those two configs anymore, unless we re-add them along with the other configs we may pass.

Did I get it right?

Copy link
Member Author

Choose a reason for hiding this comment

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

I changed it a little to improve the UX
Give a look now in the docs changes and let me know wdyt?
See if you agree with for we get it merged

@camilamacedo86 camilamacedo86 force-pushed the add-git-config branch 2 times, most recently from 9b04ae3 to dc36149 Compare August 19, 2025 10:39

- **Disable defaults entirely**
```shell
kubebuilder alpha update --git-config disable
Copy link
Contributor

Choose a reason for hiding this comment

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

@camilamacedo86 What if we keep the default values UNLESS the user explicitly overrides them?

I think that would make the defaults more robust, if we believe the defaults are the way to go. But if the user disagrees, they can set THAT config as they wish.

Having three/four behaviors for this flag seems a bit confusing.

Copy link
Member Author

Choose a reason for hiding this comment

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

@camilamacedo86 What if we keep the default values UNLESS the user explicitly overrides them?

Yes

I think that would make the defaults more robust, if we believe the defaults are the way to go. But if the user disagrees, they can set THAT config as they wish.

Exactly.

Having three/four behaviors for this flag seems a bit confusing.

  • we have not inform : that has the default values
  • if set: then is default values + what is passed
  • if want to disable set : disable

I agree that is not simple
But it is an very advanaced feature so people will not tough unless they understand
I could not came with a better ux than that, if you have ideas please feel free to share

Copy link
Contributor

@vitorfloriano vitorfloriano Aug 19, 2025

Choose a reason for hiding this comment

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

We could keep the defaults regardless of the user adding different configs (ex, conflictStyle=diff3 won't remove the defaults).

The defaults would only be changed if the user explicitly does so.

That way we wouldn't need the "disable" option, and we wouldn't need to add the defaults back in just because we want other, non-related, configs as well.

And, since the configs will only be set for those specific commands, I think we can be a bit more assertive/invasive about the configs we think are the best for what we are doing in kubebuilder alpha update.

Copy link
Member Author

Choose a reason for hiding this comment

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

We could keep the defaults regardless of the user adding different configs (ex, conflictStyle=diff3 won't remove the defaults).

that is how it is.

The defaults would only be changed if the user explicitly does so.
That is how it is.
The user must add "disable"

So, not sure if I follow your idea
But we must provide a option to allow the person opt-out besides we want ensure those by default

Copy link
Contributor

Choose a reason for hiding this comment

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

that is how it is.

I understood that:

  1. There are two configs used by default
  2. If the user passes any values to --git-config, the defaults will no longer apply, even if the values passed have nothing to do with the defaults.
  3. If the user wants to pass values to --git-config AND keep the two defaults, the defaults need to be passed again.
  4. If the user wants to disable the defaults, they can pass disable.

My suggestion was that:

  1. There are two configs used by default
  2. The defaults are kept even when the user passes other configs to --git-config.
  3. The defaults are only overriden if the user passes different values to the same configs

Let me know if I got anything wrong.

Copy link
Member Author

@camilamacedo86 camilamacedo86 Aug 19, 2025

Choose a reason for hiding this comment

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

If the user passes any values to --git-config, the defaults will no longer apply,

We changed that, see: https://github.com/kubernetes-sigs/kubebuilder/pull/5017/files#diff-3c12a0b0aee4383e0a39d64d93c5286c1f1b1384396e8fc067d284711ced078cR136

  • If --git-config is not set: Then we have the defaults
  • if --git-config is set: Then we have the defaults + values informed
  • if I want to disable the defaults then I need : --git-config disable and if I wish add others I append --git-config

| `--preserve-path` | Repeatable. **Squash mode only.** After copying the merge tree to the output branch, restore these paths from the base branch (e.g., `.github/workflows`). |
| `--output-branch` | Name of the output branch. Default: `kubebuilder-update-from-<from-version>-to-<to-version>`. |
| `--push` | Push the output branch to the `origin` remote after the update completes. |
| `--git-config` | Repeatable. Pass per-invocation Git config as `-c key=value`. **Default** (if omitted): `-c merge.renameLimit=999999 -c diff.renameLimit=999999`. **Important**: if you pass this flag, your values **replace** the defaults. To keep them *and* add more, re-specify the defaults explicitly. |
Copy link
Member Author

Choose a reason for hiding this comment

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

Fix ^ Outdated

| `--from-branch` | Git branch that holds your current project code. Defaults to `main`. |
| `--force` | Continue even if merge conflicts happen. Conflicted files are committed with conflict markers (CI/cron friendly). |
| `--show-commits` | Keep full history (do not squash). **Not compatible** with `--preserve-path`. |
| `--preserve-path` | Repeatable. **Squash mode only.** After copying the merge tree to the output branch, restore these paths from the base branch (e.g., `.github/workflows`). |
Copy link
Member Author

Choose a reason for hiding this comment

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

restore-path ^

@camilamacedo86
Copy link
Member Author

Hi @vitorfloriano

I changed the the flag info in the doc.

@vitorfloriano
Copy link
Contributor

/lgtm

Nice addition for advanced users.

@k8s-ci-robot
Copy link
Contributor

@vitorfloriano: changing LGTM is restricted to collaborators

In response to this:

/lgtm

Nice addition for advanced users.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

…lacement behavior

Assisted-by: ChatGPT (OpenAI)

Co-authored-by: Vitor Floriano <vitorfloriano@users.noreply.github.com>
@camilamacedo86 camilamacedo86 added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 20, 2025
@k8s-ci-robot k8s-ci-robot merged commit 92b2824 into kubernetes-sigs:master Aug 20, 2025
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants