shy-advantage-49800
11/28/2021, 12:44 PMclass CustomSetupKwargsRequest(SetupKwargsRequest):
@classmethod
def is_applicable(cls, _: Target) -> bool:
return True
@rule(level=LogLevel.DEBUG)
async def setup_kwargs_plugin(request: CustomSetupKwargsRequest) -> SetupKwargs:
result = await Get(
ProcessResult,
Process(
argv=["/bin/git", "rev-parse", "--short", "HEAD"],
description="Retrieve last commit hash.",
),
)
I'm not sure if I'm doing it the way it should be, but is this the right way to get the commit hash? I need to add a input_digest
and working_directory
as well, I guess? Am I supposed to create a Snapshot with .git
? 🤔happy-kitchen-89482
11/28/2021, 2:16 PM.git
directory into a sandbox every time is likely to be inefficient.happy-kitchen-89482
11/28/2021, 2:19 PMhappy-kitchen-89482
11/28/2021, 2:21 PM.git
, and I think the git
binary climbs the filesystem until it finds .git
, so things might just work with no input_digest
?happy-kitchen-89482
11/28/2021, 2:21 PMhappy-kitchen-89482
11/28/2021, 2:23 PMhappy-kitchen-89482
11/28/2021, 2:23 PMhappy-kitchen-89482
11/28/2021, 2:23 PMmodern-wolf-36228
11/28/2021, 5:16 PMcurved-television-6568
11/28/2021, 6:45 PM