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 — fix(autodiscovery/golang): correctly handle pseudo version by olblak · Pull Request #8698 · updatecli/updatecli

Conversation

@olblak

@olblak olblak commented May 14, 2026

Copy link
Copy Markdown
Member

Fix pseudo version in golang autodiscovery.

If a go module uses a pseudo version then Updatecli override the version filter to handle it.
A pseudo version looks like "v0.0.0-20260209031235-2402fdf4a9ed"

Test

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

cd pkg/plugins/autodiscovery/golang/
go test

Additional Information

Checklist

  • I have updated the documentation via pull request in website repository.

Tradeoff

Potential improvement

Sorry, something went wrong.

Uh oh!

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

All reactions
olblak added 2 commits May 14, 2026 15:51
@olblak
fix(autodiscovery/golang): correctly handle pseudo version
46b6fdc
Signed-off-by: Olblak <[email protected]>
@olblak
chore: reword debug message
01221fa
Signed-off-by: Olblak <[email protected]>
@olblak olblak added bug Something isn't working autodiscovery All things related to the autodiscovery feature labels May 14, 2026
@olblak
olblak requested a review from Copilot May 14, 2026 13:56
@olblak
Merge branch 'main' into fix_autodiscovery_golang_pseudoVersion
41310ad
Copilot started reviewing on behalf of olblak May 14, 2026 13:57
View session
Copilot AI reviewed May 14, 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.

Pull request overview

This PR aims to improve the Golang autodiscovery pipeline generation so that modules pinned to Go pseudo-versions don’t break version filtering and can still be updated correctly.

Changes:

  • Added pseudo-version detection via isPseudoVersion (regex-based).
  • Updated Golang dependency autodiscovery to override the version filter when a pseudo-version is detected.
  • Extended autodiscovery tests to cover pseudo-version scenarios.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

File Description
pkg/plugins/autodiscovery/golang/utils.go Adds pseudo-version detection helper and regex.
pkg/plugins/autodiscovery/golang/dependency.go Overrides versionfilter kind/pattern when a dependency (or replace) uses a pseudo-version.
pkg/plugins/autodiscovery/golang/utils_test.go Updates search expectations and adds unit tests for pseudo-version detection.
pkg/plugins/autodiscovery/golang/main_test.go Adds an autodiscovery fixture test for pseudo-version manifest generation.
Comments suppressed due to low confidence (1)

pkg/plugins/autodiscovery/golang/dependency.go:178

  • Same as above for replace modules: kind is switched to latest but pattern is set to "". With kind: latest, the filter logic expects pattern: latest; otherwise it can fail to resolve a version when the proxy returns a list. Set the pattern to latest (or use a semver "latest" pattern) to avoid producing non-functional manifests for replaced modules.
				goModuleVersionPattern := g.versionFilter.Pattern
				goModuleVersionKind := g.versionFilter.Kind
				switch isPseudoVersion(replace.NewVersion) {
				case false:
					goModuleVersionPattern, err = g.versionFilter.GreaterThanPattern(replace.NewVersion)
					if err != nil {
						logrus.Debugf("skipping golang module %q due to: %s", replace.NewPath, err)
						continue
					}

				case true:
					// If the new version is a pseudo-version,
					// we cannot apply a version filter pattern as
					// golang registry will only return one version for this module.

					logrus.Debugf("Module %q uses a pseudo-version %q, so ignoring version filter for this module as the registry will only return one version", replace.NewPath, replace.NewVersion)

					goModuleVersionKind = "latest"
					goModuleVersionPattern = ""
				}

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread pkg/plugins/autodiscovery/golang/utils.go Resolved

Uh oh!

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

Comment thread pkg/plugins/autodiscovery/golang/dependency.go Resolved

Uh oh!

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

Comment thread pkg/plugins/autodiscovery/golang/utils_test.go Resolved

Uh oh!

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

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

Uh oh!

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

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

Uh oh!

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

Comment thread pkg/plugins/autodiscovery/golang/utils_test.go Resolved

Uh oh!

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

olblak and others added 4 commits May 14, 2026 16:08
@olblak
fix: add missing test directory
31b5df1
Signed-off-by: Olblak <[email protected]>
@olblak
fix: switch from regex to go module lib
cdb3850
Signed-off-by: Olblak <[email protected]>
@olblak
chore: ignore funlen
08cf14b
Signed-off-by: Olblak <[email protected]>
@olblak
Merge branch 'main' into fix_autodiscovery_golang_pseudoVersion
60d7f05
@olblak
olblak enabled auto-merge (squash) May 14, 2026 15:35
@olblak
olblak merged commit 1f1f989 into updatecli:main May 14, 2026
7 checks passed

Uh oh!

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

@olblak
olblak deleted the fix_autodiscovery_golang_pseudoVersion branch May 14, 2026 16:00
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 bug Something isn't working

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.