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

docs: Pass in Jira tickets in the body of product change issues #97789

Merged
merged 2 commits into from
Mar 20, 2023
Merged

docs: Pass in Jira tickets in the body of product change issues #97789

merged 2 commits into from
Mar 20, 2023

Conversation

nickvigilante
Copy link
Contributor

Epic and issue references are now pointing to the associated Jira
tickets.

Fixes DOC-7019

Release note: None

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@nickvigilante nickvigilante marked this pull request as ready for review March 16, 2023 13:22
@nickvigilante nickvigilante requested a review from a team as a code owner March 16, 2023 13:22
Copy link
Member

@rail rail left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 2 files at r1, 3 of 3 files at r2, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @nickvigilante)


pkg/cmd/docs-issue-generation/docs_issue_generation.go line 688 at r1 (raw file):

	}
	err := queryGraphQL(query, queryVariables, token, &search)
	if err != nil {

Does it mean we swallow the error here? What happens in this case?


pkg/cmd/docs-issue-generation/docs_issue_generation.go line 677 at r2 (raw file):

// getJiraIssueFromGitHubIssue is specified as a function closure to allow for testing
// of getJiraIssueFromGitHubIssue* methods.
var getJiraIssueFromGitHubIssue = func(org, repo string, issue int, token string) string {

Is there any particular reason to change from the function declaration style to the var one? For a top level function it looks unusual to me.


pkg/cmd/docs-issue-generation/docs_issue_generation.go line 703 at r2 (raw file):

		jiraIssue = jiraIssuePartRE.FindString(exalateRef)
	}
	jiraGHIssueCache[key] = jiraIssue

I see the cache is populated, but it's not used anywhere. Maybe I'm missing something?


pkg/cmd/docs-issue-generation/docs_issue_generation.go line 707 at r2 (raw file):

}

func Split(r rune) bool {

maybe rename the function to something like splitBySlashOrHash so it's not exported (lowercase).

Copy link
Contributor Author

@nickvigilante nickvigilante 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 @rail)


pkg/cmd/docs-issue-generation/docs_issue_generation.go line 688 at r1 (raw file):

Previously, rail (Rail Aliiev) wrote…

Does it mean we swallow the error here? What happens in this case?

I made it here so that we don't swallow the error in the event of a network outage. I didn't want the lack of issue or epic reference to block the creation of a docs issue ticket.


pkg/cmd/docs-issue-generation/docs_issue_generation.go line 677 at r2 (raw file):

Previously, rail (Rail Aliiev) wrote…

Is there any particular reason to change from the function declaration style to the var one? For a top level function it looks unusual to me.

Certain test cases that once did not rely on network resources now rely on network resources. I had a conversation with Celia and David H about this, and the best way that I could make my tests not rely on network resources was to use https://github.com/cockroachdb/cockroach/tree/master/pkg/testutils, and David suggested I change that function to be a variable declaration that I could then defer as part of this test: https://github.com/nickvigilante/cockroach/blob/doc-7019/pkg/cmd/docs-issue-generation/docs_issue_generation_test.go#L227


pkg/cmd/docs-issue-generation/docs_issue_generation.go line 703 at r2 (raw file):

Previously, rail (Rail Aliiev) wrote…

I see the cache is populated, but it's not used anywhere. Maybe I'm missing something?

Deleted the artifact.


pkg/cmd/docs-issue-generation/docs_issue_generation.go line 707 at r2 (raw file):

Previously, rail (Rail Aliiev) wrote…

maybe rename the function to something like splitBySlashOrHash so it's not exported (lowercase).

Done!

@nickvigilante nickvigilante requested a review from rail March 16, 2023 15:29
Copy link
Member

@rail rail left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r3, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @nickvigilante)


pkg/cmd/docs-issue-generation/docs_issue_generation.go line 677 at r2 (raw file):

Previously, nickvigilante (Nick Vigilante) wrote…

Certain test cases that once did not rely on network resources now rely on network resources. I had a conversation with Celia and David H about this, and the best way that I could make my tests not rely on network resources was to use https://github.com/cockroachdb/cockroach/tree/master/pkg/testutils, and David suggested I change that function to be a variable declaration that I could then defer as part of this test: https://github.com/nickvigilante/cockroach/blob/doc-7019/pkg/cmd/docs-issue-generation/docs_issue_generation_test.go#L227

You also need to update the test to reflect the function signature change. Otherwise LGTM.
panic: reflect.Set: value of type func(string, string, int, string) string is not assignable to type func(string, string, int, string) (string, error)

Code quote:

getJiraIssueFromGitHubIssue

Copy link
Contributor Author

@nickvigilante nickvigilante 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 @rail)


pkg/cmd/docs-issue-generation/docs_issue_generation.go line 677 at r2 (raw file):

Previously, rail (Rail Aliiev) wrote…

You also need to update the test to reflect the function signature change. Otherwise LGTM.
panic: reflect.Set: value of type func(string, string, int, string) string is not assignable to type func(string, string, int, string) (string, error)

Done, I think! One more review?

Copy link
Member

@rail rail left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 1 of 1 files at r4, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @nickvigilante)

@nickvigilante
Copy link
Contributor Author

bors r+

@craig
Copy link
Contributor

craig bot commented Mar 20, 2023

Build failed:

Nick Vigilante added 2 commits March 20, 2023 10:16
Epic and issue references are now pointing to the associated Jira
tickets.

Fixes DOC-7019

Release note: None
@nickvigilante
Copy link
Contributor Author

bors r+

@craig
Copy link
Contributor

craig bot commented Mar 20, 2023

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented Mar 20, 2023

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented Mar 20, 2023

Build failed (retrying...):

@nickvigilante
Copy link
Contributor Author

bors r+

@craig
Copy link
Contributor

craig bot commented Mar 20, 2023

Already running a review

@craig
Copy link
Contributor

craig bot commented Mar 20, 2023

Build succeeded:

@craig craig bot merged commit 3427f11 into cockroachdb:master Mar 20, 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