Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

[SG-37398] - Migrate graphqlbackend.RepositoryResolver to use sourcegraph/log #38902

Merged
merged 4 commits into from
Jul 16, 2022

Conversation

gitstart-sourcegraph
Copy link
Collaborator

@gitstart-sourcegraph gitstart-sourcegraph commented Jul 15, 2022

Description

Add a logger to schemaResolver, and initialize it with log.Scoped (or logtest where appropriate) wherever schemaResolver is created (unless an existing logger is easily available, in which case that should be used)
Add a logger to RepositoryResolver, and let it be injected from NewRepositoryResolver. Use log.Scoped (or logtest where appropriate) to provide the logger at all usages of NewRepositoryResolver
3 log15 usages inside cmd/frontend/graphqlbackend/repository.go are replaced with calls to the appropriate logger

Test plan

  • A good way to test this PR is just to run the branch locally, and open the issue link, compare the changes on the PR and the listed issues. All of them must be fixed

Refs

@bobheadxi
Copy link
Member

running a main dry run: https://buildkite.com/sourcegraph/sourcegraph/builds/161193

@bobheadxi
Copy link
Member

the main-dry-run passed

@bobheadxi bobheadxi merged commit 48763b0 into main Jul 16, 2022
@bobheadxi bobheadxi deleted the contractors/SG-37398 branch July 16, 2022 16:58
bobheadxi added a commit that referenced this pull request Jul 16, 2022
@@ -584,6 +584,7 @@ func (r *UserResolver) PublicRepositories(ctx context.Context) ([]*RepositoryRes
var out []*RepositoryResolver
for _, repo := range repos {
out = append(out, &RepositoryResolver{
logger: r.logger,
Copy link
Member

Choose a reason for hiding this comment

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

@gitstart-sourcegraph wait, how is r.logger initialized? I see no code indicating that UserResolver is ever created with a logger

Copy link
Member

Choose a reason for hiding this comment

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

bobheadxi added a commit that referenced this pull request Jul 16, 2022
… sourcegraph/log" (#38916)

Revert "[SG-37398] - Migrate graphqlbackend.RepositoryResolver to use sourcegraph/log (#38902)"

This reverts commit 48763b0.
vovakulikov pushed a commit that referenced this pull request Jul 20, 2022
…raph/log (#38902)

Co-authored-by: gitstart-sourcegraph <[email protected]>
Co-authored-by: Robert Lin <[email protected]>
vovakulikov pushed a commit that referenced this pull request Jul 20, 2022
… sourcegraph/log" (#38916)

Revert "[SG-37398] - Migrate graphqlbackend.RepositoryResolver to use sourcegraph/log (#38902)"

This reverts commit 48763b0.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla-signed gitstart Contract partner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

logging(gitstart): migrate graphqlbackend.RepositoryResolver to use sourcegraph/log
3 participants