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

Revert disable.Pnpm logic #7405

Merged
merged 6 commits into from
Jan 23, 2020
Merged

Revert disable.Pnpm logic #7405

merged 6 commits into from
Jan 23, 2020

Conversation

denis-anisimov
Copy link
Contributor

@denis-anisimov denis-anisimov commented Jan 22, 2020

Fixes #7398


This change is Reviewable

Copy link
Contributor

@pleku pleku left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 18 files at r1.
Reviewable status: 2 unresolved discussions, 0 of 1 LGTMs obtained (waiting on @denis-anisimov)

a discussion (no related file):
As discussed with @mstahv , it might be good to split this change into two phases:

  1. rename the parameter (this definitely needs to be done)
  2. switch the default from pnpm to npm.

This is due to it being still debated if we make the switch or not.
Also the 1) should be picked to master branch.



flow-maven-plugin/src/main/java/com/vaadin/flow/plugin/maven/BuildFrontendMojo.java, line 137 at r1 (raw file):

pnpmEnable

should this be pnpm.enable instead ? Can it refer to value in Contants.java:

public static final String SERVLET_PARAMETER_ENABLE_PNPM = "pnpm.enable";

OLD Vaadin Flow ongoing work (Vaadin 10+) automation moved this from External Reviews to Changes Requested Jan 22, 2020
Copy link
Contributor

@pleku pleku left a comment

Choose a reason for hiding this comment

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

Reviewable status: 2 unresolved discussions, 0 of 1 LGTMs obtained (waiting on @denis-anisimov)

a discussion (no related file):

Previously, pleku (Pekka Hyvönen) wrote…

As discussed with @mstahv , it might be good to split this change into two phases:

  1. rename the parameter (this definitely needs to be done)
  2. switch the default from pnpm to npm.

This is due to it being still debated if we make the switch or not.
Also the 1) should be picked to master branch.

Sorry I should have realized the split before, but just didn't. The parameter needs to be renamed in v15 too and thus it should go to master.


Copy link
Contributor Author

@denis-anisimov denis-anisimov left a comment

Choose a reason for hiding this comment

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

Reviewable status: 2 unresolved discussions, 0 of 1 LGTMs obtained (waiting on @denis-anisimov and @pleku)


flow-maven-plugin/src/main/java/com/vaadin/flow/plugin/maven/BuildFrontendMojo.java, line 137 at r1 (raw file):

Previously, pleku (Pekka Hyvönen) wrote…
pnpmEnable

should this be pnpm.enable instead ? Can it refer to value in Contants.java:

public static final String SERVLET_PARAMETER_ENABLE_PNPM = "pnpm.enable";

Tried that.
Maven doesn't accept dots in properties.
Or I don't know how to make it properly.

Copy link
Contributor

@pleku pleku left a comment

Choose a reason for hiding this comment

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

Reviewable status: 1 unresolved discussion, 0 of 1 LGTMs obtained (waiting on @denis-anisimov)


flow-maven-plugin/src/main/java/com/vaadin/flow/plugin/maven/BuildFrontendMojo.java, line 137 at r1 (raw file):

Previously, denis-anisimov (Denis) wrote…

Tried that.
Maven doesn't accept dots in properties.
Or I don't know how to make it properly.

Ok, I don't understand how it was then disable.pnpm before. Maybe it didn't even work before ?

Copy link
Contributor Author

@denis-anisimov denis-anisimov left a comment

Choose a reason for hiding this comment

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

Reviewable status: 1 unresolved discussion, 0 of 1 LGTMs obtained (waiting on @denis-anisimov)


flow-maven-plugin/src/main/java/com/vaadin/flow/plugin/maven/BuildFrontendMojo.java, line 137 at r1 (raw file):

Previously, pleku (Pekka Hyvönen) wrote…

Ok, I don't understand how it was then disable.pnpm before. Maybe it didn't even work before ?

