gtristan opened a new pull request #1443: URL: https://github.com/apache/buildstream/pull/1443
This is a preparatory refactoring working towards fixing the [remote services configuration surface changes](https://lists.apache.org/thread.html/rf2da9830e2fa918357f99a6021e55fc43df876f0b19d43f68802f083%40%3Cdev.buildstream.apache.org%3E) By itself this patch makes some nice improvements: _remotespec.py: Moving RemoteSpec and RemoteExecutionSpec to its own file This is in preparation to move all configuration parsing and data structures out of the cache handling code and closer into the domain of Context/Project. The RemoteSpec/RemoteExecutionSpec objects are also changed to be proper strongly typed objects instead of a named tuples. RemoteSpec now also handles the nitty gritty parts of lazy loading the credentials from disk (now featuring proper provenance inclusive error reporting), loading the grpc credentials object, and opening connections, this allows us to remove a hand full of duplicated code paths. Summary of changes: * _remotespec.py: Added RemoteType, RemoteSpec and RemoteExecutionSpec here * _project.py: Load RemoteExecutionSpec in the new way * _context.py: Load RemoteExecutionSpec in the new way * sandbox/_sandboxremote.py: Adapt to new moved RemoteExecutionSpec, remove a bunch of duplicated code here and rely on the spec for loading credentials and opening channels to end points * _remote.py: - Removed RemoteType and RemoteSpec from here - Reordered and documenting the file according to coding style - Removed redundant instance members which are already available on the spec (subclasses adapted to obtain these members in their now singular location on the spec) * _assetcache.py: - Adapting to the Remote API changes - Reordering and documenting the file as per coding style - Removed helper function _initialize_remotes(), which only makes the code harder to follow * _cas/casremote.py: Adapting to Remote API changes * _artifactcache.py: Adapting to Remote API changes * _sourcecache.py: Adapting to Remote API changes * _elementsourcescache.py: Adapting to Remote API changes * tests/artifactcache/config.py: Updated test cases ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
