GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — chore: refactor maven autodiscovery manifest template by olblak · Pull Request #10989 · updatecli/updatecli

Conversation

@olblak

@olblak olblak commented Oct 22, 2026 •
edited by coderabbitai Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

This pullrequest is a refactoring in preparation of upcoming maven pullrequest

Test

To test this pull request, you can run the following commands:

cd pkg/plugins/autodiscovery/maven
go test

Additional Information

Checklist

  • I have updated the documentation via pull request in website repository.
  • I have tested this pull request manually with a custom Updatecli build and it works as expected.

Tradeoff

Potential improvement

Summary by CodeRabbit

  • Bug Fixes
    • Maven dependency and parent POM manifests now apply configured version filters consistently.
    • Maven projects without repositories can be discovered without adding a repository section to their manifests.
    • A manifest that cannot be rendered is skipped, while discovery continues for other dependencies or parent POMs, so one rendering issue does not prevent other results from being found.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
olblak added 2 commits October 22, 2026 20:18
@olblak
fix(autodiscovery/maven): keep the version filter without repositories
24df2b1
The versionfilter of the generated source was only written when the
pom.xml or settings.xml declares repositories. Without them, the source
uses Maven Central and bumped to the latest version, whatever the
version filter, major versions included.

Signed-off-by: Olblak <[email protected]>
@olblak
refactor(autodiscovery/maven): parse manifest templates once
70fe28b
The dependency and parent pom crawlers declared the same anonymous
template parameters, computed the source version filter the same way and
parsed the constant manifest template for every dependency. Share a named
manifestTemplateParams type and a renderManifest method computing the
version filter, and parse the template once. The generated manifests are
unchanged.

Signed-off-by: Olblak <[email protected]>
@olblak olblak added resource-mavenrepository Resource of kind Maven Repository autodiscovery All things related to the autodiscovery feature labels Oct 22, 2026
@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1fa6676d-e7f3-42f7-8043-10b2f2fec490
📥 Commits

Reviewing files that changed from the base of the PR and between 558eb91 and cb3e4d6.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: dcd0e58e-cdd3-4a43-829f-a35e27ef1f22
📥 Commits

Reviewing files that changed from the base of the PR and between a681921 and 369dbd8.

📒 Files selected for processing: 3
  • pkg/plugins/autodiscovery/maven/dependency.go
  • pkg/plugins/autodiscovery/maven/dependencyParentPom.go
  • pkg/plugins/autodiscovery/maven/manifestTemplate.go
🚧 Files skipped from review as they are similar to previous changes: 2
  • pkg/plugins/autodiscovery/maven/dependency.go
  • pkg/plugins/autodiscovery/maven/dependencyParentPom.go

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

📝 Walkthrough

Maven dependency and parent-POM manifest generation now uses a shared renderer for template execution and version-filter parameters. A new test checks discovery for a Maven project without repositories.

Changes: Maven manifest rendering

Layer / File(s) Summary
Shared template rendering
pkg/plugins/autodiscovery/maven/manifestTemplate.go
The renderer parses the template once, sets version-filter values, and returns template parsing or execution errors. The template’s extra end was removed.
Discovery integration and test
pkg/plugins/autodiscovery/maven/dependency.go, pkg/plugins/autodiscovery/maven/dependencyParentPom.go, pkg/plugins/autodiscovery/maven/main_test.go, pkg/plugins/autodiscovery/maven/testdata/norepository/pom.xml
Dependency and parent-POM generation delegate rendering to m.renderManifest and skip entries when rendering fails. The test checks that discovery without repositories produces one manifest, omits the repositories field, and retains the configured version filter.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Refactor

Suggested reviewers: kevinleturc

Merge Risk: ⚪ Minimal · up to 369db

No concrete merge-blocking risk was established for this refactoring.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly describes the Maven autodiscovery manifest-template refactoring.
Description check Passed The description includes the change summary, test command, checklist, tradeoff, and potential-improvement sections. It does not include the expected issue reference or test results, but it is otherwis…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description includes the change summary, test command, checklist, tradeoff, and potential-improvement sections. It does not include the expected issue reference or test results, but it is otherwise sufficiently complete.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
  • X
  • Mastodon
  • Reddit
  • LinkedIn

Comment @coderabbitai help to get the list of available commands.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@olblak
Merge branch 'main' into fix/maven-autodiscovery-templates
a681921
@olblak olblak mentioned this pull request Oct 22, 2026
feat(maven): autodiscovery cooldown and vulnerability support #10991
Merged
2 tasks
@olblak
olblak requested a balanced review from Copilot October 22, 2026 19:27
Copilot AI reviewed Oct 22, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

4 open issues
  • Medium severity template.Must(...) will panic at package init time if the template is ever invalid. Previously, a… · New
  • Medium severity The new testdata POM pins junit:junit to 4.12, which is a known vulnerable version and may… · New
  • Low severity These assertions are quite formatting-specific (exact indentation/newlines). Small harmless… · New
  • Low severity The use of whitespace-trimming actions ({{- ... }}) inside YAML indentation-sensitive blocks… · New
What changed in this PR

Refactors Maven autodiscovery manifest rendering to centralize template execution and improve handling of repository-less projects ahead of upcoming Maven-related changes.

Changes:

  • Parse the manifest Go template once and reuse it (instead of parsing per dependency/parent POM).
  • Centralize manifest rendering (including version filter adjustments) into renderManifest.
  • Add test coverage and testdata for discovery when no repositories are configured.
File Description
pkg/​plugins/​autodiscovery/​maven/​manifestTemplate.go Introduces shared parsed template, parameter struct, and a single render function.
pkg/​plugins/​autodiscovery/​maven/​dependency.go Switches dependency manifest generation to the shared renderer.
pkg/​plugins/​autodiscovery/​maven/​dependencyParentPom.go Switches parent POM manifest generation to the shared renderer.
pkg/​plugins/​autodiscovery/​maven/​main_test.go Adds coverage for discovery without repositories and version filter application.
pkg/​plugins/​autodiscovery/​maven/​testdata/​norepository/​pom.xml Adds a repository-less POM fixture for testing.

Review effort: Lite

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pkg/plugins/autodiscovery/maven/manifestTemplate.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread pkg/plugins/autodiscovery/maven/testdata/norepository/pom.xml Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread pkg/plugins/autodiscovery/maven/main_test.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread pkg/plugins/autodiscovery/maven/manifestTemplate.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Copilot stopped reviewing on behalf of olblak due to an error October 22, 2026 21:27
The job was not acquired by a runner even after multiple attempts.
olblak and others added 2 commits October 23, 2026 09:27
@olblak
fix: don't panic on failing template
369dbd8
Signed-off-by: Olblak <[email protected]>
@olblak
Merge branch 'main' into fix/maven-autodiscovery-templates
558eb91
@olblak
olblak enabled auto-merge (squash) October 23, 2026 10:50
@olblak
Merge branch 'main' into fix/maven-autodiscovery-templates
cb3e4d6
@olblak
olblak merged commit ece79c5 into updatecli:main Oct 23, 2026
8 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@coderabbitai coderabbitai Bot mentioned this pull request Oct 23, 2026
feat(maven): add age and osv support #10990
Merged
2 tasks
@olblak olblak added the cleanup label Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

autodiscovery All things related to the autodiscovery feature cleanup resource-mavenrepository Resource of kind Maven Repository

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@olblak
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.