oxidecomputer / oxidecomputer/buildomat

file publishing should report errors

Open
#10 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
72
Forks
5
PR merge metrics
No merged PRs in 30d

Description

At present, if you add a [[publish]] directive to the TOML, but something about it was wrong, we not only do not fail the job but we don't even report the problem. This happens in wollogong, in the basic variety code:

            /*
             * Resolve any publishing directives.  For now, we do not handle
             * publish rules that did not match any output from the actual job.
             * We also do not yet correctly handle a failure to publish, which
             * will require more nuance in reported errors from Dropshot and
             * Progenitor.  This feature is broadly still experimental.
             */
            for p in c.publish.iter() {
                if let Some(o) =
                    outputs.iter().find(|o| o.path == p.from_output)
                {
                    b.job_output_publish(
                        jid,
                        &o.id,
                        &buildomat_openapi::types::JobOutputPublish {
                            series: p.series.to_string(),
                            version: cs.head_sha.to_string(),
                            name: p.name.to_string(),
                        },
                    )
                    .await
                    .ok();
                }
            }

https://github.com/oxidecomputer/buildomat/blob/085e7685f3d3a6b99edbd7fb336533c84bf64fbe/github/server/src/variety/basic.rs#L420-L443

It is probably time to consider this less experimental:

  • publish directives for files not produced as output artefacts should be reported and fail the job
  • publish failures for otherwise present output artefacts should be also be reported and fail the job

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in github/server/src/variety/basic.rs around the publishing loop at lines 420-443, and inspect how job_output_publish results and missing output artifacts are handled. Done means an unmatched publish directive reports an error and fails the job, and a failed publish for an existing artifact is also reported and fails the job.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.