Skip to content

fix(#148): improve interactive validation for nova init prompts#164

Merged
stiwicourage merged 2 commits into
developfrom
feature/148-feature-immediate-nova-init-validation
May 5, 2026
Merged

fix(#148): improve interactive validation for nova init prompts#164
stiwicourage merged 2 commits into
developfrom
feature/148-feature-immediate-nova-init-validation

Conversation

@stiwicourage
Copy link
Copy Markdown
Owner

Summary

  • Add inline validation and retry behavior to the interactive nova init / nova init -e scaffold flow so invalid answers are rejected at the prompt where they are entered instead of after the full questionnaire.
  • Move scaffold validation into prompt metadata, extend the shared standard prompt loop to retry invalid non-empty answers with an inline message, and keep a defensive fallback for callers that bypass prompt-level validation.
  • No linked issue. Follow-up work is not currently required.

Affected area

  • nova CLI or command routing
  • Public PowerShell cmdlet behavior
  • Scaffolding or project.json handling
  • Build, test, analyzer, coverage, or CI helper flow
  • Package, raw upload, or package metadata workflow
  • Publish, release, or GitHub Actions automation
  • Self-update or notification preference behavior
  • Contributor documentation (README.md, CONTRIBUTING.md, repository workflow docs)
  • End-user docs (docs/*.html)
  • Command help (docs/NovaModuleTools/en-US/*.md)
  • src/resources/example/
  • Dependency or manifest changes (project.json, workflow dependencies, release tooling)
  • Security-sensitive change
  • Documentation-only change
  • Other

Review guidance

  • Start with the shared prompt path in src/private/cli/ReadAwesomeStandardPrompt.ps1 and src/private/cli/TestAwesomePromptRequiresRetry.ps1, because that is where mandatory retries and validation retries now converge.
  • Then review src/private/scaffold/GetNovaModuleQuestions.ps1 and src/private/scaffold/ReadNovaModuleAnswers.ps1 to see how ProjectName validation moved from a late hard-coded check into per-question metadata plus a defensive fallback.
  • Primary files to review: src/private/cli/, src/private/scaffold/, tests/CoverageCompletion.Tests.ps1, tests/CoverageGaps.Tests.ps1, src/resources/cli/help/init.psd1, and docs/NovaModuleTools/en-US/Initialize-NovaModule.md.
  • Trade-off: this intentionally validates only the prompt values that define validation metadata today, starting with ProjectName, so the new inline retry behavior stays shared and incremental.

Validation

  • Invoke-NovaBuild
  • Test-NovaBuild
  • ./scripts/build/Invoke-ScriptAnalyzerCI.ps1
  • ./scripts/build/ci/Invoke-NovaModuleToolsCI.ps1
  • Targeted Nova workflow validated (% nova build, % nova test, % nova merge, % nova deploy,
    % nova publish,
    % nova release, % nova update, % nova notification, or % nova init as relevant)
  • Docs/example only; executable validation not needed

Validation notes:

Targeted prompt/scaffold validation:
- Invoke-NovaBuild
- Invoke-Pester -Path ./tests/CoverageCompletion.Tests.ps1,./tests/CoverageGaps.Tests.ps1 -Output Detailed
- Result: 43 passed, 0 failed

Repository analyzer validation:
- ./scripts/build/Invoke-ScriptAnalyzerCI.ps1
- Result: PSScriptAnalyzer: no findings.
- Artifact: ./artifacts/scriptanalyzer.txt

Full local quality loop:
- ./run.ps1
- Captured log: ./artifacts/run-ps1-inline-validation.log
- Result tail: Tests Passed: 648, Failed: 0, Skipped: 0, Inconclusive: 0, NotRun: 0

Workflow exercised:
- Interactive init prompt path via the shared scaffold question reader and prompt-loop tests
- Both standard and example scaffold flows covered by updated tests

Documentation and release follow-up

  • README.md reviewed and updated if contributor workflow, architecture, CI, release, or automation changed
  • CONTRIBUTING.md reviewed and updated if contribution expectations or review guidance changed
  • CHANGELOG.md reviewed and updated if the change matters to users, maintainers, or contributors
  • docs/NovaModuleTools/en-US/ help updated if a public command or CLI behavior changed
  • docs/*.html updated if end-user workflows or examples changed
  • src/resources/example/ reviewed and updated if the real-world project layout, package model, or upload workflow
    changed
  • No documentation, changelog, or example updates were needed

Maintainability, compatibility, and risk

  • Code Health / maintainability impact considered
  • No breaking change
  • Breaking change
  • Security-sensitive change
  • CI, workflow, or release-pipeline impact
  • Dependency-review impact

Risk, rollout, or rollback notes:

Low risk: this is a UX-focused change in the shared interactive scaffold prompt path and does not change CLI syntax or parameter contracts.

Compatibility impact is limited to interactive behavior: invalid scaffold answers now retry immediately instead of allowing the questionnaire to complete and then failing on ProjectName validation.

Rollback is straightforward: revert the prompt-validation metadata, the shared prompt retry helpers, and the updated scaffold tests/docs to restore the previous late-validation behavior.

Important

Do not use a public pull request to disclose a vulnerability before coordinated handling.
Use the private reporting path in SECURITY.md for new security issues.

- Implement immediate inline validation for invalid module names during interactive flow.
- Update prompt behavior to retry on validation failure before proceeding.
- Enhance documentation to reflect new validation behavior.
@stiwicourage stiwicourage linked an issue May 5, 2026 that may be closed by this pull request
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

codescene-delta-analysis[bot]

This comment was marked as outdated.

codescene-delta-analysis[bot]

This comment was marked as outdated.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

- Introduce a test case for validation without a validator
- Ensure expected validation message is null
Copy link
Copy Markdown

@codescene-delta-analysis codescene-delta-analysis Bot left a comment

Choose a reason for hiding this comment

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

Gates Passed
6 Quality Gates Passed

See analysis details in CodeScene

Quality Gate Profile: Pay Down Tech Debt
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.

Copy link
Copy Markdown

@codescene-delta-analysis codescene-delta-analysis Bot left a comment

Choose a reason for hiding this comment

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

Code Coverage Gates Passed
Overall Coverage: 100.0% (required = 95%)
New & Changed Code Coverage: 100% (required = 100%)

Review details by gate
  • Overall Coverage

    • Pass/Fail Reason:
      The overall coverage gate was checked for all code and meets the goal: 100.0% covered >= threshold = 95%
    • Action:
      You have 278 files with a sum of 2772 covered and 1 uncovered lines of code.
  • New & Changed Code Coverage

    • Pass/Fail Reason:
      New or changed code meets coverage goal: 100% covered >= threshold = 100%
    • Action:
      You modified 11 files, and covered 71 added/modified lines of code.

@stiwicourage stiwicourage merged commit ffd6877 into develop May 5, 2026
15 checks passed
@stiwicourage stiwicourage deleted the feature/148-feature-immediate-nova-init-validation branch May 12, 2026 05:51
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.

[Feature]: Immediate nova init Validation

1 participant