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

Conversation

@sourcegraph-release-bot
Copy link
Collaborator

Enable the "Test connection" button in the code host page UI

Test plan

Click the "Test connection" button in the code host connection UI. A message with an orange border will display, "Checking code host connection..." and then "Code host is reachable" should display with a green border.
<img width="1148" alt="Screenshot 2023-09-15 at 14 17 00" src="https://github.com/sourcegraph/sourcegraph/assets/129280/a4c30d9b-ceff-4afe-b966-f7bd1c0385d9">

Backport b1fd4da from #56697

* fill out `CheckConnection` and mark Perforce as able to check connections.

* Refactor the connection test to not rely on IsCloneable
Because connecting to Perforce requires using the `p4` CLI binary,
which is on `gitserver`, we're using the Perforce VCS Syncer to do the connection check.
Add a method to the VCS syncer for Perforce specifically for checking the connection
instead of hacking a solution that re-uses IsCloneable, which requires a valid depot.
Adding another func won't break composition with VCSSyncer.

* update comment on CheckConnection

* add a 10-second timeout for the connection test
10 seconds is somewhat arbitrary, but seems like enough time to allow
for various connection issues, whle not being too long for the frontend.

* Change from directly using the syncer
to making an RPC call to gitserver because the call to
CheckConnection comes fro mthe frontend, where `p4` is not available.

(cherry picked from commit b1fd4da)
@sourcegraph-bot
Copy link
Contributor

sourcegraph-bot commented Sep 19, 2023

Codenotify: Notifying subscribers in CODENOTIFY files for diff 7f7e6c9...4cf29e7.

Notify File(s)
@eseliger cmd/gitserver/server/vcs_syncer_perforce.go
internal/repos/perforce.go

@unknwon
Copy link
Contributor

unknwon commented Sep 19, 2023

@peterguy is this change changelog-worthy? (looks like so). If yes, would you mind adding an entry to https://github.com/sourcegraph/sourcegraph/blob/main/CHANGELOG.md#unreleased-519-planned-release-date-september-20-2023 first?

@sourcegraph-bot
Copy link
Contributor

sourcegraph-bot commented Sep 19, 2023

📖 Storybook live preview

@unknwon unknwon merged commit e847ffa into 5.1 Sep 20, 2023
@unknwon unknwon deleted the backport-56697-to-5.1 branch September 20, 2023 15:08
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.

5 participants