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

RHPAM-4889: using a feature flag to enable/disable strict mode. #1606

Merged
merged 2 commits into from
Feb 15, 2024

Conversation

porcelli
Copy link
Member

Introducing a new environment variable jbpm.wb.querymode with possible values DEFAULT or STRICT.

If used Strict mode, the queries will be filtered.

By default it'll continue behave as before, without filtering the queries.

… STRICT) to enable/disable strict mode. by default it'll continue behave as before this change.
Copy link

@martinweiler martinweiler left a comment

Choose a reason for hiding this comment

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

Nice solution @porcelli

Copy link
Member

@elguardian elguardian left a comment

Choose a reason for hiding this comment

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

I disagree with the solution. in my opinion is not a good solution as it is to restricted.
I would create a property like

"jbpm.wb.query.location" where you can specify where to find the query definitions.

we look first in the resources on the class loader and after in the file system (if not found). so it lets the control to the user.

@porcelli
Copy link
Member Author

have a file provided by user is not a bad idea, in the other hand none of those files were supposed to leak to users.... and any inconsistency will break BC.
using external files is also a bit more painful in OpenShift environment....

I think a compromised solution, still scoping to minimal possible impact due to product:codebase lifecycle... we could have the strict file being asked by input... and strict file basically only cares about the pair of query name and target.

@elguardian elguardian self-requested a review February 15, 2024 14:26
@elguardian
Copy link
Member

unblocking this. but disagree with the solution as an URI will be more effective in the future.

@porcelli porcelli merged commit a518726 into kiegroup:main Feb 15, 2024
0 of 3 checks passed
@mareknovotny
Copy link
Member

guys you merged PR change with RED CI, i will revert it

[2024-02-15T14:48:00.641Z] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-pmd-plugin:3.10.0:check (default) on project jbpm-wb-kie-server-backend: You have 2 PMD violations. For more details see: /home/jenkins/workspace/KIE/main/pullrequest/jbpm-wb-main.pr/bc/kiegroup_jbpm-wb/jbpm-wb-kie-server/jbpm-wb-kie-server-backend/target/pmd.xml -> [Help 1]
[2024-02-15T14:48:00.641Z] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-pmd-plugin:3.10.0:check (default) on project jbpm-wb-kie-server-backend: You have 2 PMD violations. For more details see: /home/jenkins/workspace/KIE/main/pullrequest/jbpm-wb-main.pr/bc/kiegroup_jbpm-wb/jbpm-wb-kie-server/jbpm-wb-kie-server-backend/target/pmd.xml
[2024-02-15T14:48:00.641Z]     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
[2024-02-15T14:48:00.641Z]     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
[2024-02-15T14:48:00.641Z]     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
[2024-02-15T14:48:00.642Z]     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
[2024-02-15T14:48:00.642Z]     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
[2024-02-15T14:48:00.642Z]     at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
[2024-02-15T14:48:00.642Z]     at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
[2024-02-15T14:48:00.642Z]     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
[2024-02-15T14:48:00.642Z]     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
[2024-02-15T14:48:00.642Z]     at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
[2024-02-15T14:48:00.642Z]     at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
[2024-02-15T14:48:00.642Z]     at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
[2024-02-15T14:48:00.642Z]     at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
[2024-02-15T14:48:00.642Z]     at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
[2024-02-15T14:48:00.642Z]     at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
[2024-02-15T14:48:00.642Z]     at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
[2024-02-15T14:48:00.642Z]     at java.lang.reflect.Method.invoke (Method.java:566)
[2024-02-15T14:48:00.642Z]     at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
[2024-02-15T14:48:00.642Z]     at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
[2024-02-15T14:48:00.642Z]     at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
[2024-02-15T14:48:00.642Z]     at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[2024-02-15T14:48:00.642Z] Caused by: org.apache.maven.plugin.MojoFailureException: You have 2 PMD violations. For more details see: /home/jenkins/workspace/KIE/main/pullrequest/jbpm-wb-main.pr/bc/kiegroup_jbpm-wb/jbpm-wb-kie-server/jbpm-wb-kie-server-backend/target/pmd.xml
[2024-02-15T14:48:00.642Z]     at org.apache.maven.plugins.pmd.AbstractPmdViolationCheckMojo.executeCheck (AbstractPmdViolationCheckMojo.java:156)
[2024-02-15T14:48:00.642Z]     at org.apache.maven.plugins.pmd.PmdViolationCheckMojo.execute (PmdViolationCheckMojo.java:82)
[2024-02-15T14:48:00.642Z]     at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
[2024-02-15T14:48:00.642Z]     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
[2024-02-15T14:48:00.642Z]     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
[2024-02-15T14:48:00.642Z]     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
[2024-02-15T14:48:00.642Z]     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
[2024-02-15T14:48:00.642Z]     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
[2024-02-15T14:48:00.642Z]     at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
[2024-02-15T14:48:00.642Z]     at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
[2024-02-15T14:48:00.642Z]     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
[2024-02-15T14:48:00.642Z]     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
[2024-02-15T14:48:00.642Z]     at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
[2024-02-15T14:48:00.642Z]     at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
[2024-02-15T14:48:00.642Z]     at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
[2024-02-15T14:48:00.642Z]     at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
[2024-02-15T14:48:00.642Z]     at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
[2024-02-15T14:48:00.642Z]     at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
[2024-02-15T14:48:00.642Z]     at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
[2024-02-15T14:48:00.642Z]     at java.lang.reflect.Method.invoke (Method.java:566)
[2024-02-15T14:48:00.642Z]     at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
[2024-02-15T14:48:00.642Z]     at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
[2024-02-15T14:48:00.642Z]     at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
[2024-02-15T14:48:00.642Z]     at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)

