Skip to content
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

feat(guided remediation): add pom.xml writing #528

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

michaelkedar
Copy link
Member

Copying over the pom.xml patch writing functionality from osv-scanner.
It's quite complicated, so I've tried to make minimal changes.

One notable change is how the writing works with local parent POMs. It now always rewrites the local parent pom.xml files, even if there are no patches. The location of the written parent poms is now relative to the written root pom.xml. (e.g. If the original pom.xml was foo/root/pom.xml with parent foo/parent/pom.xml, writing the root to bar/root/pom.xml will write its parent to bar/parent/pom.xml). To facilitate this, the output is now a path to the new manifest, rather than an io.Writer

One issue is that io/fs is read-only. I've worked around this by reading from the FS and writing the files to a path on the system. Maybe this should use something like go-billy instead?

We've vendored encoding/xml to add missing support for writing self-closing tags. I think it may be better to move this to its own fork.

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