GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [SUREFIRE-1385] Add new parameter "userPropertyVariables" to overwrite by kwin · Pull Request #762 · apache/maven-surefire

Conversation

@kwin

@kwin kwin commented Jul 15, 2024

Copy link
Copy Markdown
Member

user properties

Log overwritten properties
Clarify effective properties merging order

Following this checklist to help us incorporate your
contribution quickly and easily:

  • Make sure there is a JIRA issue filed
    for the change (usually before you start working on it). Trivial changes like typos do not
    require a JIRA issue. Your pull request should address just this issue, without
    pulling in other changes.
  • Each commit in the pull request should have a meaningful subject line and body.
  • Format the pull request title like [SUREFIRE-XXX] - Fixes bug in ApproximateQuantiles,
    where you replace SUREFIRE-XXX with the appropriate JIRA issue. Best practice
    is to use the JIRA issue title in the pull request title and in the first line of the
    commit message.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Run mvn clean install to make sure basic checks pass. A more thorough check will
    be performed on your pull request automatically.
  • You have run the integration tests successfully (mvn -Prun-its clean install).

If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.

To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.

  • I hereby declare this contribution to be licenced under the Apache License Version 2.0, January 2004

  • In any other case, please file an Apache Individual Contributor License Agreement.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@kwin
kwin requested review from michael-o and slawekjaranowski July 15, 2024 13:03
@kwin
[SUREFIRE-1385] Add new parameter "userPropertyVariables" to overwrite
476b18a
user properties

Log overwritten properties
Clarify effective properties merging order
@kwin
kwin force-pushed the feature/override-user-properties branch from 865e46d to 476b18a Compare July 15, 2024 15:57
michael-o
michael-o requested changes Jul 15, 2024
View reviewed changes

@michael-o michael-o left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Did you have if we have any documentation in site which needs updating?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@michael-o

michael-o commented Jul 15, 2024

Copy link
Copy Markdown
Member

Will happily review...

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

slawekjaranowski
slawekjaranowski reviewed Jul 15, 2024
View reviewed changes
Comment thread maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java Outdated
* @see #systemPropertyVariables
*/
@Parameter
Map<String, String> userPropertyVariables;

@slawekjaranowski slawekjaranowski Jul 15, 2024

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

From test perspective there are system properties - not a user properties.

Next parameter like this can confusing user and will be used in random.

I would like to consider changing a priority for systemPropertyVariables,
even more user can take old behavior by settings properties in project and use it in configuration.

Maybe we should don't pass a MavenSession#getUserProperties() by default to tests ....

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@kwin kwin Jul 15, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I would like to consider changing a priority for systemPropertyVariables,
...
Maybe we should don't pass a MavenSession#getUserProperties() by default to tests ....

Both approaches will potentially trigger backwards compatibility issues for certain edge cases. I don't think we can do that for a 3.x release.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@kwin kwin Jul 15, 2024

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Any suggestion for another name? As I said above, I don't think we can fix this in a backwards-compatible way without introducing another parameter...

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@michael-o michael-o Jul 15, 2024

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

@kwin The let's make it right -- after all -- with a deprecated param with retains old behavior. Surefire 4 is far away, this issue has been open for too long.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@kwin kwin Jul 15, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

let's make it right

What is right? As outlined in https://issues.apache.org/jira/browse/SUREFIRE-1385?focusedCommentId=17864170&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17864170 there is no simple solution IMHO:
The default should still be to allow overwrites with CLI arguments. Overwriting CLI arguments with plugin parameters is the edge case which we need to support on an exceptional base. I don't see a simple solution without adding a param. Please make a proposal what you consider right here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@kwin kwin Jul 15, 2024

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Not sure how this helps here. Let us focus on how you think it should work!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@kwin kwin Jul 19, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

What about a boolean parameter includeUserPropertiesInSystemProperties which is true by default (for backwards compatibility). If set to false this will prevent passing on the user properties to the provider at all. This will make the addition of the userPropertyVariables parameter obsolete from my perspective.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@kwin kwin Jul 19, 2024

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I implemented the aforementioned approach now in f8b0f57.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@michael-o michael-o Jul 20, 2024

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

OK, I will try to dedicate some to it soon.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@michael-o michael-o Jul 23, 2024

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

@slawekjaranowski I agree with you that passing user properties by default is a bad idea.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@kwin
switch to boolean toggle to use user properties as system properties
f8b0f57
the default is true for being backwards compatible
@kwin

kwin commented Jul 19, 2024

Copy link
Copy Markdown
Member Author

Did you have if we have any documentation in site which needs updating?

Maybe https://maven.apache.org/surefire/maven-surefire-plugin/examples/system-properties.html, but nothing in it becomes incorrect, but maybe worth to mention there the additional parameter.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@michael-o

michael-o commented Jul 23, 2024

Copy link
Copy Markdown
Member

I read the JIRA description and this PR. My first problem: Where is the documentation that user properties are passed to Surefire at all? Here: https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#systemPropertyVariables I see zero of the Javadoc. That is a serious problem for starters...

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

michael-o
michael-o requested changes Jul 23, 2024
View reviewed changes
Comment thread maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@kwin

kwin commented Jul 23, 2024

Copy link
Copy Markdown
Member Author

I already extended the javadoc in cd72eaa (you reviewed and approved) but for me this is only remotely related to this PR.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@michael-o

michael-o commented Jul 23, 2024

Copy link
Copy Markdown
Member

I already extended the javadoc in cd72eaa (you reviewed and approved) but for me this is only remotely related to this PR.

Ah, yes now I see. This makes sense. It was merely a side comment.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

kwin added 2 commits July 30, 2024 15:26
@kwin
Apply suggestions from PR review
f21ac96
@kwin
Extend documentation
1afafc0
@kwin
kwin force-pushed the feature/override-user-properties branch from 09ec17a to 1afafc0 Compare July 30, 2024 13:53
michael-o
michael-o approved these changes Jul 30, 2024
View reviewed changes

@michael-o michael-o left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

One nit, but the rest is fine. At someone else should have a look at this too.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@kwin
Add missing newline
4883617
@michael-o

michael-o commented Aug 2, 2024

Copy link
Copy Markdown
Member

I guess @slawekjaranowski is on vacation. Let's leave him sometime to review.

slawekjaranowski reacted with laugh emoji
All reactions
  • 😄 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

slawekjaranowski
slawekjaranowski approved these changes Aug 6, 2024
View reviewed changes

@slawekjaranowski slawekjaranowski left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Looks ok, thanks

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@kwin
kwin merged commit 4bd36a1 into master Aug 7, 2024
@kwin
kwin deleted the feature/override-user-properties branch August 7, 2024 17:11
@jira-importer

jira-importer commented Jul 4, 2025

Copy link
Copy Markdown

Resolve #2304

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@michael-o michael-o michael-o approved these changes
@slawekjaranowski slawekjaranowski slawekjaranowski approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@kwin @michael-o @jira-importer @slawekjaranowski
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.