Skip to content

Read the task commit from task_info.yaml - #943

Open
rcannood wants to merge 1 commit into
mainfrom
fix/task-info-commit
Open

Read the task commit from task_info.yaml#943
rcannood wants to merge 1 commit into
mainfrom
fix/task-info-commit

Conversation

@rcannood

Copy link
Copy Markdown
Member

Describe your changes

get_task_info hardcoded the commit, so every task_info.json we have ever
published carries "commit": null:

commit = jsonlite::unbox(NA_character_), # TODO: Add when available in task_info.yaml

It now reads the field:

commit = jsonlite::unbox(task_info_yaml$commit %||% NA_character_),

The %||% is there for the null rather than as a placeholder -- unbox(NULL)
serialises to {}, not null, so dropping it entirely would change the shape of
the output for every task that does not write the field yet:

jsonlite::toJSON(list(commit = jsonlite::unbox(list()$commit)))
#> {"commit":{}}
jsonlite::toJSON(list(commit = jsonlite::unbox(list()$commit %||% NA_character_)))
#> {"commit":null}

A task that does not supply a commit keeps emitting null, which is exactly what it
does today -- no "missing-sha" placeholder, since a gap here should be fixed in
whatever generated the results rather than papered over.

The other half is in the task repos: run_benchmark has to write workflow.commitId
into task_info.yaml. openproblems-bio/task_spatial_simulators#33 does that, and I
will send the same to task_template.

Issue ticket number and link

Closes #942

Checklist before requesting a review

  • I have performed a self-review of my code

  • Check the correct box. Does this PR contain:

    • Breaking changes
    • New functionality
    • Major changes
    • Minor changes
    • Bug fixes
    • Documentation
  • Proposed changes are described in the CHANGELOG.md

  • CI Tests succeed and look good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

get_task_info hardcodes commit to NA, so every task_info.json reports a null commit

1 participant