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

Fail the build if a non-existent Maven profile is used #17198

Merged
merged 1 commit into from
Apr 25, 2023

Conversation

hashhar
Copy link
Member

@hashhar hashhar commented Apr 24, 2023

Description

By default Maven just logs a warning if a non-existent profile is specified with . Enforcer plugin has a rule to fail the build in such cases. This avoids cases where a typo or incorrect ci.yml makes the build appear green even though some expected profile wasn't used.

Release notes

(x) This is not user-visible or docs only and no release notes are required.

I noticed this while working on #17167

By default Maven just logs a warning if a non-existent profile is
specified with . Enforcer plugin has a rule to fail the build in such
cases. This avoids cases where a typo or incorrect ci.yml makes the
build appear green even though some expected profile wasn't used.
@cla-bot cla-bot bot added the cla-signed label Apr 24, 2023
@hashhar hashhar requested review from electrum and findepi April 24, 2023 05:08
Copy link
Contributor

@ksobolew ksobolew left a comment

Choose a reason for hiding this comment

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

❤️

@hashhar hashhar requested a review from kokosing April 24, 2023 13:15
@findepi
Copy link
Member

findepi commented Apr 24, 2023

Can this be a problem when i want to enable some profile (eg cloud-tests), and it exists only for some of the modules?

i am OK with the change, but I am concerned this may cause some problems somewhere later and may need revisiting.

@hashhar
Copy link
Member Author

hashhar commented Apr 25, 2023

Can this be a problem when i want to enable some profile (eg cloud-tests), and it exists only for some of the modules?

No, it verifies that the profile exists in the "build". i.e. as long as the profile is found in one of the modules the check is happy. Verified using ./mvnw test -pl :trino-bigquery,:trino-postgresql -Pcloud-tests.

@hashhar hashhar merged commit 1b617bd into trinodb:master Apr 25, 2023
@hashhar hashhar deleted the hashhar/maven-verify-profile branch April 25, 2023 06:10
@github-actions github-actions bot added this to the 415 milestone Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

5 participants