Skip to content

Don't depend on repo package for batch changes

Warren Gifford requested to merge es/refactor-sources into main

Created by: eseliger

This PR refactors ChangesetSource to live in the recently introduced sources package, because it has essentially nothing to do with internal/repos. Also, this means that we don't need to use a repos.Sourcer to get a RepoSource and then try to cast it to a ChangesetSource. All logic that someone else at Sourcegraph might want to utilize in the future is still accessible, as methods on the internal/extsvc client implementations. This is just an abstraction layer to use those clients for predefined actions in Batch Changes. This also removes the need for an open source package for our types, so say hello to the types package (Yes, Adam's scheduler code can stay our precious enterprise code now!) 90% of the diff is just renaming batches to btypes and moving the sources methods into the sources package. The main magic is that no major changes needed to be done to any of our packages. Also, some types that were in the store package (for no reason other than "shouldn't be in OSS" are moved into the types package now, for consistency)

Follow-up tasks (when we get to it):

  • Rename Source to something that we think this really is - the name is just borrowed
  • We can potentially refactor the setup of the sources a bit
  • Once we have it: Don't use external services in this whole package at all, just code host configs, when the code host RFC is implemented (shiny future-talk, I know)

Merge request reports

Loading