Skip to content

[jsweep] Clean workflow_job_durations.cjs - #69615

Merged
pelikhan merged 1 commit into
mainfrom
signed/jsweep/clean-workflow-job-durations-8d09a4cebb4e8e72
Oct 17, 2026
Merged

pelikhan merged 1 commit into
mainfrom
signed/jsweep/clean-workflow-job-durations-8d09a4cebb4e8e72

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

jsweep: workflow_job_durations.cjs

Context: github-script. @ts-check already enabled (no @ts-nocheck).

Changes

  • Extracted shared JOB_ID_PATTERN and isPlainObject helpers, replacing repeated inline checks
  • Added JSDoc to displayName and matchesName
  • Removed unused catch binding in the API failure handler
  • No logic changes

Tests

  • Added 5 tests (invalid/valid cached durations, non-object metadata, missing run context, invalid IDs/non-terminal results): 9 -> 14 in this file

Validation

  • Formatting npm run format:cjs ✓
  • Linting npm run lint:cjs ✓
  • Type checking npm run typecheck ✓
  • Tests: workflow_job_durations tests all pass ✓. The full npm run test:js run shows unrelated send_otlp_span.test.cjs failures (missing /tmp/gh-aw/aw_info.json in this environment), untouched by this change.

Generated by 🧹 jsweep - JavaScript Unbloater · copilot · auto · 32.8 AIC · ⌖ 0.967 AIC · ⊞ 12.2K · ◷

  • expires on Oct 18, 2026, 7:59 PM UTC-08:00

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor Author

✅ Thanks for the automated cleanup — a focused refactor with new tests. Looks ready for review!

Generated by ✅ Contribution Check · copilot · auto · 36 AIC · ⌖ 0.636 AIC · ⊞ 10.6K · ◷

@pelikhan
pelikhan marked this pull request as ready for review October 17, 2026 14:28
Copilot AI max review requested due to automatic review settings October 17, 2026 14:28
@github-actions

github-actions Bot commented Oct 17, 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 🏗️ · opus55 · 10.1 AIC · ⌖ 31.8 AIC · ◇ 14 AIC · ⊞ 1.9K · ◷

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Ponytail Reviewer completed successfully!

Ponytail 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 Ponytail Reviewer · gpt56 · 5.43 AIC · ⌖ 6.15 AIC · ⊞ 14.6K · ◷

Generated by Ponytail Reviewer for #69615

@github-actions

github-actions Bot commented Oct 17, 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 Oct 17, 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 · sonnet50 · 11 AIC · ⌖ 15.1 AIC · ◇ 4.35 AIC · ⊞ 12.6K · ◷

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Oct 17, 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.

Verdict

I did not find a changed-line issue here that justifies blocking the merge.

Notes

This patch is mostly a mechanical cleanup: helper extraction, equivalent object guards, an unused catch binding removal, and some additional tests. The new tests add a bit of duplication against cases already covered earlier in the file, but that is maintenance noise rather than a correctness regression.

Static review only: I did not execute the test suite.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt54 · 18.8 AIC · ⌖ 5.78 AIC · ⊞ 12.7K
Comment /review to run again

@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 /improve-codebase-architecture (per pr-triage: refactor_cleanup). No actionable issues found — approving.

📋 Key Themes & Highlights

Verification

  • isPlainObject(value) is verified equivalent to the original inline value && typeof value === "object" && !Array.isArray(value) checks for both the cached-durations guard and the needs/names/eligible guard.
  • JOB_ID_PATTERN is the same regex, now de-duplicated across its two use sites.
  • catch (error) {} → catch {} is safe: error was unused in that branch and the comment above it (never log response/metadata) is preserved.
  • New JSDoc on displayName/matchesName matches the existing single-line multi-@param convention used elsewhere (e.g. agent_session.cjs, claude_runtime.cjs).

Positive Highlights

  • ✅ Pure extraction, no logic changes — matches the PR description exactly.
  • ✅ 5 new tests meaningfully cover the extracted branches: invalid cached durations (bad id, negative, array, non-JSON), valid-cache short-circuit, non-object metadata per env var, missing run context, and invalid id/non-terminal result skipping.
  • ✅ Test coverage increased from 9 → 14 without weakening any existing assertions.

Note

  • Could not execute the test suite directly in this sandbox (no network access to npm registry / no local node_modules for actions/setup/js); relied on static diff verification. The PR body states formatting/lint/typecheck/tests all pass, which is consistent with the diff reviewed here.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet50 · 29.7 AIC · ⌖ 16.7 AIC · ⊞ 10.1K
Comment /matt 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.

🟡 Changes recommended

The new invalid-ID regression test still passes when the validation guard is removed.

1 open issue
What changed in this PR

Cleans up gh-aw’s Actions job-duration collector without intended behavior changes.

Changes:

  • Extracts shared validation helpers, adds JSDoc, and removes an unused catch binding.
  • Adds tests for cached durations, metadata validation, and job filtering.
File Description
actions/​setup/​js/​workflow_job_durations.test.cjs Adds five validation and filtering tests.
actions/​setup/​js/​workflow_job_durations.cjs Consolidates validation and documents helper parameters.

Review effort: Max

Comment on lines +195 to +196
const options = fixture({ "bad id": { result: "success" }, agent: { result: "skipped" } }, { agent: "Agent" });
expect(await collectJobDurations(options)).toEqual({});
@pelikhan
pelikhan merged commit 0ed35ed into main Oct 17, 2026
64 of 73 checks passed
@github-actions

Copy link
Copy Markdown
Contributor Author

🎉 This pull request is included in a new release.

Release: v0.92.5

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