Skip to content

fix(USE-003): emit staged mode preview summary in upload_artifact handler#26313

Merged
pelikhan merged 2 commits intomainfrom
copilot/use-003-upload-artifact-preview
Apr 14, 2026
Merged

fix(USE-003): emit staged mode preview summary in upload_artifact handler#26313
pelikhan merged 2 commits intomainfrom
copilot/use-003-upload-artifact-preview

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 14, 2026

upload_artifact.cjs silently skipped uploads in staged mode with only a bare core.info log, unlike every other handler which writes a rich 🎭 Staged Mode step summary so users can verify intent before going live.

Changes

  • actions/setup/js/upload_artifact.cjs: Replace the silent core.info in the staged-mode else-block with a full step summary via core.summary.addRaw(...).write(), listing artifact name, files, total size, and retention days:
## 🎭 Staged Mode: Upload Artifact Preview

The following artifact upload would be performed if staged mode was disabled:

**Artifact Name:** my-reports
**Files (2):**
- `dist/report.json`
- `dist/summary.html`

**Total Size:** 4096 bytes
**Retention:** 30 days

> ℹ️ Upload skipped (staged mode active)
  • actions/setup/js/upload_artifact.test.cjs: Add test asserting the summary is written and contains 🎭 Staged Mode / Upload Artifact Preview when staged mode is active.

Copilot AI changed the title [WIP] Add staged mode preview summary for upload_artifact.cjs fix(USE-003): emit staged mode preview summary in upload_artifact handler Apr 14, 2026
Copilot AI requested a review from pelikhan April 14, 2026 22:37
@pelikhan pelikhan marked this pull request as ready for review April 14, 2026 22:37
Copilot AI review requested due to automatic review settings April 14, 2026 22:37
@pelikhan pelikhan merged commit 9939478 into main Apr 14, 2026
54 checks passed
@pelikhan pelikhan deleted the copilot/use-003-upload-artifact-preview branch April 14, 2026 22:37
Copy link
Copy Markdown
Contributor

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 rich step summary preview for upload_artifact when staged mode is active, aligning its behavior with other handlers so users can verify what would have been uploaded before enabling live writes.

Changes:

  • Replace the staged-mode core.info skip message with a full core.summary preview (artifact name, file list, total size, retention, and “skipped” note).
  • Add a unit test asserting the staged-mode step summary is written and contains key preview text.
Show a summary per file
File Description
actions/setup/js/upload_artifact.cjs Writes a staged-mode upload preview to the GitHub Actions step summary instead of only logging a skip message.
actions/setup/js/upload_artifact.test.cjs Adds coverage to ensure the staged-mode preview summary is emitted and written.

Copilot's findings

Tip

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

  • Files reviewed: 2/2 changed files
  • Comments generated: 0

@github-actions github-actions bot mentioned this pull request Apr 14, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🧪 Test Quality Sentinel Report

Test Quality Score: 100/100

Excellent test quality

Metric Value
New/modified tests analyzed 1
✅ Design tests (behavioral contracts) 1 (100%)
⚠️ Implementation tests (low value) 0 (0%)
Tests with error/edge cases 1 (100%)
Duplicate test clusters 0
Test inflation detected No (1:1 ratio — 14 test lines / 14 production lines)
🚨 Coding-guideline violations None

Test Classification Details

Test File Classification Issues Detected
"emits a staged mode preview summary when staged mode is active" actions/setup/js/upload_artifact.test.cjs:402 ✅ Design None

Flagged Tests — Requires Review

No tests flagged. The single new test is clean.


Language Support

Tests analyzed:

  • 🐹 Go (*_test.go): 0 tests
  • 🟨 JavaScript (*.test.cjs, *.test.js): 1 test (vitest)

Verdict

Check passed. 0% of new tests are implementation tests (threshold: 30%).

The new test directly exercises the behavioral contract introduced by the fix: when staged mode is active, the handler must emit a core.summary preview containing the artifact name, file list, size, and retention information. It verifies the observable output (summary content strings and the write() call), not internal implementation details.

Mocking strategy is appropriate — global.core and the artifact client are external I/O (GitHub Actions runtime), not internal business logic.


📖 Understanding Test Classifications

Design Tests (High Value) verify what the system does:

  • Assert on observable outputs, return values, or state changes
  • Cover error paths and boundary conditions
  • Would catch a behavioral regression if deleted
  • Remain valid even after internal refactoring

Implementation Tests (Low Value) verify how the system does it:

  • Assert on internal function calls (mocking internals)
  • Only test the happy path with typical inputs
  • Break during legitimate refactoring even when behavior is correct
  • Give false assurance: they pass even when the system is wrong

Goal: Shift toward tests that describe the system's behavioral contract — the promises it makes to its users and collaborators.

🧪 Test quality analysis by Test Quality Sentinel · ● 1.2M ·

Copy link
Copy Markdown
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

✅ Test Quality Sentinel: 100/100. Test quality is excellent — 0% of new tests are implementation tests (threshold: 30%). The single new test verifies the behavioral contract that staged mode emits a correctly-structured summary preview.

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.

[Safe Outputs Conformance] USE-003: upload_artifact.cjs missing 🎭 Staged Mode preview summary

3 participants