Make sure project is singular configuration#516
Conversation
There was a problem hiding this comment.
Pull request overview
This PR tightens what can be opened as a “project” by enforcing that the selected folder represents a single configuration directory, and updates the frontend to display configuration file tile paths relative to the actual configuration directory rather than a hard-coded marker.
Changes:
- Add backend validation so
/projects/openonly accepts paths that look like.../src/main/configurations/<configurationName>. - Update configuration overview tile naming to compute file-relative paths based on the resolved configuration directory path.
- Minor refactors/formatting tweaks in controller/service and modal UI text.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/main/java/org/frankframework/flow/project/ConfigurationProjectService.java | Enforces “singular configuration” path validation when opening from disk; minor formatting. |
| src/main/java/org/frankframework/flow/project/ConfigurationProjectController.java | Formatting-only change for the /open endpoint method signature. |
| src/main/frontend/app/utils/path-utils.ts | Removes unused helper; keeps toRelativePath for computing display-relative paths. |
| src/main/frontend/app/routes/configurations/configuration-overview.tsx | Computes tile relative paths based on the actual configuration directory node path. |
| src/main/frontend/app/routes/configurations/add-configuration-modal.tsx | Updates modal title text. |
Comments suppressed due to low confidence (3)
src/main/java/org/frankframework/flow/project/ConfigurationProjectService.java:135
openProjectFromDisknow rejects paths that are project roots containingsrc/main/configurations(as used in existing unit tests likeConfigurationProjectServiceTest#testOpenProjectFromDisk). If the new intended contract is “open only a single configuration directory”, the tests and any callers that pass the project root need to be updated to pass the configuration directory itself (…/src/main/configurations/) and ensure configuration files live under that directory.
} else if (!absolutePath.endsWith(CONFIGURATIONS_DIR + "/" + absolutePath.getFileName())) {
throw new ApiException("Provided path doesn't seem to be a singular configuration", HttpStatus.BAD_REQUEST);
}
return loadProjectAndCache(path);
}
public ConfigurationProject cloneAndOpenProject(String repoUrl, String localPath, String token) throws IOException {
src/main/java/org/frankframework/flow/project/ConfigurationProjectService.java:134
- The
endsWith(CONFIGURATIONS_DIR + "/" + absolutePath.getFileName())check hard-codes "/" and is harder to reason about than a purePathcomparison. Consider building the expected suffix as aPath(e.g.,Path.of(CONFIGURATIONS_DIR).resolve(absolutePath.getFileName())) and/or checkingabsolutePath.getParent().endsWith(Path.of(CONFIGURATIONS_DIR))so this remains robust across platforms and clearer to maintain.
return loadProjectAndCache(path);
}
src/main/java/org/frankframework/flow/project/ConfigurationProjectService.java:134
- The new BAD_REQUEST message is vague for users. Consider including what was expected (e.g. path must be under
src/main/configurations/<configurationName>), and possibly echo the provided path, so it’s clear how to fix the selection in the folder picker.
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|




Fixed being able to open directories other than the expected path of a configuration
Also fixes configuration tile names to reflect a better relative path