Skip to content

[jsweep] Clean workflow_metadata_helpers.cjs - #76127

Merged
pelikhan merged 1 commit into
mainfrom
signed/jsweep/workflow-metadata-helpers-6f7e8a0b1cdbece0
Nov 9, 2026
Merged

pelikhan merged 1 commit into
mainfrom
signed/jsweep/workflow-metadata-helpers-6f7e8a0b1cdbece0

Conversation

@github-actions

@github-actions github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

jsweep: workflow_metadata_helpers.cjs

Context: github-script

Changes

  • getWorkflowMetadata now accepts an optional ctx parameter (defaults to global context) instead of reading the implicit global directly; JSDoc updated. Existing callers unchanged.

Tests

  • +2 tests (explicit context override, missing runId fallback). 20 total in file.

Validation

  • Formatting npm run format:cjs ✓
  • Linting npm run lint:cjs ✓
  • Type checking npm run typecheck ✓
  • Tests: targeted tests pass ✓. Full npm run test:js shows failures only in unrelated upload_assets.test.cjs.

Generated by 🧹 jsweep - JavaScript Unbloater · copilot · auto (Claude Sonnet 5.5, Claude Haiku 5.5) · ~46 AIC · ⌖ ~2 AIC · ⊞ 13.2K · ◷

  • expires on Nov 10, 2026, 8:04 PM UTC-08:00

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@pelikhan
pelikhan marked this pull request as ready for review November 9, 2026 04:27
Copilot AI adaptive review requested due to automatic review settings November 9, 2026 04:27
@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Test Quality Sentinel · routed: haiku55 xhigh · ~1 AIC · ⌖ ~2 AIC · ◇ ~1 AIC · ⊞ 7.2K · ◷

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Ponytail Reviewer completed successfully!

Generated by Ponytail Reviewer for #76127

@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor Author

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ PR Specification Reviewer completed successfully!

PR Specification Reviewer

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from PR Specification Reviewer · gpt56 · ~2 AIC · ⌖ ~1 AIC · ◇ ~1 AIC · ⊞ 1.7K · ◷

Generated by PR Specification Reviewer for #76127

@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft.

Design Decision Gate 🏗️

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Design Decision Gate 🏗️ · routed: haiku55 xhigh · ~1 AIC · ⌖ ~2 AIC · ◇ ~1 AIC · ⊞ 8.6K · ◷

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ PR Code Quality Reviewer completed the code quality review.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

What this change does: It adds an optional context override to workflow metadata and tests it. Existing callers continue to use the global context.

Should fix: The override has no production caller, so it adds an unused option and tests to maintain. Remove it until needed.

Verdict: fix 1 first.
Lean: -15 lines possible.

Generated by ✂️ Ponytail Reviewer for #76127 · codex · routed: gpt61 medium · ~4 AIC · ⌖ ~1 AIC · ⊞ 181
Comment /ponytail to run again

* @returns {{workflowName: string, workflowId: string, runId: number, runUrl: string}} Workflow metadata
*/
function getWorkflowMetadata(owner, repo) {
function getWorkflowMetadata(owner, repo, ctx = context) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Should fix: All three production callers use the global context, and the override is used only by the two new tests; remove the unused parameter and those tests until a caller needs it, saving 15 net lines of code to maintain.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reviewed the changed helper and tests. The explicit context override preserves existing callers and correctly falls back to the default context; coverage includes custom and missing run IDs. No actionable correctness or regression issues found in the changed lines.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~1 AIC · ⌖ ~1 AIC · ⊞ 1.6K
Comment /review to run again

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are identified for the injectable context change and its documented fallback behavior.

No open issues 🎉

What changed in this PR

Updates getWorkflowMetadata to accept an optional GitHub Actions context while preserving existing callers that use the global context.

Changes:

  • Added an optional ctx parameter with a global context fallback.
  • Updated the JSDoc and metadata URL construction.
  • Added tests for explicit context overrides and missing runId fallback behavior.
File Summary
actions/​setup/​js/​workflow_metadata_helpers.test.cjs Covers explicit context handling and default runId behavior.
actions/​setup/​js/​workflow_metadata_helpers.cjs Adds injectable context support while retaining existing behavior.

Review effort: Lite (auto)

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Skills-Based Review 🧠

Applied /codebase-design and /tdd. No blocking issues. One design point left as a comment.

📋 Key Themes & Highlights

Key Themes

  • Unused seam: the new ctx parameter has no caller in this PR. All three close_expired_* callers still rely on the global default.
  • Test quality: the two new tests cover the explicit-context path and the missing-runId fallback. Both read as specifications.

Positive Highlights

  • ✅ Change is additive: existing two-argument callers are unaffected.
  • ✅ JSDoc updated to describe the default.
  • ✅ Tests assert the full runUrl, not just the runId.

Verification notes

  • npm ci in actions/setup/js failed on a sandbox TLS error, so the vitest suite was not run here.
  • I checked the new behaviour with plain Node against the same inputs the two new tests use. All assertions passed.
  • Edge case noted: an explicit null for ctx throws a TypeError, because the default only applies to undefined. No caller passes null, so this is low risk.

@copilot please address the review comment above.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~2 AIC · ⌖ ~2 AIC · ⊞ 6.3K
Comment /matt to run again

* @returns {{workflowName: string, workflowId: string, runId: number, runUrl: string}} Workflow metadata
*/
function getWorkflowMetadata(owner, repo) {
function getWorkflowMetadata(owner, repo, ctx = context) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

[/codebase-design] The new ctx parameter has no caller in this PR, and its default still reads the implicit global, so the coupling is moved into a default argument rather than removed. Either pass context explicitly from the three close_expired_* callers, or reword the PR description to present this as an injection seam.

💡 Suggested call-site change
const { workflowName, workflowId, runUrl } = getWorkflowMetadata(owner, repo, context);

This makes the dependency visible at each call site and gives the new parameter a real consumer. Existing two-argument calls keep working through the default, so the change stays additive.

@copilot please address this.

@pelikhan
pelikhan merged commit d162ba3 into main Nov 9, 2026
120 checks passed
@github-actions

Copy link
Copy Markdown
Contributor Author

🎉 This pull request is included in a new release.

Release: v1.2.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants