Search in sources :

Example 1 with EnrichedOperation

use of build.buildfarm.operations.EnrichedOperation in project bazel-buildfarm by bazelbuild.

the class EnrichedOperationBuilder method build.

/**
 * @brief Create an enriched operation based on an operation key.
 * @details This will make calls to get blobs, and resolve digests into the appropriate data
 *     structures.
 * @param cluster An established redis cluster.
 * @param instance An instance is used to get additional information about the operation.
 * @param operationKey Key to get operation from.
 * @return Operation with populated metadata.
 * @note Suggested return identifier: operation.
 */
public static EnrichedOperation build(JedisCluster cluster, Instance instance, String operationKey) {
    EnrichedOperation operationWithMetadata = new EnrichedOperation();
    operationWithMetadata.operation = operationKeyToOperation(cluster, operationKey);
    // the operation could not be fetched so there is nothing further to derive
    if (operationWithMetadata.operation == null) {
        return operationWithMetadata;
    }
    operationWithMetadata.action = actionDigestToAction(instance, operationToActionDigest(operationWithMetadata.operation));
    // the action could not be fetched so there is nothing further to derive
    if (operationWithMetadata.action == null) {
        return operationWithMetadata;
    }
    operationWithMetadata.command = commandDigestToCommand(instance, operationWithMetadata.action.getCommandDigest());
    return operationWithMetadata;
}
Also used : EnrichedOperation(build.buildfarm.operations.EnrichedOperation)

Aggregations

EnrichedOperation (build.buildfarm.operations.EnrichedOperation)1