Skip to content

Tell Dependabot not to use conventional commits #1942

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 10, 2025

Conversation

EliahKagan
Copy link
Member

Dependabot automatically examines existing commits' messages to decide what style to use, if no commit.prefix is configured. But gitoxide prefers that conventional commits be used only in limited circumstances: the "purposeful conventional commits" style detailed in DEVELOPMENT.md. Commits to bump dependencies should typically not be conventional, so Dependabot should not title its commits with prefixes that can be interpreted as meaningful conventional commits. But the style Dependabot has automatically picked here uses prefixes such as build(deps): ....

In practice this does not cause serious problems so far and is unlikely ever to cause serious problems, so it would be fine to use Dependabot even if this behavior couldn't be changed. But there are a few reasons to configure Dependabot not to do this:

  • Stylistic consistency.
  • Decrease the likelihood of future undesired behavior if we later expand the use of Dependabot, such as to enable version updates (rather than just security updates) on Rust dependencies, where it would more often affect changelogs due to far more often editing per-crate Cargo.toml files than it currently does.
  • Decrease the likelihood of future undesired behavior if a future version of cargo-smart-release treats more conventional commit prefixes specially.
  • Make commit messages slightly easier to read if one is familiar with the commit message style used in this repository.
  • Avoid giving newcomers the wrong idea about how and when commit messages in this project are expected to be conventional.

Roughly speaking, this configures Dependabot not to use any prefix. There does not appear to be any way to suppress the use of a prefix to restore the exact same behavior as if Dependabot had detected not to use a prefix (in particular, setting prefix to null produces an error and Dependabot will not use the configuration). So this instead sets an empty string as the prefix.

The difference between an empty prefix and no prefix, in terms of how Dependabot currently behaves for this repository, is that the commit message with an empty prefix does not start with a capital letter. But that is not a problem here, because we don't impose a stylistic preference as to whether to capitalize commit message titles; both styles are common, with the uncapitalized style being at least as common as the capitalized style.

To ensure this configuration works as intended, it has been tested in a fork (where force-pushing main doesn't cause any disruption). See EliahKagan#16 for details.

Dependabot automatically examines existing commits' messages to
decide what style to use, if no `commit.prefix` is configured. But
gitoxide prefers that conventional commits be used only in limited
circumstances: the "purposeful conventional commits" style detailed
in `DEVELOPMENT.md`. Commits to bump dependencies should typically
not be conventional, so Dependabot should not title its commits
with prefixes that can be interpreted as meaningful conventional
commits. But the style Dependabot has automatically picked here
uses prefixes such as `build(deps): ...`.

In practice this does not cause serious problems so far and is
unlikely ever to cause serious problems, so it would be fine to use
Dependabot even if this behavior couldn't be changed. But there are
a few reasons to configure Dependabot not to do this:

- Stylistic consistency.

- Decrease the likelihood of future undesired behavior if we later
  expand the use of Dependabot, such as to enable version updates
  (rather than just security updates) on Rust dependencies, where
  it would more often affect changelogs due to far more often
  editing per-crate `Cargo.toml` files than it currently does.

- Decrease the likelihood of future undesired behavior if a future
  version of `cargo-smart-release` treats more conventional commit
  prefixes specially.

- Make commit messages slightly easier to read if one is familiar
  with the commit message style used in this repository.

- Avoid giving newcomers the wrong idea about how and when commit
  messages in this project are expected to be conventional.

Roughly speaking, this configures Dependabot not to use any prefix.
There does not appear to be any way to suppress the use of a prefix
to restore the exact same behavior as if Dependabot had detected
not to use a prefix (in particular, setting `prefix` to `null`
produces an error and Dependabot will not use the configuration).
So this instead sets an empty string as the prefix.

The difference between an empty prefix and no prefix, in terms of
how Dependabot currently behaves for this repository, is that the
commit message with an empty prefix does not start with a capital
letter. But that is not a problem here, because we don't impose a
stylistic preference as to whether to capitalize commit message
titles; both styles are common, with the uncapitalized style being
at least as common as the capitalized style.

To ensure this configuration works as intended, it has been tested
in a fork (where force-pushing main doesn't cause any disruption).
See #16 for details.
@EliahKagan EliahKagan enabled auto-merge April 10, 2025 02:38
@EliahKagan EliahKagan merged commit bc7b685 into GitoxideLabs:main Apr 10, 2025
22 checks passed
@EliahKagan EliahKagan deleted the dependabot-commit-messages branch April 10, 2025 02:59
@EliahKagan
Copy link
Member Author

EliahKagan commented Apr 10, 2025

The failure on main when this was merged was due to #1816 and not related to the change here. I'll rerun the workflow on main.

@EliahKagan
Copy link
Member Author

EliahKagan commented Apr 10, 2025

The unprefixed commit message style can be seen in 1792178 (#1944) -- which, more importantly, offers further verification that this change does not keep Dependabot from working.

EliahKagan added a commit to EliahKagan/cargo-smart-release that referenced this pull request Apr 25, 2025
Similar to GitoxideLabs/gitoxide#1942, this
configures Dependabot to use an empty commit message prefix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant