Skip to content

Conversation

@kou
Copy link
Member

@kou kou commented Jun 13, 2025

Rationale for this change

Ubuntu 22.04 ships pre-commit 2.17.0. So we should support pre-commit 2.17.0 for easy to develop.

What changes are included in this PR?

  • Use a bit older shfmt pre-commit configuration for pre-commit 2.17.0
  • Use Ubuntu 22.04 on CI to ensure working on Ubuntu 22.04

Are these changes tested?

Yes.

Are there any user-facing changes?

No.

@github-actions
Copy link

⚠️ GitHub issue #46798 has been automatically assigned in GitHub to PR creator.

@github-actions github-actions bot added the awaiting committer review Awaiting committer review label Jun 13, 2025
Copy link
Member

@assignUser assignUser left a comment

Choose a reason for hiding this comment

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

I am -0.5 on this. With pre-commit being a normal python package that can be easily installed I don't think we should limit ourselves to OS provided versions.

Though in this case I doubt there are many differences between the two versions? If some other hook needs a newer version we can always reconsider.

@kou
Copy link
Member Author

kou commented Jun 13, 2025

I am -0.5 on this. With pre-commit being a normal python package that can be easily installed I don't think we should limit ourselves to OS provided versions.

I can understand your opinion but there are developers/contributors who aren't familiar with Python packages because this repository has many language implementations. So I want to reduce developers/contributors costs to prepare their development environment.

Though in this case I doubt there are many differences between the two versions? If some other hook needs a newer version we can always reconsider.

I'm OK with this approach. We may require more recent pre-commit when we need it before Ubuntu 22.04 reaches EOL.

Copy link
Member

@assignUser assignUser left a comment

Choose a reason for hiding this comment

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

Yeah, makes sense 👍

@thisisnic
Copy link
Member

thisisnic commented Jun 13, 2025

I am -0.5 on this. With pre-commit being a normal python package that can be easily installed I don't think we should limit ourselves to OS provided versions.

I'm neutral on what approach we take but we absolutely should make sure we're not introducing additional friction for developers. If we choose not to support the older version, we should at least be very explicit about installation method in our docs then - i.e. that you must install the package using pip not apt.

The error message from pre-commit in the case of an older version doesn't make it obvious why it's not working. Took a good chunk of time and frustration (until dumping the error into an LLM worked) to solve it when I ran into this.

Though in this case I doubt there are many differences between the two versions? If some other hook needs a newer version we can always reconsider.

The pre-commit command itself seems to not be part of earlier versions (see my error message on linked ticket).

@kou
Copy link
Member Author

kou commented Jun 13, 2025

OK. Let's use this approach (developers/contributors can use their common ways to install pre-commit. e.g. apt on Ubuntu) for now. We can revisit how to solve this when we get a new report.

@kou kou merged commit 69f55f0 into apache:main Jun 13, 2025
6 of 7 checks passed
@kou kou deleted the pre-commit-ubuntu-22.04 branch June 13, 2025 07:13
@kou kou removed the awaiting committer review Awaiting committer review label Jun 13, 2025
@assignUser
Copy link
Member

@thisisnic yeah the error message is not great. The shfmt hook makes use of a feature only introduced in newer version so it sets a lower limit. I don't understand why the error doesn't say that...

Unless there is a feature we want to use in newer version/hooks I'm fine with making this apt compatible!

alinaliBQ pushed a commit to Bit-Quill/arrow that referenced this pull request Jun 17, 2025
…6799)

### Rationale for this change

Ubuntu 22.04 ships pre-commit 2.17.0. So we should support pre-commit 2.17.0 for easy to develop.

### What changes are included in this PR?

* Use a bit older shfmt pre-commit configuration for pre-commit 2.17.0
* Use Ubuntu 22.04 on CI to ensure working on Ubuntu 22.04

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.
* GitHub Issue: apache#46798

Authored-by: Sutou Kouhei <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
@conbench-apache-arrow
Copy link

After merging your PR, Conbench analyzed the 0 benchmarking runs that have been run so far on merge-commit 69f55f0.

None of the specified runs were found on the Conbench server.

The full Conbench report has more details.

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.

3 participants