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

issues: filter by exact title match when looking for existing issue #96389

Merged
merged 1 commit into from
Feb 2, 2023

Conversation

renatolabs
Copy link
Contributor

This changes the logic used to find existing and related issues when posting test failures on GitHub. Previously, we would rely on the GitHub API to find issues with the a certain title; however, the GitHub API does not provide a way to filter by exact title match. Instead, issues that have a "similar" name are returned. As a consequence, when a test fails, we might comment on an existing issue for a different test, which is confusing and may mask failures.

As a means of example, check issue #91594: failures for schemachange/mixed-versions and schemachange/mixed-versions-compat are both posted there for this reason.

This commit does some further filtering on our end to ensure that an issue is only considered existing or related if the titles match exactly.

Epic: none

Release note: None

@renatolabs renatolabs requested a review from a team as a code owner February 1, 2023 22:28
@renatolabs renatolabs requested review from srosenberg and smg260 and removed request for a team February 1, 2023 22:28
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@renatolabs renatolabs force-pushed the rc/fix-existing-gh-issue branch from a5d0424 to eb35304 Compare February 2, 2023 01:24
Copy link
Collaborator

@herkolategan herkolategan left a comment

Choose a reason for hiding this comment

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

Reviewed 20 of 20 files at r1, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @renatolabs, @smg260, and @srosenberg)


pkg/cmd/internal/issues/issues_test.go line 180 at r1 (raw file):

		factories := make([]issueFactory, 0, len(suffixes))
		for k, suffix := range suffixes {
			suffix := suffix // capture range variable

shouldn't k be captured as well?

Copy link
Collaborator

@herkolategan herkolategan left a comment

Choose a reason for hiding this comment

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

Nice fix, I'm sure this will prevent unwarranted confusion in the future.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @renatolabs, @smg260, and @srosenberg)

This changes the logic used to find existing and related issues when
posting test failures on GitHub. Previously, we would rely on the
GitHub API to find issues with the a certain title; however, the
GitHub API does not provide a way to filter by exact title
match. Instead, issues that have a "similar" name are returned. As a
consequence, when a test fails, we might comment on an existing issue
for a different test, which is confusing and may mask failures.

As a means of example, check issue cockroachdb#91594: failures for
`schemachange/mixed-versions` and `schemachange/mixed-versions-compat`
are both posted there for this reason.

This commit does some further filtering on our end to ensure that an
issue is only considered existing or related if the titles match exactly.

Epic: none

Release note: None
@renatolabs renatolabs force-pushed the rc/fix-existing-gh-issue branch from eb35304 to 4a517ff Compare February 2, 2023 16:59
Copy link
Contributor Author

@renatolabs renatolabs left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @herkolategan, @smg260, and @srosenberg)


pkg/cmd/internal/issues/issues_test.go line 180 at r1 (raw file):

Previously, herkolategan (Herko Lategan) wrote…

shouldn't k be captured as well?

Hah, nice catch, it's funny how often I still make this mistake even after thinking about it for so long while writing that linter. Fixed.

Copy link
Collaborator

@herkolategan herkolategan left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @smg260 and @srosenberg)

Copy link
Collaborator

@herkolategan herkolategan left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @renatolabs, @smg260, and @srosenberg)


pkg/cmd/internal/issues/issues_test.go line 180 at r1 (raw file):

Previously, renatolabs (Renato Costa) wrote…

Hah, nice catch, it's funny how often I still make this mistake even after thinking about it for so long while writing that linter. Fixed.

Easy to miss those! And still something I'm getting used to, having worked in Java for a long time, I'm very use to the compiler complaining that a variable needs to be final if you're capturing it in a lambda.

@renatolabs
Copy link
Contributor Author

bors r=herkolategan

TFTR!

@craig
Copy link
Contributor

craig bot commented Feb 2, 2023

Build succeeded:

@craig craig bot merged commit f9e61b3 into cockroachdb:master Feb 2, 2023
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.

3 participants