Skip to content

src-expose: Snapshot directories into git repos and serve them

Warren Gifford requested to merge core/fakehub-redux into master

Created by: keegancsmith

src-expose (previously fakehub) has been extended into more functionality:

  • Exposes an API that repo-updater can use to dynamically list the repos fakehub has access to.
  • Create git commits of directories not under git source control.
  • Periodically run a command (eg p4 sync) and create the snapshots.
  • Mix src-expose API + repo serving with snapshotting allowing an easy way to get files not in git onto Sourcegraph.

The above ideas was born out of the idea of supporting perforce users in a way which maximises value in a short implementation time. The idea is much more general than that, and can be applied to any scenario where we can get files onto FS, and Sourcegraph can access an HTTP server running on that machine.

Right now the code is rough, and we have hacked the "Other" external service. This is likely fine for this PR, but should move to its own external service before widely announcing. Keen to get an early version of this into the hands of customers, knowing that we could change how it works a lot.

Old demo video at https://sourcegraph.slack.com/archives/C0B2RU51Q/p1567545615064200?thread_ts=1567536277.055700&cid=C0B2RU51Q

Open Questions/Ideas

  • Should we create a new external service type? Or adjust other to accept an API endpoint?
  • Is it fine to ship with the current "experimental" hack in external service other?
  • src-expose CLI UI / config is still rough, but easy to change going forward. Don't get hung up on it yet.
  • I believe if we have strong usage of this, it might make sense to include this functionality as part of src cli.

Merge request reports

Loading