:(((((

My memory is terrible.

property name may contain dots. You are right.
The parameter name can't contain dots (java name can't contain of course but there is away to
use name in the annotation and the name can't contain dots).

I'm confusing the property name and the parameter name.
Right. Will change the property name to one with dot.

Copy link
Contributor Author

@denis-anisimov denis-anisimov left a comment

Choose a reason for hiding this comment

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

Reviewable status: 1 unresolved discussion, 0 of 1 LGTMs obtained (waiting on @mstahv)

a discussion (no related file):

Previously, pleku (Pekka Hyvönen) wrote…

Sorry I should have realized the split before, but just didn't. The parameter needs to be renamed in v15 too and thus it should go to master.

OK, then it's good that I've created the PR in the master branch by mistake.


Copy link
Contributor

@pleku pleku left a comment

Choose a reason for hiding this comment

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

Reviewed 12 of 18 files at r1, 5 of 6 files at r2.
Reviewable status: 2 unresolved discussions, 0 of 1 LGTMs obtained (waiting on @denis-anisimov and @mstahv)


flow-migration/src/main/java/com/vaadin/flow/migration/MigrationConfiguration.java, line 351 at r2 (raw file):

public void setEnablePnpm(boolean enable) {

While this is now 1-1 with the property name, it doesn't match the getter.

I would rename this and the to setPnpmEnabled(boolean enabled) and similarly the property. Alternative would be to rename the getter to match this setter isEnablePnpm(), but because it is horrible, I would use the first.


flow-server/src/main/java/com/vaadin/flow/server/Constants.java, line 220 at r2 (raw file):

    /**
     * Configuration parameter name for enabling pnpm.
     */

BTW this is missing an empty since tag (could even use since 2.2 now)

Copy link
Contributor Author

@denis-anisimov denis-anisimov left a comment

Choose a reason for hiding this comment

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

Reviewable status: 1 unresolved discussion, 0 of 1 LGTMs obtained (waiting on @pleku)


flow-migration/src/main/java/com/vaadin/flow/migration/MigrationConfiguration.java, line 351 at r2 (raw file):

Previously, pleku (Pekka Hyvönen) wrote…
public void setEnablePnpm(boolean enable) {

While this is now 1-1 with the property name, it doesn't match the getter.

I would rename this and the to setPnpmEnabled(boolean enabled) and similarly the property. Alternative would be to rename the getter to match this setter isEnablePnpm(), but because it is horrible, I would use the first.

Done.

setPnpmEnabled : OK
property: pnpmEnabled I would say this is a bad parameter name.
It's used in the pom file as <pnpmEnabled> and I think <pnpmEnable>true</pnpmEnable> is more suitable.

But I can change it it you think it should be changed.

OLD Vaadin Flow ongoing work (Vaadin 10+) automation moved this from Changes Requested to Reviewer approved Jan 23, 2020
Copy link
Contributor

@pleku pleku left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 4 of 4 files at r3.
Reviewable status: :shipit: complete! all discussions resolved, 1 of 1 LGTMs obtained

@vaadin-bot
Copy link
Collaborator

SonarQube analysis reported 11 issues

  • CRITICAL 2 critical
  • MAJOR 5 major
  • INFO 4 info

Top 10 extra issues

Note: The following issues were found on lines that were not modified in the pull request. Because these issues can't be reported as line comments, they are summarized here:

  1. CRITICAL Migration.java#L77: Either log or rethrow this exception. rule
  2. CRITICAL MigrationConfiguration.java#L125: First sentence of Javadoc is incomplete (period is missing) or not present. rule
  3. MAJOR Migration.java#L68: Refactor this method to reduce its Cognitive Complexity from 22 to the 15 allowed. rule
  4. MAJOR Migration.java#L78: Define and throw a dedicated exception instead of using a generic one. rule
  5. MAJOR Migration.java#L145: Refactor this method to reduce its Cognitive Complexity from 20 to the 15 allowed. rule
  6. MAJOR Migration.java#L145: Refactor this method to throw at most one checked exception instead of: com.vaadin.flow.migration.MigrationToolsException, com.vaadin.flow.migration.MigrationFailureException rule
  7. MAJOR Migration.java#L293: Exceptional return value of java.io.File.delete() ignored in com.vaadin.flow.migration.Migration.lambda$removeOriginalResources$0(File, String) rule
  8. INFO Migration.java#L88: Possible null pointer dereference in new com.vaadin.flow.migration.Migration(MigrationConfiguration) due to return value of called method rule
  9. INFO MigrationConfiguration.java#L95: com.vaadin.flow.migration.MigrationConfiguration.getResourceDirectories() may expose internal representation by returning MigrationConfiguration.resourceDirectories rule
  10. INFO MigrationConfiguration.java#L158: com.vaadin.flow.migration.MigrationConfiguration.getJavaSourceDirectories() may expose internal representation by returning MigrationConfiguration.javaSourceDirectories rule

@pleku pleku merged commit 4d8b122 into master Jan 23, 2020
OLD Vaadin Flow ongoing work (Vaadin 10+) automation moved this from Reviewer approved to Done - pending release Jan 23, 2020
@pleku pleku deleted the 7398-npm branch January 23, 2020 09:39
denis-anisimov pushed a commit that referenced this pull request Jan 23, 2020
denis-anisimov pushed a commit that referenced this pull request Jan 23, 2020
@denis-anisimov denis-anisimov added this to the 2.2.0.alpha11 milestone Jan 24, 2020
@pleku pleku modified the milestones: 2.2.0.alpha11, 2.2.0.alpha12 Jan 24, 2020
@denis-anisimov denis-anisimov moved this from Done - pending release to Released in OLD Vaadin Flow ongoing work (Vaadin 10+) Jan 24, 2020
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.

Rename disable.pnpm to pnpm.enable
3 participants