Skip to content

Commit b767954

Browse files
committed
Always exclude root pom.xml from fast workflow module detection
- Add explicit exclusion of root pom.xml in test_discovery.py - Prevents root module (.) from appearing in affected modules list - Adds Ollama-specific conditional logic to only start Ollama for Ollama modules - Ensures fast workflows stay targeted and don't trigger full builds This fixes the MCP commit test that was incorrectly including root module and triggering full project build instead of targeted MCP module testing. Signed-off-by: [email protected]
1 parent 4887090 commit b767954

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

.github/scripts/test_discovery.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,15 @@ def _find_module_for_file(self, file_path: str) -> Optional[str]:
142142

143143
def _is_relevant_file(self, file_path: str) -> bool:
144144
"""Check if a file is relevant for module discovery"""
145+
# Always exclude root pom.xml to prevent full builds
146+
if file_path == 'pom.xml':
147+
return False
148+
145149
# Include Java source and test files
146150
if file_path.endswith('.java'):
147151
return True
148152

149-
# Include build files
153+
# Include build files (but not root pom.xml - handled above)
150154
if file_path.endswith('pom.xml'):
151155
return True
152156

.github/workflows/main-push-fast.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,14 @@ jobs:
8383
8484
if [ -n "$MODULE_LIST" ]; then
8585
echo "Affected modules detected: $MODULE_LIST"
86-
echo "needs_ollama=true" >> "$GITHUB_OUTPUT"
86+
# Only start Ollama if we're testing Ollama-specific modules
87+
if echo "$MODULE_LIST" | grep -q "ollama"; then
88+
echo "Ollama-related modules detected - Ollama service needed"
89+
echo "needs_ollama=true" >> "$GITHUB_OUTPUT"
90+
else
91+
echo "Non-Ollama modules detected - Ollama service not needed"
92+
echo "needs_ollama=false" >> "$GITHUB_OUTPUT"
93+
fi
8794
else
8895
echo "No affected modules detected - only workflow/docs changes"
8996
echo "needs_ollama=false" >> "$GITHUB_OUTPUT"

0 commit comments

Comments
 (0)