Skip to content
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

[AMORO-3152] Make git-commit-plugin fail on no git dir configurable #3126

Merged
merged 1 commit into from
Sep 3, 2024

Conversation

klion26
Copy link
Member

@klion26 klion26 commented Aug 22, 2024

Why are the changes needed?

We add conf to fail silent when no git dir before, so that it would not block the
release process, but it may not fail in normal mode also, in this commit
we move the configuration to profile and can be enabled in the release process

Close #3125 .

Brief change log

How was this patch tested?

  • Add some test cases that check the changes thoroughly including negative and positive cases if possible

  • Add screenshots for manual tests if appropriate

  • Run test locally before making a pull request

Documentation

  • Does this pull request introduce a new feature? (no)
  • If yes, how is the feature documented? (not applicable)

@klion26
Copy link
Member Author

klion26 commented Aug 22, 2024

@zhoujinsong @zhongqishang Could you please have a look at this when you're free, thanks.

Could you please share where the release script is located in $AMORO_DIR/tools/releasing/create_binary_release.sh, if not where is it, I can change it to respect this after this commit.

@zhoujinsong
Copy link
Contributor

Could you please share where the release script is located in $AMORO_DIR/tools/releasing/create_binary_release.sh, if not where is it, I can change it to respect this after this commit.

You can add this new profile here: https://github.com/apache/amoro/blob/master/tools/releasing/create_binary_release.sh#L68

Copy link
Contributor

@zhoujinsong zhoujinsong left a comment

Choose a reason for hiding this comment

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

@klion26 Thanks for the contribution, I left some comments.

pom.xml Outdated
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>4.0.0</version>
<configuration>
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not sure if the profile plugin configuration will overwrite the default configuration or merge into the default configuration.

As you just added the new configurations, it may seem to be they will be merged into the default configuration, do we have any documentation about profile behavior about this?

Copy link
Member Author

@klion26 klion26 Aug 22, 2024

Choose a reason for hiding this comment

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

sorry for not attaching the result tested in my local env, has been attached in the end now

the configuration in the profile will overwrite these in the build configuration. the priority for the configuration is: configuration in profile(after enabled) > build configuration. can ref the resource[1][2] here.

the result after the profile enabled
image

the result for default(not enable the profile)
image

[1] https://maven.apache.org/guides/introduction/introduction-to-profiles.html?spm=5176.28103460.0.0.6077572cRnkc6p#profile-inheritance
[2] https://maven.apache.org/guides/introduction/introduction-to-the-pom.html#Project_Inheritance

@klion26 klion26 requested a review from zhoujinsong August 23, 2024 02:59
@klion26 klion26 force-pushed the git-commit-profile branch from 80dec7c to 8fd9cc7 Compare August 23, 2024 05:34
@klion26
Copy link
Member Author

klion26 commented Aug 23, 2024

After an offline discussion with @zhongqishang we reached to consense that: add a new profile to enable the no git dir check, and make the check disabled default, because this has a better experience with new user which download the code with zip format.

The code has been changed to the above change, please have a look when you're free thanks. @zhoujinsong @zhongqishang

normal build mvn396 clean package -pl '!amoro-mixed-format/amoro-mixed-format-trino' -DskipTests -Pskip-dashboard-build
WeChatWorkScreenshot_fee3c520-79b2-46ab-903f-55c62c380d30

build after the check enabled mvn396 clean package -pl '!amoro-mixed-format/amoro-mixed-format-trino' -DskipTests -Pskip-dashboard-build -Pfail-on-no-git-dir
WeChatWorkScreenshot_9c9ce7ce-80a0-433c-b27d-311dc3782d68

Copy link
Contributor

@zhongqishang zhongqishang left a comment

Choose a reason for hiding this comment

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

IMO, not failing by default is a good choice. This PR also provides the option to fail.

LGTM.

@klion26 klion26 force-pushed the git-commit-profile branch 2 times, most recently from 53942a2 to 96bc056 Compare September 2, 2024 12:49
We add conf to fail silent when no git dir before, so that it would not block the
release process, but it may not fail in normal mode also, in this commit
we add a profile to enable the check, so that build will fail when no git dir found.
@klion26
Copy link
Member Author

klion26 commented Sep 2, 2024

The pr changed to using a profile with configuration inspired by @zhoujinsong

The result can be found below

WeChatWorkScreenshot_32715e4b-c883-4d0e-822c-dc5e0295fb52 WeChatWorkScreenshot_8cf631f0-fd12-46ab-9070-5e0d2bde34ed

@zhoujinsong zhoujinsong merged commit d26fc02 into apache:master Sep 3, 2024
4 checks passed
@zhoujinsong
Copy link
Contributor

Thanks for the contribution! @klion26

@klion26
Copy link
Member Author

klion26 commented Sep 5, 2024

@zhoujinsong @zhongqishang thanks for the review and merging!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Improvement]: Move failOnNoGitDirectory of git-commit-plugin to profile
3 participants