summaryrefslogtreecommitdiff
path: root/src/other_tools/just_mr/fetch.cpp
AgeCommit message (Collapse)Author
2025-06-16Avoid unnecessary work in accessing container entriesPaul Cristian Sarbu
- in sequence containers, use operator[] instead of .at() when accessing indices guaranteed to be in bound; - in associative containers, prefer .find() and reusing the returned const iterator to using .contains() and .at(); while there, make any so obtained iterators const if they are read-only.
2025-04-22Remove redundant calls to std::filesystem::absoluteMaksim Denisov
...when calling std::filesystem::weakly_canonical, since the latter converts the argument path to an absolute path internally.
2025-03-24ExecutionApi: Return TmpDirMaksim Denisov
2025-02-19ApiBundle: Remove HashFunction.Maksim Denisov
And ensure every user obtains HashFunction from corresponding IExecutionApi
2025-02-19Store HashFunction by valueMaksim Denisov
Although references give an additional information about ownership, they introduce additional design difficulties.
2025-02-11checkout locations: support extra environment variables to inheritKlaus Aehlig
2025-02-11Name library containing ExecutionConfiguration more appropriatelyKlaus Aehlig
2025-01-07Implement rebuilding of StorageConfigMaksim Denisov
2024-12-19Remove unneeded compat_storageOliver Reiche
2024-11-14other_tools/just_mr: Implement IWYU suggestionsPaul Cristian Sarbu
2024-10-25Enable compatible mode for just-mr and SourceTree serve service...Paul Cristian Sarbu
...by using the new local api that can handle any remote endpoint, irrespective of protocol. Also ensure all tests for the serve service are now being run both in native and compatible modes.
2024-10-25serve service: Respond with digest for blob and tree checksPaul Cristian Sarbu
...to be able to interrogate remotes irrespective of protocol. When serve endpoint is active, it will provide the correct digest with which to interrogate the remote endpoint. Otherwise, for a compatible remote check the file mappings for the correct digest. The serve service proto file is updated accordingly.
2024-10-25serve service: Respond also with digest in serve repository tree RPCsPaul Cristian Sarbu
...besides the simple Git hash, if syncing was done. This way one can know what digest to ask for from the remote. The serve client also needs to now know what hash function the remote expects. The serve service proto file is updated accordingly.
2024-10-25just-mr and SourceTree: Use new Git execution api instancePaul Cristian Sarbu
In just-mr: to instantiate the new Git api instance, both storage configs, as well as the compatible storage, need to be passed to the maps. While there, use more explicit naming schemes for the storage and CAS instances used. In serve: also acquire gc locks for the local storages when needed to instantiate the new Git api, which now has access to the CAS. In all these instances we also pass, as needed, the local api, which currently still operates only in native mode. This makes no difference currently, but will ensure less changes needed when the future compatible-aware local api will be used instead.
2024-10-25just-mr: Instantiate both native and compatible storages...Paul Cristian Sarbu
...to be later passed to maps that might need them. This is a preparatory commit. Currently only the native storage is actively being used.
2024-10-25just-mr: Use explicit naming in default instantiated storagePaul Cristian Sarbu
As just-mr will always create Git roots, be explicit in the names of variables to state that the default storage created is native.
2024-09-11Move just-mr's parsing of git trees to ParseGitTreeMaksim Denisov
...and use it in fetch and repos_to_setup_map to remove code duplication.
2024-08-29just-mr maps: Properly check for missing values in map chainPaul Cristian Sarbu
The root async map in a chain of calls should always be checked for missing value, which can happen if, e.g., a cycle happens or a thread gets killed by the system. Properly handle this by checking explicitly if a value has been posted. If not, check for cycles where it makes sense (for example, in the resolving of symlinks), otherwise report any pending map keys not yet processed. This is done for all just-mr commands working with async maps.
2024-07-30ApiBundle: Use a creator method instead of constructorPaul Cristian Sarbu
This will allow for ApiBundle to be used together with the TestApi implementation of IExecutionApi in tests. Also rename CreateRemote method to MakeRemote in order to remove any semantical confusion.
2024-07-30Pass LocalContext and RemoteContext to ServeApiPaul Cristian Sarbu
Also switch to using the fields from RemoteContext instances instead of those from ApiBundle.
2024-07-30Pass RemoteContext to ApiBundlePaul Cristian Sarbu
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.
2024-07-30Pass LocalContext to ApiBundlePaul Cristian Sarbu
2024-07-23just-mr: Remove progress and statistics singletonsPaul Cristian Sarbu
...and instead use simple instances created in setup, fetch, and update, respectively. The various maps and the progress reporter get access to these instances via not_null pointers.
2024-07-23just-mr: Use statistics instance in fetch mapPaul Cristian Sarbu
...instead of using the singleton.
2024-07-23just-mr: Use progress instance in setup mapsPaul Cristian Sarbu
...instead of using the singleton.
2024-07-23just-mr: Pass progress and statistics instances to reporterPaul Cristian Sarbu
2024-07-19Remove the RetryConfig singletonPaul Cristian Sarbu
...and replace it with instances created early via a builder pattern.
2024-07-19Pass RetryConfig instance to ApiBundlePaul Cristian Sarbu
Also store a const ref for usage in setting up a fresh ApiBundle during target serve.
2024-07-16Remove the RemoteExecutionConfig singletonPaul Cristian Sarbu
...and replace it with passed instances created early via a builder pattern. Tests are also updated accordingly.
2024-07-16Pass RemoteExecutionConfig instance to ApiBundlePaul Cristian Sarbu
...and store it as a const ref for subsequent use wherever the apis are already passed.
2024-07-16Remove the LocalExecutionConfig singletonPaul Cristian Sarbu
...and replace it with passed instances created early via a builder pattern.
2024-07-16Pass LocalExecutionConfig to ApiBundlePaul Cristian Sarbu
2024-07-16Add missing RemoteExecutionConfig includesPaul Cristian Sarbu
2024-07-05Pass StorageConfig and Storage to just-mr mapsMaksim Denisov
2024-07-05Pass StorageConfig and Storage to LocalApiMaksim Denisov
2024-07-05Pass StorageConfig and Storage to ServeMaksim Denisov
2024-07-04Replace the Auth and Auth::TLS singletonsPaul Cristian Sarbu
Use a builder pattern for creation and validation, in a manner that allows also other authentication methods to be added in the future besides the current TLS/SSL. The main Auth instances are built early and then passed by not_null const pointers, to avoid passing temporaries, replacing the previous Auth::TLS instances passed by simple nullable const pointers. Where needed, these passed Auth instances are also stored, by const ref. Tests also build Auth instances as needed, either with the default 'no certification' or from the test environment arguments.
2024-07-04Pass Auth::TLS instance to BazelApi and ServeApiPaul Cristian Sarbu
2024-06-27Pass ServeApi to just-mr maps by raw pointerMaksim Denisov
...since it is used for capturing in lambdas for AsyncMaps and mustn't be temporary.
2024-06-27Use a raw pointer for passing optional RepositoryConfigMaksim Denisov
...instead of std::optional<gsl::not_null<RepositoryConfig const*>>.
2024-06-27Use a raw pointer for passing optional IExecutionApiMaksim Denisov
...instead of std::optional<gsl::not_null<IExecutionApi const*>>
2024-06-25Pass ApiBundle to ServeApiMaksim Denisov
2024-06-25Use ApiBundle for creation of APIs in just-mrMaksim Denisov
2024-06-25Use a general boolean for compatible in MultiRepoCommonArgumentsMaksim Denisov
2024-06-18Create an individual instance of RemoteServeConfig in just-mrMaksim Denisov
...instead of initialization of the singleton.
2024-06-18Make ServeApi a general class, not a singletonMaksim Denisov
...and adjust interfaces.
2024-06-18Pass ServeApi to just-mr maps by referenceMaksim Denisov
...instead of using singleton calls.
2024-06-18Use ServeApi functionality via Instance()Maksim Denisov
...to track changes during refactoring easier.
2024-03-26Add missing system includesPaul Cristian Sarbu
Main culprits: - std::size_t, std::nullptr_t, and NULL require <cstddef> - std::move and std::forward require <utility> - unordered maps and sets require respective includes - std::for_each and std::all_of require <algorithm>
2024-03-07just-mr fetch: Correctly report if no fetch requiredPaul Cristian Sarbu