Skip to content

Add Options.FSRoot to bound pom.xml parent resolution - #37

Merged
andrew merged 1 commit into
mainfrom
fsroot-option
Jun 29, 2026
Merged

Add Options.FSRoot to bound pom.xml parent resolution#37
andrew merged 1 commit into
mainfrom
fsroot-option

Conversation

@andrew

@andrew andrew commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

pomXMLParser is the only parser that touches the filesystem: it follows <parent><relativePath> via pom.LocalFetcher so multi-module projects resolve ${project.version} and parent-defined properties. Server-side that means a pushed pom.xml can read arbitrary files relative to the process working directory.

This adds manifests.Options{FSRoot string} and threads it through a new core.FSRootParser interface that only pomXMLParser implements. With FSRoot empty (the default, and what existing Parse(filename, content) calls get), parsing is a pure function of content and the parent walk is skipped. With FSRoot set, parent lookup is jailed to that directory by pom.NewLocalFetcherFrom (git-pkgs/pom#10, released as v0.1.5).

Parse keeps its existing signature via a variadic opts ...Options so current callers compile unchanged; they lose multi-module parent resolution until they pass Options{FSRoot: repoRoot}.

@andrew
andrew marked this pull request as ready for review June 29, 2026 12:11
@andrew
andrew merged commit 24abd4c into main Jun 29, 2026
5 checks passed
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.

1 participant