Skip to content

Enhance pick_experiment.cjs step summary with description and issue link#29627

Merged
pelikhan merged 2 commits intomainfrom
copilot/enhance-pick-experiment-summary
May 1, 2026
Merged

Enhance pick_experiment.cjs step summary with description and issue link#29627
pelikhan merged 2 commits intomainfrom
copilot/enhance-pick-experiment-summary

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 1, 2026

The pick_experiment.cjs step summary only surfaced variant assignment counts, leaving engineers to dig into workflow YAML to understand experiment purpose and tracking context.

Changes

  • actions/setup/js/pick_experiment.cjs: Extended writeSummary to append a ### Experiment Details section when any experiment declares description or issue metadata. Per experiment: bold name, > {description} blockquote, and Tracking issue: [#N](https://github.com/{repo}/issues/N) link (via GITHUB_REPOSITORY env var; falls back to plain #N if unset). No output change for bare-array experiments — fully backward-compatible.

  • actions/setup/js/pick_experiment.test.cjs: Five new tests covering description-only, issue-only, both fields, legacy bare-array (no extras emitted), and missing-GITHUB_REPOSITORY fallback.

Example output (object-form experiment with both fields)

## 🧪 A/B Experiment Assignments

| Experiment | Selected Variant | All Variants | Cumulative Counts |
| --- | --- | --- | --- |
| `style` | **concise** | concise, verbose | concise: 3, verbose: 2 |

### Experiment Details

**style**

> Controls response verbosity for the summarization workflow.

Tracking issue: [#42](https://github.com/github/gh-aw/issues/42)

Copilot AI changed the title [WIP] Enhance pick_experiment.cjs step summary with description and issue link Enhance pick_experiment.cjs step summary with description and issue link May 1, 2026
Copilot AI requested a review from pelikhan May 1, 2026 21:18
@pelikhan pelikhan marked this pull request as ready for review May 1, 2026 21:29
Copilot AI review requested due to automatic review settings May 1, 2026 21:29
@pelikhan pelikhan merged commit a64f03f into main May 1, 2026
6 of 9 checks passed
@pelikhan pelikhan deleted the copilot/enhance-pick-experiment-summary branch May 1, 2026 21:30
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

Enhances the pick_experiment.cjs step summary so engineers can see experiment purpose and tracking context (description + tracking issue link) directly in the workflow run summary.

Changes:

  • Extend writeSummary to optionally append an “Experiment Details” section with description (blockquote) and a tracking issue link derived from GITHUB_REPOSITORY.
  • Add unit tests covering description-only, issue-only, both fields, legacy bare-array behavior, and missing-GITHUB_REPOSITORY fallback.
Show a summary per file
File Description
actions/setup/js/pick_experiment.cjs Appends optional experiment metadata (description + issue link) to the step summary.
actions/setup/js/pick_experiment.test.cjs Adds tests validating the new summary rendering and backward compatibility.

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: 1

Comment on lines +212 to +215
if (description) {
lines.push("");
lines.push(`> ${description}`);
}
@github-actions github-actions Bot mentioned this pull request May 1, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 1, 2026

🧪 Test Quality Sentinel Report

Test Quality Score: 72/100

⚠️ Acceptable — with suggestions

Metric Value
New/modified tests analyzed 5
✅ Design tests (behavioral contracts) 5 (100%)
⚠️ Implementation tests (low value) 0 (0%)
Tests with error/edge cases 2 (40%)
Duplicate test clusters 0
Test inflation detected ✅ Yes (78 test lines / 28 production lines = 2.79:1, threshold 2:1)
🚨 Coding-guideline violations None

Test Classification Details

View all 5 test classifications
Test File Classification Issues Detected
includes description as blockquote in step summary when description field is set actions/setup/js/pick_experiment.test.cjs ✅ Design Happy-path only; no edge cases
includes tracking issue link in step summary when issue field is set actions/setup/js/pick_experiment.test.cjs ✅ Design Happy-path only; no edge cases
includes both description and issue link when both fields are set actions/setup/js/pick_experiment.test.cjs ✅ Design Happy-path only; combination of the above two
does not include description or issue extras for legacy bare-array experiments actions/setup/js/pick_experiment.test.cjs ✅ Design Negative assertion; covers backward-compat invariant
renders issue number without link when GITHUB_REPOSITORY is not set actions/setup/js/pick_experiment.test.cjs ✅ Design Edge case: missing env var graceful degradation

Flagged Tests — Suggestions for Improvement

No tests were classified as implementation tests. The following are improvement suggestions rather than blocking issues:

⚠️ Test inflation: 78 test lines added for 28 production lines (ratio 2.79:1)

Threshold: 2:1
Note: The production change was focused (one if block in writeSummary), but 5 new tests cover it from multiple angles. The tests are individually high-value — this flag reflects proportionality, not test quality. Consider whether tests 1 & 2 could be folded into test 3 (the combination test) to reduce redundancy.

💡 includes both description and issue link when both fields are set

Classification: Design test — but partially overlaps with tests 1 and 2.
Suggestion: This test is the strongest of the three description/issue tests since it verifies both fields interact correctly. The standalone "description only" and "issue only" tests are still valuable to pinpoint which field fails in isolation. No changes required.

💡 Missing assertion messages

The new expect(rawCall).toContain(...) calls lack a descriptive message argument (e.g. expect(rawCall).toContain("...", "description should appear as blockquote")). While this is not a hard violation in vitest, adding messages makes failure output more readable. Low priority.


Language Support

Tests analyzed:

  • 🐹 Go (*_test.go): 0 tests — no Go test files modified in this PR
  • 🟨 JavaScript (*.test.cjs): 5 tests (vitest)

Verdict

Check passed. 0% of new tests are implementation tests (threshold: 30%). All 5 new tests verify observable behavioral contracts of the writeSummary function — specifically the rendering of description and issue fields into the GitHub Actions step summary. The minor inflation flag (2.79:1 ratio) does not block the merge; the tests are well-written and genuinely catch behavioral regressions.


📖 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.

References:

🧪 Test quality analysis by Test Quality Sentinel · ● 694.4K ·

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: 72/100. Test quality is acceptable — 0% of new tests are implementation tests (threshold: 30%). All 5 new tests verify observable behavioral contracts.

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.

[plan] Enhance pick_experiment.cjs step summary with description and issue link

3 participants