-
Notifications
You must be signed in to change notification settings - Fork 6
[NAE-2212] Cluster scope process function caches #363
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
base: release/7.0.0-rev9
Are you sure you want to change the base?
Changes from all commits
a002636
e6e8dac
6e09ba1
790659b
dd80913
7dc7947
eb56f99
93921f9
cf3dc8c
fc76808
b5bd5b5
9059bec
dfd7afd
e8441cb
0c1c914
53fb4e6
1cdfbc4
47ba662
7e0c9b8
4670f33
cf0651a
48e1411
b30c884
d7705b2
2654b7d
d457145
61f9b2e
289de0f
e9ef494
2274d62
39da22c
d82fc67
6f57b74
174c7ee
faa99d7
44c6ed7
fc637ee
6d84f5b
c039509
df89aac
3241eed
b92ba07
eb377cc
4ca7fd4
8028b98
1d7d175
9cdd0b9
d614cf9
e82c400
f7c8583
5d72517
a1e93de
5ce552c
f2cf540
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| package com.netgrif.application.engine.importer.service; | ||
|
|
||
| import com.netgrif.application.engine.objects.importer.model.Function; | ||
| import com.netgrif.application.engine.objects.importer.model.Scope; | ||
| import lombok.extern.slf4j.Slf4j; | ||
| import org.springframework.stereotype.Component; | ||
|
|
||
| @Component | ||
| @Slf4j | ||
| public class FunctionValidator implements IFunctionValidator { | ||
|
|
||
| private static final String NAMESPACE = "namespace"; | ||
|
|
||
| /** | ||
| * Validates and updates deprecated function attributes. | ||
| * <p> | ||
| * This method mutates the input function by replacing deprecated scope values. | ||
| * Specifically, it replaces the deprecated NAMESPACE scope with GLOBAL scope. | ||
| * | ||
| * @param function the function to validate and update (mutated in-place) | ||
| */ | ||
| @Override | ||
| public void checkDeprecatedAttributes(Function function) { | ||
| if (function.getScope() != null && function.getScope().value().equals(NAMESPACE)) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: find . -name "FunctionValidator.java" -type fRepository: netgrif/application-engine Length of output: 175 🏁 Script executed: # Once we find the file, let's examine it around line 24
head -40 application-engine/src/main/java/com/netgrif/application/engine/importer/service/FunctionValidator.javaRepository: netgrif/application-engine Length of output: 1147 🏁 Script executed: # Search for the Scope enum definition
find . -name "*.java" -type f | xargs rg "enum Scope" -A 10Repository: netgrif/application-engine Length of output: 54 🌐 Web query:
💡 Result: Short checklist — best practices for handling deprecated enum values during migration in Java Spring apps:
References
If you want, I can produce concrete code examples: (a) JPA AttributeConverter mapping deprecated values to new codes, (b) Jackson deserializer that tolerantly maps unknown strings, and (c) a sample Flyway SQL migration. Which one would you like first? 🏁 Script executed: find . -name "Scope.java" -type fRepository: netgrif/application-engine Length of output: 52 🏁 Script executed: # Search for Scope in the importer/model package
find . -path "*/importer/model/*" -name "*.java" -type f | head -20Repository: netgrif/application-engine Length of output: 52 🏁 Script executed: # Search for enum definitions with "Scope"
rg "class Scope|interface Scope" -t javaRepository: netgrif/application-engine Length of output: 52 🏁 Script executed: rg "Scope" -t java | grep -E "(enum|class|interface|record)" | head -20Repository: netgrif/application-engine Length of output: 204 🏁 Script executed: # Search for any mention of Scope in Java files
rg "Scope" -t java -B 2 -A 5 | head -100Repository: netgrif/application-engine Length of output: 13324 🏁 Script executed: # Look for Function.java to understand the relationship
find . -name "Function.java" -type fRepository: netgrif/application-engine Length of output: 173 🏁 Script executed: find . -path "*/importer/model/Scope.java" -type fRepository: netgrif/application-engine Length of output: 52 🏁 Script executed: rg "class Scope|interface Scope|enum Scope" -t java -B 2 -A 15 | grep -A 15 "importer/model"Repository: netgrif/application-engine Length of output: 52 🏁 Script executed: # Find all Java files in importer model package
find . -path "*/objects/importer/model/*" -name "*.java" -type fRepository: netgrif/application-engine Length of output: 52 🏁 Script executed: # Search for all files with "Scope" in name
find . -name "*Scope*" -type fRepository: netgrif/application-engine Length of output: 504 🏁 Script executed: # Try to find the Scope class in importer - broader search
rg "public class Scope|public enum Scope|public interface Scope" -t javaRepository: netgrif/application-engine Length of output: 52 🏁 Script executed: # Check what's imported in FunctionValidator more carefully
cat -n ./application-engine/src/main/java/com/netgrif/application/engine/importer/service/FunctionValidator.javaRepository: netgrif/application-engine Length of output: 1350 🏁 Script executed: # Find source files in objects/importer/model - they should be in a source directory
find . -path "*objects/importer/model*" -name "*.java" -type f | head -20Repository: netgrif/application-engine Length of output: 52 🏁 Script executed: # Search for the Scope class definition anywhere with broader approach
rg "enum Scope|class Scope" -t java --no-filename | head -10Repository: netgrif/application-engine Length of output: 52 🏁 Script executed: # List all Java files in the objects module under importer
find ./nae-object-library -path "*importer/model*" -type fRepository: netgrif/application-engine Length of output: 52 🏁 Script executed: # Try to find the Scope source - it might be in a different module structure
find . -name "Scope.java" -o -name "Scope.kt" -o -name "Scope.groovy"Repository: netgrif/application-engine Length of output: 52 🏁 Script executed: # Check all modules by listing directories with "importer" in name
find . -type d -name "*importer*" | grep -v ".git" | head -20Repository: netgrif/application-engine Length of output: 351 🏁 Script executed: # Search for @Override checkDeprecatedAttributes to see if there are other implementations
rg "checkDeprecatedAttributes" -t java -B 3 -A 10Repository: netgrif/application-engine Length of output: 30497 🏁 Script executed: # Look for files containing "enum Scope" more broadly
rg "enum Scope" -t java -B 2 -A 20Repository: netgrif/application-engine Length of output: 52 🏁 Script executed: # Check git history or look in test directories
find ./application-engine/src/test -name "*Scope*" -type fRepository: netgrif/application-engine Length of output: 52 🏁 Script executed: # Look at the FunctionFactory.java more closely to see how Scope is converted
cat -n ./application-engine/src/main/java/com/netgrif/application/engine/importer/service/FunctionFactory.javaRepository: netgrif/application-engine Length of output: 1233 🏁 Script executed: # Search more carefully for Scope - it might be in a JAR or different module
find . -type f \( -name "*.java" -o -name "*.class" \) | xargs rg "class Scope|enum Scope" 2>/dev/null | head -20Repository: netgrif/application-engine Length of output: 52 🏁 Script executed: # Look at what's imported and used in the importer model package
find ./application-engine -path "*/importer/model/*" -type fRepository: netgrif/application-engine Length of output: 52 🏁 Script executed: # Check if there's a separate objects-importer or model package
find . -type d -name "importer" | head -20Repository: netgrif/application-engine Length of output: 351 🏁 Script executed: # Let's look at the javadoc that was found earlier
cat ./docs/javadoc/com/netgrif/application/engine/importer/model/Scope.html | head -100Repository: netgrif/application-engine Length of output: 3868 🏁 Script executed: # Let's look at the javadoc more completely to understand Scope structure
grep -A 200 "Enum Constants" ./docs/javadoc/com/netgrif/application/engine/importer/model/Scope.html | head -100Repository: netgrif/application-engine Length of output: 3205 🏁 Script executed: # Look for Scope in any compiled artifacts or check if it's a generated class
find . -name "pom.xml" -o -name "build.gradle" | head -5Repository: netgrif/application-engine Length of output: 209 🏁 Script executed: # Search for where Scope.GLOBAL is referenced in the codebase
rg "Scope\.GLOBAL" -t javaRepository: netgrif/application-engine Length of output: 423 🏁 Script executed: # Look at the actual Function class in importer model by examining test files
find ./application-engine/src/test -name "*.java" -o -name "*.groovy" | xargs rg "Scope" | head -20Repository: netgrif/application-engine Length of output: 52 🏁 Script executed: # Check the actual Scope enum definition - it seems the javadoc shows it, let's find the source
find . -type f -name "*.java" | xargs rg "public enum Scope" -A 15 | grep -v "FunctionScope"Repository: netgrif/application-engine Length of output: 52 🏁 Script executed: # Look for where Scope enum is defined - check nae-spring-core-adapter
find ./nae-spring-core-adapter -name "Scope.java" -o -name "*Scope*"Repository: netgrif/application-engine Length of output: 52 🏁 Script executed: # Check if Scope.GLOBAL exists in the codebase at all
rg "GLOBAL" -t java | grep -i scopeRepository: netgrif/application-engine Length of output: 1122 🏁 Script executed: # Let's look at what constants Scope enum actually has
grep -A 50 "enum Scope" ./docs/javadoc/com/netgrif/application/engine/importer/model/Scope.html | grep -E "NAMESPACE|PROCESS|GLOBAL"Repository: netgrif/application-engine Length of output: 52 🏁 Script executed: # Let's check the actual Scope enum definition - it might be in nae-spring-core-adapter
find ./nae-spring-core-adapter -type f -name "*.java" | xargs cat | grep -A 30 "enum Scope" | head -50Repository: netgrif/application-engine Length of output: 52 🏁 Script executed: # Compile to check for errors - look at what Scope constants are available
grep -A 100 "public enum Scope" ./docs/javadoc/com/netgrif/application/engine/importer/model/Scope.html | grep -E "value|NAMESPACE|PROCESS|GLOBAL" | head -20Repository: netgrif/application-engine Length of output: 52 🏁 Script executed: # Check if there's actual source code for Scope enum - search all directories
find . -type f \( -name "*.java" -o -name "*.groovy" \) -exec grep -l "public enum Scope" {} \;Repository: netgrif/application-engine Length of output: 52 🏁 Script executed: # Let's verify what the FunctionFactory is doing - convert Scope to FunctionScope
cat -n ./application-engine/src/main/java/com/netgrif/application/engine/importer/service/FunctionFactory.java | sed -n '17,26p'Repository: netgrif/application-engine Length of output: 568 🏁 Script executed: # Check if Scope enum might be in a different module or if it's been recently modified
rg "enum Scope" --type-list all -t java -B 3 -A 20Repository: netgrif/application-engine Length of output: 459 🏁 Script executed: # Verify if Scope.GLOBAL compile error would occur - check all references to Scope.
rg "Scope\." -t java | grep -v "FunctionScope"Repository: netgrif/application-engine Length of output: 218 🏁 Script executed: # Final verification - check if there are any build issues or if GLOBAL was added recently
find . -name "Scope.java" -o -name "*Scope*.java" | grep -v "FunctionScope" | xargs cat 2>/dev/nullRepository: netgrif/application-engine Length of output: 52 🏁 Script executed: # Check test files to see if they reveal the actual Scope definition
find ./application-engine/src/test -type f \( -name "*.java" -o -name "*.groovy" \) -exec grep -l "Scope\." {} \; | head -5Repository: netgrif/application-engine Length of output: 52 Fix the broken enum reference: The 🤖 Prompt for AI Agents |
||
| log.warn("Function scope [NAMESPACE] is deprecated. Replacing with [GLOBAL]."); | ||
| function.setScope(Scope.GLOBAL); | ||
Retoocs marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
|
Comment on lines
+23
to
+28
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Find and examine the Scope enum definition
echo "=== Searching for Scope.java in importer model ==="
fd -t f 'Scope\.java' | head -20
echo -e "\n=== Checking paths to identify correct Scope enum ==="
fd -t f 'Scope\.java' -x grep -l 'enum Scope' {}
echo -e "\n=== Examining Scope enum values ==="
fd -t f 'Scope\.java' | xargs -I {} sh -c 'echo "File: {}"; cat -n {}'Repository: netgrif/application-engine Length of output: 1523 🏁 Script executed: #!/bin/bash
# Search for enum Scope definitions
echo "=== Searching for all enum Scope definitions ==="
rg 'enum Scope' -A 10
echo -e "\n=== Checking FunctionValidator imports ==="
cat -n application-engine/src/main/java/com/netgrif/application/engine/importer/service/FunctionValidator.java | head -30
echo -e "\n=== Searching for Scope in importer/model package ==="
fd -t f '\.java$' | rg 'importer/model' | xargs grep -l 'class Scope\|enum Scope' 2>/dev/null || echo "No Scope enum found in importer/model"
echo -e "\n=== All Scope-related files in importer ==="
fd -t f 'Scope\.java'Repository: netgrif/application-engine Length of output: 1688 🏁 Script executed: #!/bin/bash
# Search for all files in importer/model package
echo "=== Files in importer/model package ==="
fd -t f '\.java$' | rg 'importer/model'
echo -e "\n=== Checking if Scope class exists in importer.model package ==="
fd -t f '\.java$' | rg 'importer/model' | xargs cat | rg -B2 -A10 'class Scope|enum Scope' || echo "No Scope class/enum found"
echo -e "\n=== Full directory structure of importer/model ==="
find . -type d -path '*/importer/model' 2>/dev/null | head -5
echo -e "\n=== Contents of importer/model directory ==="
find . -type d -path '*/importer/model' -exec ls -la {} \; 2>/dev/null | head -20Repository: netgrif/application-engine Length of output: 1587 🏁 Script executed: #!/bin/bash
# Search for Scope class in objects package
echo "=== Searching for Scope in objects package ==="
fd -t f 'Scope\.java'
echo -e "\n=== Searching in importer package for Scope ==="
fd -t d 'importer' | head -10
echo -e "\n=== Looking for where Scope is actually defined ==="
rg 'class Scope|enum Scope' -l
echo -e "\n=== Checking all Java files with Scope ==="
rg 'Scope\s*\{' -A 5 | head -50
echo -e "\n=== Checking objects directory structure ==="
fd -t d 'objects' | head -5
echo -e "\n=== Looking for importer model source ==="
fd -t f '\.java$' | rg 'objects.*importer.*model' | head -20Repository: netgrif/application-engine Length of output: 1580 🏁 Script executed: #!/bin/bash
# Search for source files in importer.model package
echo "=== Looking for all Java source files in importer ==="
fd -t f '\.java$' 'importer' | head -30
echo -e "\n=== Checking nae-object-library structure ==="
fd -t d 'nae-object-library' | head -5
echo -e "\n=== Looking in nae-object-library for importer ==="
fd -t f '\.java$' | rg 'nae-object-library.*importer' | head -20
echo -e "\n=== Checking if Scope is in nae-object-library/objects ==="
find nae-object-library -name 'Scope.java' 2>/dev/null
echo -e "\n=== All Java files in nae-object-library/objects ==="
fd -t f '\.java$' nae-object-library | head -30Repository: netgrif/application-engine Length of output: 3532 🏁 Script executed: #!/bin/bash
# Comprehensive search for Scope class
echo "=== Searching for any reference to 'Scope' class definition ==="
find . -name '*.java' -type f -exec grep -l 'class Scope\|enum Scope' {} \; 2>/dev/null
echo -e "\n=== Searching for Scope in import statements ==="
find . -name '*.java' -type f -exec grep -h 'import.*Scope' {} \; 2>/dev/null | sort -u
echo -e "\n=== Checking if Scope exists anywhere ==="
rg 'Scope\s+\{' -A 3 2>/dev/null | head -50
echo -e "\n=== Listing all Java files in objects directory ==="
find . -path '*/objects/*' -name '*.java' -type f | grep -i scope
echo -e "\n=== Full content check of importer in application-engine ==="
find application-engine -name '*.java' -type f | head -20Repository: netgrif/application-engine Length of output: 3296 🏁 Script executed: #!/bin/bash
# Check where Scope might be coming from
echo "=== Looking for Scope class in all locations ==="
find . -name 'Scope.class' 2>/dev/null
echo -e "\n=== Checking pom.xml for dependencies ==="
find . -name 'pom.xml' -type f | head -3 | xargs grep -h '<artifactId>' | sort -u | head -20
echo -e "\n=== Checking if objects.importer.model package exists ==="
find . -type d -path '*/objects/importer/model' 2>/dev/null
echo -e "\n=== List all directories in objects ==="
find . -path '*/objects' -type d | head -20
echo -e "\n=== Check objects directory specifically ==="
ls -la nae-object-library/src/main/java/com/netgrif/application/engine/objects/ 2>/dev/null | head -30
echo -e "\n=== Searching for where importer model classes might be ==="
find . -path '*/objects/*' -name '*.java' | grep -i importerRepository: netgrif/application-engine Length of output: 2594 🏁 Script executed: #!/bin/bash
# Search for Function class in importer.model
echo "=== Searching for Function class ==="
find . -name 'Function.java' -type f 2>/dev/null
echo -e "\n=== Checking if importer.model is in a different location ==="
rg 'class Function|interface Function' -l | head -10
echo -e "\n=== Looking at what FunctionValidator is actually trying to import ==="
cat -n application-engine/src/main/java/com/netgrif/application/engine/importer/service/FunctionValidator.java
echo -e "\n=== Checking all imports from com.netgrif.application.engine.objects.importer ==="
rg 'com\.netgrif\.application\.engine\.objects\.importer' -l | head -20Repository: netgrif/application-engine Length of output: 4108 🏁 Script executed: #!/bin/bash
# Check for generated sources
echo "=== Checking for generated sources directory ==="
find . -type d -name 'generated-sources' 2>/dev/null | head -5
echo -e "\n=== Looking for JAXB or other code generation ==="
rg 'jaxb|xsd' pom.xml | head -20
echo -e "\n=== Check if there are XSD files ==="
find . -name '*.xsd' 2>/dev/null
echo -e "\n=== Examining pom.xml for importer model dependencies ==="
rg -A 5 -B 5 'importer.*model|objects.*importer' nae-object-library/pom.xml application-engine/pom.xml
echo -e "\n=== Check target directory for generated classes ==="
find . -path '*/target/*' -name 'Scope.class' 2>/dev/nullRepository: netgrif/application-engine Length of output: 2680 🏁 Script executed: #!/bin/bash
# Check the XSD schema for Scope definition
echo "=== Examining petriflow_schema.xsd for Scope ==="
cat application-engine/src/main/resources/petriNets/petriflow_schema.xsd | grep -A 30 -B 5 'Scope' | head -100
echo -e "\n=== Searching for enumeration values in schema ==="
rg -A 10 'name="Scope"' application-engine/src/main/resources/petriNets/petriflow_schema.xsd
echo -e "\n=== Full XSD file size ==="
wc -l application-engine/src/main/resources/petriNets/petriflow_schema.xsd
echo -e "\n=== Complete Scope definition from XSD ==="
sed -n '/name="Scope"/,/\/xs:simpleType/p' application-engine/src/main/resources/petriNets/petriflow_schema.xsdRepository: netgrif/application-engine Length of output: 313 🏁 Script executed: #!/bin/bash
# Check content of XSD files
echo "=== Content of application-engine petriflow_schema.xsd ==="
cat application-engine/src/main/resources/petriNets/petriflow_schema.xsd
echo -e "\n=== Content of nae-object-library petriflow_schema.xsd ==="
cat nae-object-library/src/main/resources/petriflow_schema.xsd | head -100
echo -e "\n=== Searching for Scope in nae-object-library XSD ==="
rg -A 20 'Scope' nae-object-library/src/main/resources/petriflow_schema.xsd | head -80
echo -e "\n=== Full size of nae-object-library XSD ==="
wc -l nae-object-library/src/main/resources/petriflow_schema.xsdRepository: netgrif/application-engine Length of output: 1032 🏁 Script executed: #!/bin/bash
# Check for compiled Scope class
echo "=== Searching for any reference to Scope enum values ==="
rg 'Scope\.' --type java | head -30
echo -e "\n=== Checking for test files that might use Scope ==="
find . -name '*Test*.java' -o -name '*Test*.groovy' | xargs rg 'Scope' 2>/dev/null | head -20
echo -e "\n=== Looking for build output or cached schema ==="
find . -type d -name '.m2' -o -name 'target' | head -5
echo -e "\n=== Checking if GLOBAL is referenced anywhere in code ==="
rg 'GLOBAL' --type java | grep -v FunctionScope | head -20
echo -e "\n=== Checking Function class to see what it expects ==="
cat -n nae-object-library/src/main/java/com/netgrif/application/engine/objects/petrinet/domain/Function.java | head -80Repository: netgrif/application-engine Length of output: 4823 🏁 Script executed: #!/bin/bash
# Examine FunctionFactory to understand Scope usage
echo "=== Examining FunctionFactory ==="
cat -n application-engine/src/main/java/com/netgrif/application/engine/importer/service/FunctionFactory.java
echo -e "\n=== Checking what happens with function scope ==="
rg -B 5 -A 5 'getScope' application-engine/src/main/java/com/netgrif/application/engine/importer/service/FunctionFactory.java
echo -e "\n=== Checking IFunctionValidator interface ==="
cat -n application-engine/src/main/java/com/netgrif/application/engine/importer/service/IFunctionValidator.javaRepository: netgrif/application-engine Length of output: 2384 🏁 Script executed: #!/bin/bash
# Check all usages of Scope enum to understand available values
echo "=== All usages of Scope enum ==="
rg 'Scope\.' --type java -B 2 -A 2
echo -e "\n=== Looking for any cached/compiled Scope definition ==="
find . -name '*.class' -path '*/importer/model/*' 2>/dev/null
echo -e "\n=== Checking git status for any uncommitted generated files ==="
git status | head -50
echo -e "\n=== Check git log for recent changes to FunctionValidator ==="
git log -p --follow -S 'Scope.GLOBAL' -- application-engine/src/main/java/com/netgrif/application/engine/importer/service/FunctionValidator.java 2>/dev/null | head -100 || echo "No git history found for this pattern"
echo -e "\n=== Checking if there's a build or compile error report ==="
find . -name '*.log' -type f | xargs grep -l 'Scope' 2>/dev/null | head -5Repository: netgrif/application-engine Length of output: 3395 🏁 Script executed: #!/bin/bash
# Check for any hints about Scope enum values
echo "=== Checking git branches and recent changes ==="
git branch -a | head -20
echo -e "\n=== Looking for any documentation about Scope enum ==="
find . -name '*.md' -o -name '*.txt' | xargs grep -l 'Scope' 2>/dev/null | head -10
echo -e "\n=== Checking if there's any mapping or documentation in comments ==="
rg 'NAMESPACE|namespace' --type java -B 3 -A 3 | head -60
echo -e "\n=== Verifying what FunctionScope values exist ==="
cat nae-object-library/src/main/java/com/netgrif/application/engine/objects/petrinet/domain/FunctionScope.java
echo -e "\n=== Checking how the conversion works in FunctionFactory ==="
cat -n application-engine/src/main/java/com/netgrif/application/engine/importer/service/FunctionFactory.java | grep -A 10 -B 10 'FunctionScope.valueOf'Repository: netgrif/application-engine Length of output: 9264 Compilation error: The This change depends on updating the external petriflow schema (https://petriflow.org/petriflow.schema.xsd) or providing a local schema override to include the 🧰 Tools🪛 GitHub Actions: Pull Request[error] 26-26: cannot find symbol: GLOBAL referenced in FunctionValidator.java. Location: com.netgrif.application.engine.objects.importer.model.Scope. Likely a missing enum/constant or import. 🤖 Prompt for AI Agents |
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| package com.netgrif.application.engine.importer.service; | ||
|
|
||
| import com.netgrif.application.engine.objects.importer.model.Function; | ||
|
|
||
| public interface IFunctionValidator extends IModelValidator { | ||
| /** | ||
| * Validates and updates deprecated function attributes. | ||
| * <p> | ||
| * This method mutates the input function by replacing deprecated scope values. | ||
| * Specifically, it replaces the deprecated NAMESPACE scope with GLOBAL scope. | ||
| * | ||
| * @param function the function to validate and update (mutated in-place) | ||
| */ | ||
| void checkDeprecatedAttributes(Function function); | ||
| } | ||
|
Comment on lines
+1
to
+15
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Find Scope.java in the importer model package
echo "=== Searching for Scope enum ==="
fd -t f 'Scope.java' 2>/dev/null | head -20
# Also search more broadly
echo ""
echo "=== Broader search for Scope class ==="
rg -t java 'enum Scope|class Scope' --max-count 10 2>/dev/null
# Check if GLOBAL value exists in Scope
echo ""
echo "=== Checking for GLOBAL in Scope-related files ==="
rg -t java 'GLOBAL' objects/importer 2>/dev/null | grep -i scope | head -20Repository: netgrif/application-engine Length of output: 301 🏁 Script executed: #!/bin/bash
# Search for FunctionValidator.java to see actual compilation error
echo "=== Looking for FunctionValidator.java ==="
fd -t f 'FunctionValidator.java' 2>/dev/null
# If found, check its content
echo ""
echo "=== Content of FunctionValidator.java (first 50 lines) ==="
fd -t f 'FunctionValidator.java' -x cat {} \; 2>/dev/null | head -50Repository: netgrif/application-engine Length of output: 2048 🏁 Script executed: #!/bin/bash
# Check directory structure of importer model package
echo "=== Importer model package structure ==="
fd 'objects/importer' -type d 2>/dev/null | head -10
# List files in the importer/model directory
echo ""
echo "=== Files in importer/model directory ==="
find . -path '*/objects/importer/model*' -type f -name '*.java' 2>/dev/null | head -20Repository: netgrif/application-engine Length of output: 153 🏁 Script executed: #!/bin/bash
# Search more broadly for Scope enum in importer context
echo "=== Searching for Scope enum/class in importer package ==="
rg -t java 'enum Scope|class Scope' --max-count 20
# Check if the imported path exists
echo ""
echo "=== Checking objects/importer directory structure ==="
find . -path '*/objects/importer*' -type d | head -20
# Try to find any file with "Scope" in importer package
echo ""
echo "=== Finding files with Scope in importer package ==="
find . -path '*/objects/importer*' -name '*Scope*' -type fRepository: netgrif/application-engine Length of output: 237 🏁 Script executed: #!/bin/bash
# Search for where Scope enum is actually defined
echo "=== All occurrences of 'enum Scope' or 'class Scope' in codebase ==="
rg 'enum Scope|class Scope' -B 2 -A 5 --max-count 20
# Also check what's imported from importer.model
echo ""
echo "=== Files in com/netgrif/application/engine/objects/importer/model ==="
find . -type d -path '*/objects/importer/model' | xargs ls -la 2>/dev/null || echo "Directory not found or no files"
# List structure
find . -path '*/objects/importer/model*' | head -30Repository: netgrif/application-engine Length of output: 1353 🏁 Script executed: #!/bin/bash
# Check if Scope.java exists at the expected location
echo "=== Looking for Scope.java in any location ==="
fd 'Scope.java' -type f
# Check the complete importer model directory
echo ""
echo "=== Complete importer package structure ==="
find . -type f -path '*/importer/model/*.java' 2>/dev/null | head -20Repository: netgrif/application-engine Length of output: 349 🏁 Script executed: #!/bin/bash
# Search for GLOBAL in the entire codebase to see if Scope enum exists anywhere
echo "=== Searching for GLOBAL enum constant ==="
rg 'GLOBAL' --max-count 30 | head -40
# Check imports of Scope to understand the issue
echo ""
echo "=== All imports of Scope ==="
rg 'import.*Scope' -A 1 -B 1
# Check what's actually in the importer/model directory by listing Java files
echo ""
echo "=== Java files in importer service directory ==="
find application-engine/src/main/java/com/netgrif/application/engine/importer -name '*.java' | head -20Repository: netgrif/application-engine Length of output: 50384 🏁 Script executed: #!/bin/bash
# Search more specifically for Scope class/enum
echo "=== Search for any Scope definition ==="
rg -t java 'enum Scope|class Scope' -A 3 | head -50
# Check if there's a Scope import that works
echo ""
echo "=== Checking actual imports in FunctionValidator ==="
rg -t java 'import.*Scope' application-engine/src/main/java/com/netgrif/application/engine/importer/service/FunctionValidator.java
# Verify if the importer model package exists and what it contains
echo ""
echo "=== List all Java files in importer service directory ==="
find application-engine/src/main/java/com/netgrif/application/engine/importer -name '*.java' -type f | head -30Repository: netgrif/application-engine Length of output: 2671 🏁 Script executed: #!/bin/bash
# Search for any files with "Scope" in the importer context
echo "=== All files with 'Scope' in importer package ==="
find application-engine/src/main/java/com/netgrif/application/engine/importer -name '*Scope*' -o -name '*scope*'
# Check if Scope enum is defined in any model package
echo ""
echo "=== Looking for model package directories ==="
find application-engine -type d -name 'model'
# Search in nae-object-library for Scope
echo ""
echo "=== Checking nae-object-library for Scope ==="
find nae-object-library -name '*Scope*.java' -type fRepository: netgrif/application-engine Length of output: 321 Interface is correct but compilation blocked by missing The interface definition, JavaDoc, and method signature are well-structured. However, 🧰 Tools🪛 GitHub Actions: Pull Request[error] 1-1: BUILD FAILURE: Compilation failed in module application-engine. See log for details. Command: mvn clean verify -DskipTests=true 🤖 Prompt for AI Agents |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,6 +33,16 @@ public interface PetriNetRepository extends MongoRepository<PetriNet, String>, Q | |
| */ | ||
| PetriNet findByIdentifierAndVersion(String identifier, Version version); | ||
|
|
||
| /** | ||
| * Finds a {@link PetriNet} entity by its identifier and defaultVersion attribute | ||
| * | ||
| * @param identifier the unique identifier of the PetriNet. | ||
| * @param defaultVersion if true, the default version will be found, otherwise the non-default version will be found | ||
| * @param pageable the pagination details. | ||
| * @return the {@link PetriNet} entity matching the given identifier and defaultVersion attribute, or {@code null} if none found. | ||
| */ | ||
| Page<PetriNet> findByIdentifierAndDefaultVersion(String identifier, boolean defaultVersion, Pageable pageable); | ||
|
Comment on lines
+36
to
+44
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Incorrect Javadoc: Method returns The Javadoc states the method returns "the {@link PetriNet} entity... or {@code null} if none found" but the actual return type is 📝 Proposed fix for Javadoc /**
* Finds a {@link PetriNet} entity by its identifier and defaultVersion attribute
*
* @param identifier the unique identifier of the PetriNet.
* @param defaultVersion if true, the default version will be found, otherwise the non-default version will be found
* @param pageable the pagination details.
- * @return the {@link PetriNet} entity matching the given identifier and defaultVersion attribute, or {@code null} if none found.
+ * @return a {@link Page} containing the matching {@link PetriNet} entities, or an empty page if none found.
*/
Page<PetriNet> findByIdentifierAndDefaultVersion(String identifier, boolean defaultVersion, Pageable pageable);🤖 Prompt for AI Agents
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is fixed in depending pull request There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Retoocs, understood! Since this will be addressed in the dependent PR (#389), the Javadoc will be corrected before this PR is merged. Thank you for clarifying. 🧠 Learnings used |
||
|
|
||
| /** | ||
| * Finds a paginated list of {@link PetriNet} entities by their identifier. | ||
| * | ||
|
|
@@ -68,4 +78,13 @@ public interface PetriNetRepository extends MongoRepository<PetriNet, String>, Q | |
| */ | ||
| @Query("{ 'roles.?0' : { $exists: true } }") | ||
| Page<PetriNet> findAllByRoleId(String roleId, Pageable pageable); | ||
|
|
||
| /** | ||
| * Find all active Petri Nets | ||
| * | ||
| * @param pageable the pagination details | ||
| * | ||
| * @return a {@link Page} of active {@link PetriNet} entities | ||
| * */ | ||
| Page<PetriNet> findAllByDefaultVersionTrue(Pageable pageable); | ||
| } | ||
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.
🧹 Nitpick | 🔵 Trivial
Clarify the Javadoc wording.
The phrase "caching global functions of PetriNet global scoped functions" is redundant. Consider simplifying to "for caching global-scoped PetriNet functions" or "for caching PetriNet functions with global scope".
📝 Proposed Javadoc improvement
📝 Committable suggestion
🤖 Prompt for AI Agents