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

gitserver: Implement Perforce changelist ID mapper as standalone job#62868

Merged
eseliger merged 1 commit into
mainfrom
es/05-22-gitserverimplementperforcechangelistidmapperasstandalonejob
May 27, 2024
Merged

gitserver: Implement Perforce changelist ID mapper as standalone job#62868
eseliger merged 1 commit into
mainfrom
es/05-22-gitserverimplementperforcechangelistidmapperasstandalonejob

Conversation

@eseliger

Copy link
Copy Markdown
Member

This PR moves the changelist mapper to be a proper worker job and be monitored by the usual worker monitoring.
It also makes use of well-tested gitserver APIs instead of running git commands itself.

This also moves from a reactive system that purely resides in memory to a system that occasionally makes sure all perforce depots are properly mapped. This should be slightly more DB queries to find the depots that have a change, but it shouldn't be a huge burden, and this is another good indicator that events can be useful :)

Test plan:

I've added some "integration-ish" tests, and ran it locally to verify that it works.
It will be good to also implement an integration test, once we have the tools for that.

@cla-bot cla-bot Bot added the cla-signed label May 22, 2024

Copy link
Copy Markdown
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @eseliger and the rest of your teammates on Graphite Graphite

@github-actions github-actions Bot added team/product-platform team/source Tickets under the purview of Source - the one Source to graph it all labels May 22, 2024
This PR moves the changelist mapper to be a proper worker job and be monitored by the usual worker monitoring.
It also makes use of well-tested gitserver APIs instead of running git commands itself.

This also moves from a reactive system that purely resides in memory to a system that occasionally makes sure all perforce depots are properly mapped. This should be slightly more DB queries to find the depots that have a change, but it shouldn't be a huge burden, and this is another good indicator that events can be useful :)

Test plan:

I've added some "integration-ish" tests, and ran it locally to verify that it works.
It will be good to also implement an integration test, once we have the tools for that.
@eseliger eseliger force-pushed the es/05-22-gitserverimplementperforcechangelistidmapperasstandalonejob branch from 1cc7cef to cc40a4f Compare May 22, 2024 21:08

@peterguy peterguy 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.

Great changes - moving into worker, checking the database for changed repos, using gitserver APIs. The potential delay introduced by not queuing this up immediately after a repo sync might cause som UI jank, as users will see git commit hashes until the mapping is done, but as long as SRC_PERFORCE_CHANGELIST_MAPPER_INTERVAL is kept low, the UI impact should not be any worse than the previous implementation, and will actually be more reliable, since previously the delay depended on the size of the queue. Some documentation about that environment variable encouraging admins to leave it low (and reassuring them of the low impact this process has) might be in order.

reference: internal discussion thread

@peterguy

Copy link
Copy Markdown
Contributor

plus a lot to this being another example of how useful a gitserver events API will be

@eseliger

Copy link
Copy Markdown
Member Author

Implemented https://github.com/sourcegraph/sourcegraph/pull/62871 to alleviate the indexing latency concerns.

@eseliger eseliger marked this pull request as ready for review May 23, 2024 16:26
@eseliger eseliger requested a review from a team May 23, 2024 16:26
@eseliger eseliger merged commit d23e2bf into main May 27, 2024
@eseliger eseliger deleted the es/05-22-gitserverimplementperforcechangelistidmapperasstandalonejob branch May 27, 2024 02:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla-signed team/product-platform team/source Tickets under the purview of Source - the one Source to graph it all

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants