diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-07-25 17:02:03 +0200 |
---|---|---|
committer | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-07-30 12:10:06 +0200 |
commit | b5a92a60035ea3731a96bbdc8bca18986b558a05 (patch) | |
tree | 088d85e95d929b31cf74afb1a922b34c4afa7138 /src/buildtool/execution_api/common/api_bundle.hpp | |
parent | deba068d8692bf6d265926885de5601d72f5d461 (diff) | |
download | justbuild-b5a92a60035ea3731a96bbdc8bca18986b558a05.tar.gz |
Pass RemoteContext to ApiBundle
The CreateRemote method is also updated to receive all
remote-related information as arguments, such that it does not have
to rely on the ApiBundle internal fields which will eventually be
removed.
Diffstat (limited to 'src/buildtool/execution_api/common/api_bundle.hpp')
-rw-r--r-- | src/buildtool/execution_api/common/api_bundle.hpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/buildtool/execution_api/common/api_bundle.hpp b/src/buildtool/execution_api/common/api_bundle.hpp index d6cf4423..7d524b2e 100644 --- a/src/buildtool/execution_api/common/api_bundle.hpp +++ b/src/buildtool/execution_api/common/api_bundle.hpp @@ -27,6 +27,7 @@ #include "src/buildtool/execution_api/common/execution_api.hpp" #include "src/buildtool/execution_api/local/context.hpp" #include "src/buildtool/execution_api/remote/config.hpp" +#include "src/buildtool/execution_api/remote/context.hpp" /// \brief Utility structure for instantiation of local and remote apis at the /// same time. If the remote api cannot be instantiated, it falls back to @@ -34,13 +35,20 @@ struct ApiBundle final { explicit ApiBundle( gsl::not_null<LocalContext const*> const& local_context, - RepositoryConfig const* repo_config, - gsl::not_null<Auth const*> const& authentication, - gsl::not_null<RetryConfig const*> const& retry_config, - gsl::not_null<RemoteExecutionConfig const*> const& remote_exec_config); + gsl::not_null<RemoteContext const*> const& remote_context, + RepositoryConfig const* repo_config); - [[nodiscard]] auto CreateRemote(std::optional<ServerAddress> const& address) - const -> gsl::not_null<IExecutionApi::Ptr>; + /// \brief Create a Remote object based on the given arguments. + /// \param address The endpoint address. + /// \param authentication The remote authentication configuration. + /// \param retry_config The retry strategy configuration. + /// \returns A configured api: BazelApi if a remote address is given, + /// otherwise fall back to the already configured LocalApi instance. + [[nodiscard]] auto CreateRemote( + std::optional<ServerAddress> const& address, + gsl::not_null<Auth const*> const& authentication, + gsl::not_null<RetryConfig const*> const& retry_config) const + -> gsl::not_null<IExecutionApi::Ptr>; // Needed to be set before creating the remote (via CreateRemote) Auth const& auth; |