Skip to content

Add /submitartifacts multipart upload endpoint#66

Open
nuclearcat wants to merge 1 commit intokernelci:mainfrom
nuclearcat:uploadlogs
Open

Add /submitartifacts multipart upload endpoint#66
nuclearcat wants to merge 1 commit intokernelci:mainfrom
nuclearcat:uploadlogs

Conversation

@nuclearcat
Copy link
Copy Markdown
Member

@nuclearcat nuclearcat commented Jan 26, 2026

Add /submitartifacts endpoint for easier storage operation

Add new endpoint to accept artifacts uploads
via multipart and store them under <spool>/artifacts.

Signed-off-by: Denys Fedoryshchenko <denys.f@collabora.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new multipart upload endpoint to the Rust REST receiver to accept and spool “artifact” uploads and return a derived storage URL.

Changes:

  • Add POST /submitartifacts route and handler that parses multipart form data, validates fields, and writes an artifact file to <spool>/artifacts/.
  • Add filename/origin/submission_id validation helpers plus a JSON response type for artifact uploads.
  • Document the new endpoint in README.md and enable Axum’s multipart feature in Cargo.toml.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
kcidb-restd-rs/src/main.rs Adds /submitartifacts route + multipart handler and validation/util helpers.
kcidb-restd-rs/README.md Documents /submit and new /submitartifacts usage and responses.
kcidb-restd-rs/Cargo.toml Enables Axum multipart support for the new endpoint.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

return (StatusCode::BAD_REQUEST, err_json);
}
};
let file_bytes = match file_bytes {
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

normalize_log_filename is called here but is not defined anywhere in this crate (search only finds this call), which will fail compilation. Either implement normalize_log_filename or remove the call and use sanitized directly (and drop normalized_name if not needed).

Copilot uses AI. Check for mistakes.
Comment thread kcidb-restd-rs/src/main.rs
Comment thread kcidb-restd-rs/src/main.rs
let app = Router::new()
.route("/", get(handle_root))
.route("/submit", post(receive_submission))
.route("/submitartifacts", post(receive_artifacts))
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is existing test coverage for the REST API in kcidb-restd-rs/tests/test_rest.sh, but it doesn’t exercise the new /submitartifacts endpoint (success + key error cases like missing fields/unauthorized/conflict). Please add coverage so regressions in multipart parsing and file handling are caught.

Copilot uses AI. Check for mistakes.
@nuclearcat nuclearcat changed the title Add /submitlogs multipart log upload endpoint Add /submitartifacts multipart log upload endpoint Jan 26, 2026
@nuclearcat nuclearcat changed the title Add /submitartifacts multipart log upload endpoint Add /submitartifacts multipart upload endpoint Jan 26, 2026
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.

2 participants