summaryrefslogtreecommitdiff
path: root/src/other_tools/root_maps/commit_git_map.cpp
AgeCommit message (Collapse)Author
2025-02-24just-mr setup: Remove warnings when fallback to network is availablePaul Cristian Sarbu
2025-02-11checkout locations: support extra environment variables to inheritKlaus Aehlig
2025-01-23JustMr: Replace calls to CheckServeHasAbsentRoot with direct calls to serveMaksim Denisov
2025-01-23JustMr: CommitGitMap: Remove unused arguments.Maksim Denisov
2025-01-23JustMr: CommitGitMap: Use serve callsMaksim Denisov
...instead of EnsureAbsentRootOnServe.
2024-12-19Remove unneeded compat_storageOliver Reiche
2024-11-14other_tools/repo_map,root_maps: Implement IWYU suggestionsPaul Cristian Sarbu
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-09-11Use ArtifactDigestFactory in just-mr mapsMaksim Denisov
...to create ArtifactDigests.
2024-08-26GitOps: Pass source directory to GitInitialCommit operationPaul Cristian Sarbu
While there, ensure optional Git operation parameters are checked before use for the operations that require them.
2024-08-26GitOpParams: Remove unneeded branch fieldPaul Cristian Sarbu
The 'branch' field is deprecated, not being used by any of the critical Git operations, thus it can be removed.
2024-07-29commit_git_map: fix line breaking in error messagesKlaus Aehlig
2024-07-23git_commit_map: avoid duplicate creation and fix usageKlaus Aehlig
... as CheckCommitExists returns an optional bool, not a plain one.
2024-07-23just-mr: Use progress instance in setup mapsPaul Cristian Sarbu
...instead of using the singleton.
2024-07-19commit_git_map: take commit from older generations, if found thereKlaus Aehlig
If we're asked to fetch a commit that is not present in our git root right away, first look for it in older generations before starting the actual fetch.
2024-07-05Pass StorageConfig and Storage to just-mr mapsMaksim 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-05Use StorageConfig functionality via Instance()Maksim Denisov
...to track changes during refactoring easier.
2024-06-28Use (un)expected for serve APIOliver Reiche
2024-06-28Use (un)expected for Git repoOliver Reiche
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 IExecutionApiMaksim Denisov
...instead of std::optional<gsl::not_null<IExecutionApi const*>>
2024-06-25Introduce a type allias for an optional ptr to IExecutionApiMaksim Denisov
...and replace verbose constructions.
2024-06-25Use constant IExecutionApi in just-mr mapsMaksim Denisov
2024-06-25Pass IExecutionApi to IExecutionApi by referenceMaksim Denisov
...instead of not_null const ptr.
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-05-02Small changes to allow gsl-lite supportPaul Cristian Sarbu
The gsl-lite implementation is slightly more picky in terms of type conversions and constness resolution in initializers, therefore small changes were needed.
2024-03-13Move storage-aware tmpdir creation to configKlaus Aehlig
... as the fs_utils have a lot more dependencies making them usable in less places. Moreover, this function also serves to shape the layout of the local build root and hence is more appropriately placed in the config anyway.
2024-03-08just-mr: Fix "preferred hostnames"Oliver Reiche
... instead of replacing the host name of each mirror, it should only reorder the list of given mirrors.
2024-03-08just-mr: Normalize paths of Git file URLsOliver Reiche
... and ensure that paths starting with .// remain relative.
2024-03-08just-mr: Fix shell out executionOliver Reiche
... by avoiding reusing temp dirs for execute. While we are at it, also refactor LocalFetchViaTmpRepo() to create its own empty temp dirs, that cannot be reused by the caller.
2024-02-27just-mr: Correct handling of remotes with respect to compatibility modePaul Cristian Sarbu
In order to set up roots, just-mr is able to interrogate, if given, serve and/or remote-execution endpoints. However, just-mr operates only with Git hashes, i.e., with a native mode CAS. This commit ensures the correct interactions occur between just-mr and the provided endpoints not only in native mode, but also in comaptible mode, where a serve endpoint might be present even if one cannot make use of its associated remote-exection endpoint. The user always gets informed if any incompatibilities are detected.
2024-02-27commit_git_map: Proper handling of file associationPaul Cristian Sarbu
This commit fixes the invariant that a file association between a Git commit and the root tree should only be set if that tree is found in our own Git cache. This ensures consistency between present and absent roots and in the interaction with the serve endpoint.
2024-02-20git repo fetch: support "inherit env"Klaus Aehlig
When fetching git repositories, just-mr routinely shells out to git. In this case, allow the user to specify via "inherit env", which environment variables from the host environment should be made available in this action. Typical variables to inherit are ones providing credentials, like SSH_AUTH_SOCK. As the repository description specifies the commit that will be taken, and hence the resulting tree, correctness is not affected by the environement leaking in here.
2024-02-20Git URL scheme handling: whitelist path instead of non-path protocolsKlaus Aehlig
At some point we have to decide if a given git repository URL is a path. So far, we assumed that anything not starting with ssh://, http://, or https:// is a path. This ignores the facts that - the file:// scheme, while referring to a file, does not denote a relative path starting file://, - the [user@]host:path scheme is not a path on the local machine, - there exist the URL schemes git://, ftp://, and ftps://, and - future extension might add additional schemes. To also correctly handle new schemes that git might add (which we indeed can handle, as we simply shell out to the git binary), we reverse the approach: we give the user the means to unambigiously specify that they refer to a path on the local machine, by either - using the file:// scheme, - providing an absolute path starting with /, or - providing a relative path starting with ./ All other schemes will not be modified. The file scheme, as well as the git://, http://, and https:// scheme, are handled interally using libgit2; all others are passed on to git in an unmodified form.
2024-01-31just-mr: Serve endpoint always implies a remote-execution endpointPaul Cristian Sarbu
As the serve service always has an associated remote-execution endpoint, when just-mr gets passed only a serve endpoint address it will now default to implying a remote-execution endpoint exists too at that address. Additionally, now the implementation of the --backup-to-remote option more clearly shows that it can only be done in native mode.
2024-01-31just-mr: Failure in serve api root tree requests should be fatalPaul Cristian Sarbu
The requests to retrieve the tree of a commit, archive, or distdir also set up those trees in a way that the serve endpoint can later build against them, besides allowing just-mr to set up roots locally. Therefore, if the witnessing entity (Git commit, content blob, or distdir, respectively) is known to the serve endpoint, then failing to set up the root tree there should result in a failure also of the just-mr setup on the client side.
2024-01-31serve source tree: Increase server-side granularity in response statusesPaul Cristian Sarbu
For archives and Git repositories we should ensure that not finding the witnessing entity (archive content blob or Git commit, respectively) results in a distinct status in the response to a request that sets up roots on the serve endpoint. This will allow just-mr to better handle its interaction with the serve endpoint.
2024-01-26just-mr 'git' repository: Absent roots sync with serve endpointPaul Cristian Sarbu
To take advantage of absent roots, we need to ensure that a given serve endpoint can build against the tree of this generated root. To this end, for a 'git' repository we only set the root as absent if the serve endpoint knows already the root, it can set it up itself, or we can create the root locally without a network fetch and then upload it to the serve endpoint via the remote CAS. A network fetch never gets performed for an absent root. If a serve endpoint is not provided, an absent root can still be generated, but only if no network fetches are required. In this case a warning is emitted.
2024-01-26just-mr async maps: Wrap passed raw pointersPaul Cristian Sarbu
This is to uphold the coding style guide we employ.
2024-01-26just-mr 'git' repository: Fix wrong witnessing repo when remote CAS provides ↵Paul Cristian Sarbu
tree When the remote CAS provides the root tree, we perform an import-to-git operation, therefore the correct witnessing repository for the tree should always be the Git cache.
2024-01-26root_maps: Small cleanup of includes and targets filePaul Cristian Sarbu
...for more easily readable and maintainable target descriptions.
2023-12-19other_tools: Fix missing includes of direct dependenciesPaul Cristian Sarbu
This fixes the multiple instances of (mainly) missing or wrong includes of standard, third-party, and own headers in the other_tools source folder.
2023-12-19just-mr setup: Add missing reporting of failed hostname replacementPaul Cristian Sarbu
2023-12-19just-mr setup: Fix bug in fetching Git reposPaul Cristian Sarbu
This bug was introduced with the alternative mirrors changes.
2023-12-01just-mr git: Report all tried remotes if fetch failsPaul Cristian Sarbu