[Feature] : API ENDPOINTS PR 7 : Test Artifacts and Cleanups#1141
Open
pulk17 wants to merge 9 commits into
Open
[Feature] : API ENDPOINTS PR 7 : Test Artifacts and Cleanups#1141pulk17 wants to merge 9 commits into
pulk17 wants to merge 9 commits into
Conversation
542cd43 to
3236d01
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



[FEATURE]
In raising this pull request, I confirm the following (please check boxes):
My familiarity with the project is as follows (check one):
Test Artifacts and API Cleanup (PR 7)
Summary
Follow-up to the REST API stack (#1130–#1135). This PR completes the
test-artifact feature end to end: the CI test VMs now upload the run binary,
any core dump, and the combined stdout/stderr log, and the platform stores them
where
GET /runs/{id}/artifacts(from PR 3) already serves them. It also foldsin the small leftover review nits from the API stack and adds a way to verify
the runner scripts.
How artifacts flow
ci-linux/ci/runCIandci-windows/ci/runCI.batcapture the build binary, a core dump (Linux), and the run's combined
stdout/stderr, and upload them over the existing
reportURLchannel with anew
type=artifactuploadform — the same mechanism already used forlogupload. Uploads are best-effort and never abort a run. Windows skips thecore dump for v1 (the API tolerates a missing one).
progress_reportergains anartifactuploadhandlerthat stores each file under
SAMPLE_REPOSITORY/test_artifacts/<run_id>/usingthe exact name the API resolves. The target name is derived server-side from
the artifact type + platform — never from the uploaded filename — so a crafted
filename can't escape the artifact directory.
GET /runs/{id}/artifactsalready readstest_artifacts/<run_id>/...and returns signed URLs. (As with the existinglog/result uploads, this assumes
SAMPLE_REPOSITORYis the GCS-backed mounton the platform host.)
startup-script.shalso gets three small VM-provisioning fixes (apt -y, aTempFilesdir for the tester, and a short wait for the gcsfuse mounts).Verifying the runner scripts
New
tests/ci-vm/checks, runnable locally and in CI, with no real VM/GCS:runCI): behavioural smoke test — stubscurl/sudo/shutdownand the tester, runs the script in a sandbox, and asserts it posts
preparation → testing → completed, uploads the build log, and uploads thebinaryandcombined_stdoutartifacts.runCI.bat): static check — a faithful behavioural mock isn'tpractical on Windows (
postStatus's retry loop needs a realcurl, aninteractive
timeout, andset /pfile reads), so this asserts the scriptparses and contains the artifact-upload wiring; the real behaviour runs on the
Windows CI VM.
ci-vm-scriptsGitHub Actions matrix runsshellcheck+ the Linux smoketest on ubuntu, and
PSScriptAnalyzer+ the static check on windows, wheneveranything under
install/ci-vm/changes.While writing the Windows harness I found and fixed a pre-existing Windows
bug in
runCI.bat: thepreparationstatus usedcall :postStatus ... >> %logFile%,an outer redirect that the Linux runner and every other
postStatuscall don'thave. On Windows that outer redirect holds
log.htmlopen, so postStatus'sinternal
>> %logFile%to the same file fails with a sharing violation. Droppingthe redundant redirect (now consistent with the other calls) resolves it.
Leftover API fixes (from review of the stack)
list_tokensis admin-only (contributor/tester could never hold the requiredtokens:managescope, so the wider role list was misleading).403branch inrevoke_specific_token.repository-optional fallback increate_run(the field isrequired by the schema).
?statusfilter to the statuses the engine can emit.via API)cancellations as infra failures.
?levelfilter is now case-insensitive.Testing
suites (
auth,runs,samples) and the error-service suite pass.Windows runner's end-to-end behaviour is validated on the
windows-latestCI job.
isort/pydocstyle/pycodestyle/mypyclean on the changed modules.