Skip to content

Make sure project is singular configuration#516

Merged
Matthbo merged 5 commits into
masterfrom
issue/501-path-is-fake
May 29, 2026
Merged

Make sure project is singular configuration#516
Matthbo merged 5 commits into
masterfrom
issue/501-path-is-fake

Conversation

@Matthbo
Copy link
Copy Markdown
Member

@Matthbo Matthbo commented May 27, 2026

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

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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/open only 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

  • openProjectFromDisk now rejects paths that are project roots containing src/main/configurations (as used in existing unit tests like ConfigurationProjectServiceTest#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 pure Path comparison. Consider building the expected suffix as a Path (e.g., Path.of(CONFIGURATIONS_DIR).resolve(absolutePath.getFileName())) and/or checking absolutePath.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.

Comment thread src/main/frontend/app/utils/path-utils.ts Outdated
Comment thread src/main/java/org/frankframework/flow/project/ConfigurationProjectService.java Outdated
Comment thread src/main/java/org/frankframework/flow/project/ConfigurationProjectService.java Outdated
@Matthbo
Copy link
Copy Markdown
Member Author

Matthbo commented May 28, 2026

image

Updated the styling a little too

@Matthbo Matthbo requested a review from philipsens May 28, 2026 16:17
@sonarqubecloud
Copy link
Copy Markdown

@Matthbo Matthbo linked an issue May 28, 2026 that may be closed by this pull request
@Matthbo Matthbo merged commit 3737a1e into master May 29, 2026
5 checks passed
@Matthbo Matthbo deleted the issue/501-path-is-fake branch May 29, 2026 07:43
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.

None singular configurations can be opened as project still New configuration in overview results in a new src/ nesting

3 participants