mareknovotny added a commit that referenced this pull request Feb 21, 2024
porcelli added a commit to porcelli/jbpm-wb that referenced this pull request Feb 21, 2024
…roup#1606)

* RHPAM-4889: using a feature flag (jbpm.wb.querymode values DEFAULT or STRICT) to enable/disable strict mode. by default it'll continue behave as before this change.

* RHPAM-4889: reducing duplication.
@porcelli
Copy link
Member Author

my bad @mareknovotny - have an updated PR that re-introduces the fix without the PMD issues -> #1607

yesamer pushed a commit to yesamer/jbpm-wb that referenced this pull request Mar 22, 2024
…roup#1606)

* RHPAM-4889: using a feature flag (jbpm.wb.querymode values DEFAULT or STRICT) to enable/disable strict mode. by default it'll continue behave as before this change.

* RHPAM-4889: reducing duplication.
mareknovotny pushed a commit that referenced this pull request Mar 26, 2024
…om openshift env vars (#1608)

* RHPAM-4889: using a feature flag to enable/disable strict mode. (#1606)

* RHPAM-4889: using a feature flag (jbpm.wb.querymode values DEFAULT or STRICT) to enable/disable strict mode. by default it'll continue behave as before this change.

* RHPAM-4889: reducing duplication.

* RHPAM-4889: adjustments to make it easier to consume from openshift env vars

* Code review addressed

---------

Co-authored-by: Alex Porcelli <alex@porcelli.me>
mareknovotny added a commit that referenced this pull request Jul 4, 2024
…t env vars (#1607)

* RHPAM-4889: using a feature flag to enable/disable strict mode. (#1606)

* RHPAM-4889: using a feature flag (jbpm.wb.querymode values DEFAULT or STRICT) to enable/disable strict mode. by default it'll continue behave as before this change.

* RHPAM-4889: reducing duplication.

* RHPAM-4889: adjustments to make it easier to consume from openshift env vars

* to solve @tomasdavidorg review comment

---------

Co-authored-by: Marek Novotný <hotmana76@gmail.com>
github-actions bot pushed a commit that referenced this pull request Jul 4, 2024
…t env vars (#1607)

* RHPAM-4889: using a feature flag to enable/disable strict mode. (#1606)

* RHPAM-4889: using a feature flag (jbpm.wb.querymode values DEFAULT or STRICT) to enable/disable strict mode. by default it'll continue behave as before this change.

* RHPAM-4889: reducing duplication.

* RHPAM-4889: adjustments to make it easier to consume from openshift env vars

* to solve @tomasdavidorg review comment

---------

Co-authored-by: Marek Novotný <hotmana76@gmail.com>
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.

5 participants