Skip to content

Preserve zero-valued input defaults - #58291

Merged
pelikhan merged 1 commit into
mainfrom
copilot/fix-input-default-parsing
Sep 3, 2026
Merged

Preserve zero-valued input defaults#58291
pelikhan merged 1 commit into
mainfrom
copilot/fix-input-default-parsing

Conversation

Copilot AI commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Numeric input defaults of 0 were treated as missing because runtime normalization used truthiness. This affected custom safe-output inputs despite workflows compiling the default correctly.

Changes

  • Use nullish fallback to preserve explicit falsy defaults:
    normalizedValue: inputSchema.default ?? undefined
  • Add regression coverage for numeric 0 defaults.
  • Add workflow_call and workflow_dispatch examples with type: number and default: 0.
  • Regenerate the compiled workflow with numeric zero defaults retained in both triggers.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI requested a review from pelikhan September 3, 2026 19:10
@pelikhan
pelikhan marked this pull request as ready for review September 3, 2026 19:56
Copilot AI balanced review requested due to automatic review settings September 3, 2026 19:56
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

🧠 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 Sep 3, 2026

Copy link
Copy Markdown
Contributor

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

No ADR enforcement needed: PR does not have the implementation label and has <=100 new lines of code in business logic directories.

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

PR Code Quality Reviewer completed the code quality review.

Completed PR #58291 review with no actionable blocking comments.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

⚠️ Security scanning failed for Ponytail Reviewer. Review the logs for details.

Lean already. Ship.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • ab.chatgpt.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "ab.chatgpt.com"

See Network Configuration for more information.

Generated by Ponytail Reviewer for #58291

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel skipped because pre-fetch PR data was unavailable: unable to fetch test file diff

🧪 Test quality analysis by Test Quality Sentinel

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

The focused fix correctly preserves zero defaults and is covered by an end-to-end normalization test.

Pull request overview

Preserves explicit zero defaults during custom safe-output normalization and adds regression coverage.

Changes:

  • Replaces truthy fallback with nullish fallback.
  • Tests numeric 0 defaults and adds smoke workflow inputs.
  • Regenerates the compiled workflow and dependency pins.
File summaries
File Description
actions/setup/js/collect_ndjson_output.cjs Preserves falsy defaults during normalization.
actions/setup/js/collect_ndjson_output.test.cjs Adds zero-default regression coverage.
.github/workflows/smoke-workflow-call-with-inputs.md Adds numeric zero inputs to both triggers.
.github/workflows/smoke-workflow-call-with-inputs.lock.yml Regenerates the compiled workflow.
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@github-actions github-actions Bot 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.

Skills-Based Review 🧠

Applied /diagnosing-bugs — no blocking issues found; approving.

📋 Details

The root cause (truthiness check inputSchema.default || undefined treating falsy defaults like 0/false/'' as missing) is correctly fixed with a nullish-coalescing (??) fallback. A regression test (should preserve zero-valued defaults in custom safe-job inputs) exercises the exact failure mode. The added task-count (type: number, default: 0) example in smoke-workflow-call-with-inputs.md/.lock.yml gives good end-to-end coverage for both workflow_call and workflow_dispatch triggers. Checked the rest of collect_ndjson_output.cjs for similar truthiness bugs on inputSchema.* — none found, so the fix is complete for this file.

Positive highlights:

  • ✅ Root cause fixed (not just symptom) with the correct operator
  • ✅ Regression test added matching the described bug
  • ✅ Real workflow example added to prevent silent regressions in compiled output

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet50 · 19.7 AIC · ⌖ 14.5 AIC · ⊞ 10.3K
Comment /matt to run again

@github-actions github-actions Bot 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.

Reviewed with harden/audit lenses (bug_fix). The ||?? fix correctly preserves falsy defaults (0, false, "") without introducing new edge-state issues; regression test and workflow example are appropriate. No blocking or actionable issues found; lock.yml is auto-generated. Approving.

🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · copilot · sonnet50 · 15.5 AIC · ⌖ 14.1 AIC · ⊞ 8.3K

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Comment Memory

reviewed_at: 2026-09-03T20:03:23Z
review_event: COMMENT
top_themes:
  - zero-default regression fixed cleanly
  - generated workflow churn from recompilation only
files_reviewed:
  - .github/workflows/smoke-workflow-call-with-inputs.lock.yml
  - .github/workflows/smoke-workflow-call-with-inputs.md
  - actions/setup/js/collect_ndjson_output.cjs
  - actions/setup/js/collect_ndjson_output.test.cjs
comment_count: 0

Note

This comment is managed by comment memory.

It stores persistent context for this thread in the code block at the top of this comment.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt54 · 21.4 AIC · ⌖ 7.29 AIC · ⊞ 23.5K ·
Comment /review to run again

@pelikhan
pelikhan merged commit 96a53c5 into main Sep 3, 2026
74 of 78 checks passed
@pelikhan
pelikhan deleted the copilot/fix-input-default-parsing branch September 3, 2026 20:10
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.88.3

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.

3 participants