Skip to content

Commit

Permalink
Merge pull request #90 from Mic92/merge-when-green-joerg
Browse files Browse the repository at this point in the history
check for new cacheStatus attribute in nix-eval-jobs output
  • Loading branch information
Mic92 authored Jan 6, 2025
2 parents ed736c6 + 19e76bc commit e7a508e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,8 @@ pull_request_rules:
conditions: []
actions:
queue:
- name: delete branches 24 hours post-merge
conditions:
- merged-at < 1 day ago
actions:
delete_head_branch:
17 changes: 14 additions & 3 deletions nix_fast_build/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,7 @@ class StopTask:
async def run_evaluation(
eval_proc: Process,
build_queue: Queue[Job | StopTask],
upload_queue: Queue[Build | StopTask],
result: list[Result],
opts: Options,
) -> int:
Expand All @@ -761,9 +762,17 @@ async def run_evaluation(
)
if error:
continue
is_cached = job.get("isCached", False)
if is_cached:
cache_status = job.get("cacheStatus")
if cache_status is None:
# Legacy attribute
if job.get("isCached", False):
continue
# Skip remotely cached jobs, but still consider
# them for pushing if they are cached locally
elif cache_status == "cached":
continue
elif cache_status == "local":
upload_queue.put_nowait(Build(attr, job["drvPath"], job.get("outputs", {})))
system = job.get("system")
if system and system not in opts.systems:
continue
Expand Down Expand Up @@ -972,7 +981,9 @@ async def run(stack: AsyncExitStack, opts: Options) -> int:
async with TaskGroup() as tg:
tasks = []
tasks.append(
tg.create_task(run_evaluation(eval_proc, build_queue, results, opts))
tg.create_task(
run_evaluation(eval_proc, build_queue, upload_queue, results, opts)
)
)
evaluation = tasks[0]
build_output = sys.stdout.buffer
Expand Down

0 comments on commit e7a508e

Please sign in to comment.