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

Return the output of the sync command in VCSSyncer::Fetch #51754

Merged
peterguy merged 1 commit into
mainfrom
pg/add-output-to-fetch-for-51236
May 11, 2023
Merged

Return the output of the sync command in VCSSyncer::Fetch #51754
peterguy merged 1 commit into
mainfrom
pg/add-output-to-fetch-for-51236

Conversation

@peterguy

Copy link
Copy Markdown
Contributor

Administrating Perforce depot syncing in Sourcegraph is made much easier by being able to examine the output of the p4-fusion command. See PR 51598 for details.

This PR adds support for capturing the output when a background sync runs. Because it modifies the signature of VSCSyncer, it's being broken out into a separate PR.

Test plan

existing tests updated to support the returned output

Return the output of the command that was run to sync the repo, as well as the error.
Including the output will support [issue 51236](https://github.com/sourcegraph/sourcegraph/issues/51236)
by storing the output of the sync for the background syncs as well as the clones and manually-queued syncs.
Including the backgorund syncs is important because if something changes and the repos aren't being updated,
the output can help an admin figure out what the problem is.
@peterguy peterguy requested a review from a team May 10, 2023 21:59
@cla-bot cla-bot Bot added the cla-signed label May 10, 2023

@sashaostrikov sashaostrikov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!
It is still a draft, is it subject to change later?

@peterguy peterguy marked this pull request as ready for review May 11, 2023 16:16
@peterguy

Copy link
Copy Markdown
Contributor Author

Thanks @sashaostrikov ; it was still a draft just because I hadn't gotten back to it yet. :-)

@sourcegraph-bot

Copy link
Copy Markdown
Contributor

Codenotify: Notifying subscribers in CODENOTIFY files for diff a7c4ca0...14ff443.

Notify File(s)
@indradhanush cmd/gitserver/server/server.go
cmd/gitserver/server/vcs_packages_syncer.go
cmd/gitserver/server/vcs_packages_syncer_test.go
cmd/gitserver/server/vcs_syncer.go
cmd/gitserver/server/vcs_syncer_git.go
cmd/gitserver/server/vcs_syncer_mock_test.go
cmd/gitserver/server/vcs_syncer_perforce.go
@sashaostrikov cmd/gitserver/server/server.go
cmd/gitserver/server/vcs_packages_syncer.go
cmd/gitserver/server/vcs_packages_syncer_test.go
cmd/gitserver/server/vcs_syncer.go
cmd/gitserver/server/vcs_syncer_git.go
cmd/gitserver/server/vcs_syncer_mock_test.go
cmd/gitserver/server/vcs_syncer_perforce.go

@peterguy peterguy merged commit eab596a into main May 11, 2023
@peterguy peterguy deleted the pg/add-output-to-fetch-for-51236 branch May 11, 2023 16:25
cesrjimenez pushed a commit that referenced this pull request May 17, 2023
Administrating Perforce depot syncing in Sourcegraph is made much easier
by being able to examine the output of the `p4-fusion` command. See [PR
51598](https://github.com/sourcegraph/sourcegraph/pull/51598) for
details.

This PR adds support for capturing the output when a background sync
runs. Because it modifies the signature of `VSCSyncer`, it's being
broken out into a separate PR.

## Test plan

existing tests updated to support the returned output

<!-- All pull requests REQUIRE a test plan:
https://docs.sourcegraph.com/dev/background-information/testing_principles
-->
peterguy added a commit that referenced this pull request May 24, 2023
cherry-picked #51754 and added (redacted) output capture from fetches.
peterguy added a commit that referenced this pull request Jun 13, 2023
cherry-picked #51754 and added (redacted) output capture from fetches.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants