Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/ofborg
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 8026cc423dd5
Choose a base ref
...
head repository: NixOS/ofborg
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 16355e10b4e4
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Jan 29, 2021

  1. ofborg: post a finished check if evaluation starts

    We need this for better integration into github.
    Mic92 authored and cole-h committed Jan 29, 2021
    Copy the full SHA
    16355e1 View commit details
Showing with 19 additions and 0 deletions.
  1. +19 −0 ofborg/src/tasks/evaluate.rs
19 changes: 19 additions & 0 deletions ofborg/src/tasks/evaluate.rs
Original file line number Diff line number Diff line change
@@ -32,6 +32,23 @@ pub struct EvaluationWorker<E> {
tag_paths: HashMap<String, Vec<String>>,
}

/// Creates a finished github check, indicating that the ofborg eval started.
/// This is a workaround github REST api, that only exposes finished external checks.
/// We use the check status in our "Waiting for github action"
fn post_eval_started_status(
api: hubcaps::statuses::Statuses,
commit: String,
) -> Result<(), EvalWorkerError> {
Ok(CommitStatus::new(
api,
commit,
"ofborg-eval-started".to_owned(),
"Evaluation started".to_owned(),
None,
)
.set(hubcaps::statuses::State::Success)?)
}

impl<E: stats::SysEvents> EvaluationWorker<E> {
#[allow(clippy::too_many_arguments)]
pub fn new(
@@ -315,6 +332,8 @@ impl<'a, E: stats::SysEvents + 'static> OneEval<'a, E> {

overall_status.set_with_description("Starting", hubcaps::statuses::State::Pending)?;

post_eval_started_status(repo.statuses(), job.pr.head_sha.clone())?;

evaluation_strategy.pre_clone()?;

let project = self