summaryrefslogtreecommitdiff
path: root/src/buildtool/serve_api/serve_service/source_tree.cpp
AgeCommit message (Collapse)Author
2025-06-04RepositoryConfig: Give access to a persistent storage config...Paul Cristian Sarbu
...whenever it is given access to a Git repository. The referenced storage config needs to outlive the repository config instance.
2025-05-20serve service: log every incoming request at debug levelKlaus Aehlig
... so that at this level, the full activity of the serve service can be monitored.
2025-03-18serve service: receive trees in parallel in local CASKlaus Aehlig
The serve service can be asked to get a tree root from the designated remote-execution endpoint. Speed this process up by going through local CAS; in this way, - identical blobs are fetched only once, and - the fetching happens in parallel.
2025-02-19ApiBundle: Remove HashFunction.Maksim Denisov
And ensure every user obtains HashFunction from corresponding IExecutionApi
2025-01-22Source-tree service: accept lock referenceKlaus Aehlig
... so that tagging in the associated git root can be synchronized with other services provided by just serve.
2025-01-21TreeStructure: Compute on serveMaksim Denisov
2025-01-15Use GitRepo::IsTreeInRepo in SourceTreeServiceMaksim Denisov
2025-01-15Use GitRepo::ImportToGit in SourceTreeServiceMaksim Denisov
2025-01-08source tree service: Fix ensuring Git cache rootPaul Cristian Sarbu
This is an amendment to the changes in commit 8234079, as the underlying issue was only partially solved there. While the call to GitRepo::InitAndOpen is in itself properly guarded, it does not share a lock with the call to create the path to the Git cache if it is missing. Fix this by moving the call to the method ensuring the Git cache initialization to after acquiring the Git cache root garbage collector shared lock.
2025-01-07source tree service: Ensure the Git cache existsPaul Cristian Sarbu
Similarly to just-mr, each SourceTree RPC must ensure that the Git cache folder exists and the Git cache repository is initialized before using it. While there, fix missing shared locks on the Git cache root.
2024-12-19Remove unneeded compat_storageOliver Reiche
2024-12-04Rename MRApiUtils to RehashUtilsMaksim Denisov
2024-11-20Serve service: properly lock git operations against each otherKlaus Aehlig
... by using an exclusive lock. A lock of which only ever shared instances are requested has no synchronisation effect. Fix this.
2024-11-14serve_api: Implement IWYU suggestionsPaul Cristian Sarbu
2024-10-25serve service: Set correct protocol-aware digests in responsesPaul Cristian Sarbu
When returning digests in responses, ensure they are of the type the remote would know. Compatible digests can be found vis the stored mappings from Git digests to bazel objects.
2024-10-25serve service: Use digest when requesting serve to set up a treePaul Cristian Sarbu
...instead of passing just the Git hash, which imposes the remote to always be native. The serve service proto file is updated accordingly.
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-25serve service: Give SourceTreeService access to both local storagesPaul Cristian Sarbu
...native and compatible, even if currently only native is active. While there, be more explicit in which storage instance is being used.
2024-09-17Small code improvements based on lint warningsPaul Cristian Sarbu
- add more noexcept requirements and enforce existing - fixing inconsistencies related to function arguments - remove redundant static keywords - silencing excessive lint reporting in test cases While there, make more getters const ref.
2024-09-13Check compatibility in serve services based on the hash typeMaksim Denisov
2024-09-13Rename Compatibility class to ProtocolTraitsMaksim Denisov
...and move it to the common stage.
2024-09-11Use ArtifactDigestFactory in SourceTreeServiceMaksim Denisov
...to create ArtifactDigests.
2024-08-30Return ArtifactDigest from LocalCAS::StoreMaksim Denisov
2024-08-29SourceTree: Check for missing value after using resolve_symlinks_mapPaul Cristian Sarbu
Fixes a false assumption that the result of resolving the tree will always be set if the map doesn't log fatal, when in fact the map might fail to set a value if, e.g., a thread is killed by the system or there is a symlinks cycle.
2024-08-26GitRepo: Create commit from a directory explicitly...Paul Cristian Sarbu
...by writing its tree directly in the object database instead of working with the index. This allows the creation of trees that contain also entries with 'magic' names, such as the .git folder or .gitignore files. Callers must ensure the given directory only contains the needed entries. In particular, just-mr maps and serve service are updated to separate the import-to-Git repository path from the temporary path containing the content to be committed, to avoid polluting the content path with entries generated on repository initialization.
2024-08-26GitRepo: Change logic that creates commits to explicitly give directoryPaul Cristian Sarbu
In preparation for subsequent changes, specify the directory path containing the tree content to be committed explicitly. This change will allow eventually to be able to specify paths that are different from the root path of the repository in which the commit is created. This commit renames and refactors StageAndCommitAllAnnonymous to allow a directory path to be passed. The just-mr and serve service logic is updated such that current behaviour is otherwise unchanged.
2024-08-07Remove code duplication from SourceTreeServiceMaksim Denisov
2024-08-07Replace classic C boolean operators with keywordsMaksim Denisov
! => not; && => and, || => or
2024-07-22Rename HashFunction methods and enumsMaksim Denisov
2024-07-22Use a fixed HashFunction is source_treeMaksim Denisov
2024-07-22Use HashFunction functionality via Instance()Maksim Denisov
...to track changes during refactoring easier.
2024-07-19Take shared repo-gc lock wherever neededKlaus Aehlig
2024-07-05FileSystemManager::CreateFileHardlink: return error code on failureKlaus Aehlig
Instead of returning a plain boolean, return an expected with the same boolean value that in case of an error indicates the error code. In this way, an error-specific handling is possible by consumers. While there, also add proper quoting of the involved file names.
2024-07-05Pass StorageConfig and Storage to ServeMaksim Denisov
2024-07-05Pass StorageConfig to git_repo and git_repo_remoteMaksim Denisov
2024-07-05Pass Storage and StorageConfig to StorageUtils by referenceMaksim Denisov
2024-07-05Pass StorageConfig to GarbageCollector::SharedLockMaksim Denisov
2024-07-05Use StorageConfig functionality via Instance()Maksim Denisov
...to track changes during refactoring easier.
2024-06-28Use (un)expected for serve serviceOliver Reiche
2024-06-28Use (un)expected for Git repoOliver Reiche
2024-06-25Pass IExecutionApi to IExecutionApi by referenceMaksim Denisov
...instead of not_null const ptr.
2024-06-25Remove CreateExecutionApiMaksim Denisov
2024-06-25Pass ApiBundle to SourceTreeServiceMaksim Denisov
2024-06-18Make RemoteServeConfig a general struct, not a singletonMaksim Denisov
...and adjust interfaces.
2024-06-18Pass RemoteServeConfig to ServeServerImpl by referenceMaksim Denisov
...instead of using singleton calls.
2024-06-18Use ServeApi during bootstrapMaksim Denisov
...with a default implementation. Although it is not used directly, it will be needed for instantiation of std::optional.
2024-06-18Use RemoteServeConfig functionality via Instance()Maksim Denisov
...to track changes during refactoring easier.
2024-05-15logging: Do not make assumptions in emit callsPaul Cristian Sarbu
The Emit method of the Logger class, when called with a string as second argument, expects it to be a format string. It should be considered a programming error to pass a string variable as that argument without knowing for certain that it does not contain any format escape character ('{', '}'); instead, one should be conservative and use the blind format string "{}" as second argument and pass the unknown string variable as third argument.