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

Add option get to regex that match the go cmd #4911

Merged
merged 1 commit into from
Mar 28, 2022

Conversation

jeffwidman
Copy link
Member

@jeffwidman jeffwidman commented Mar 26, 2022

There's been several annoying bugs that turned out to be caused by error
messages that used to be emitted as go: ABC now emitted as go get: ABC:

Given this, we should proactively handle this in the other regexes that
look like they might be susceptible to this.

There are two ways to do this:

  1. Add an optional non-capturing group: (?: get)?
  2. Completely remove the go: prefix from the regex.

I went with the first option, because I was concerned the second might
match individual lines within a legitimate multi-line error message.

IE, I've seen go error messages that list a multi-line dep tree, with
only the last line listing the actual error text. But the first line
listed the go: prefix. And by keeping the regex wide, it reported the
entire error in the Dependabot status page, which was very useful for
tracking down what was throwing the error.

Whereas if we go with option two, then since that will match an
individual line, the "stack trace" of the error will be dropped.

But I'm open to feedback if there's something I'm overlooking here.

There's been several annoying bugs that turned out to be caused by error
messages that used to be emitted as `go: ABC` now emitted as `go get:
ABC`:
* dependabot#4868
* dependabot#4910

Given this, we should proactively handle this in the other regexes that
look like they might be susceptible to this.

There are two ways to do this:
1. Add an optional non-capturing group: `(?: get)?`
2. Completely remove the `go: ` prefix from the regex.

I went with the first option, because I was concerned the second might
match individual lines within a _legitimate_ multi-line error message.

IE, I've seen go error messages that list a mult-line dep tree, with
only the last line listing the actual error text. But the first line
listed the `go: ` prefix. And by keeping the regex wide, it reported the
entire error in the Dependabot status page, which was very useful for
tracking down what was throwing the error.

Whereas if we go with option two, then since that will match an
individual line, the "stack trace" of the error will be dropped.

But I'm open to feedback if there's something I'm overlooking here.
@jeffwidman jeffwidman requested a review from a team as a code owner March 26, 2022 08:14
# (Private) module could not be found
/cannot find module providing package/.freeze,
# Package in module was likely renamed or removed
/module .* found \(.*\), but does not contain package/m.freeze,
# Package pseudo-version does not match the version-control metadata
# https://golang.google.cn/doc/go1.13#version-validation
/go: .*: invalid pseudo-version/m.freeze,
/go(?: get)?: .*: invalid pseudo-version/m.freeze,
# Package does not exist, has been pulled or cannot be reached due to
# auth problems with either git or the go proxy
/go: .*: unknown revision/m.freeze,
Copy link
Member Author

Choose a reason for hiding this comment

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

This one is already handled in #4910

@jurre jurre merged commit 12e0108 into dependabot:main Mar 28, 2022
@jeffwidman jeffwidman deleted the add-get-to-other-go-cmd-regexs branch March 28, 2022 17:27
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.

2 participants