Skip to content

[Repo Assist] Fix script warnings and add CheckDocScripts to Verify pipeline#1083

Merged
dsyme merged 8 commits intomainfrom
repo-assist/fix-issue-1081-script-ci-errors-a13ccc328276fea4
Mar 12, 2026
Merged

[Repo Assist] Fix script warnings and add CheckDocScripts to Verify pipeline#1083
dsyme merged 8 commits intomainfrom
repo-assist/fix-issue-1081-script-ci-errors-a13ccc328276fea4

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Mar 9, 2026

🤖 This is an automated PR from Repo Assist.

Closes #1081

Root cause

docs/evaluation.fsx contained two FsiEvaluator() constructor calls without new, triggering FS0760 IDisposable warnings from FCS on every documentation build (printed 5× — once per output format). While these warnings did not fail CI (warnings ≠ errors under --strict), they indicate a latent resource-management concern and add noise to the build output.

Additionally, when ParseScript.ParseAndCheckScriptFile detected type errors in a script, it reported a generic "errors parsing or checking script" message with no file path, making diagnosis harder.

Finally, the Verify pipeline (dotnet fsi build.fsx -- -p Verify) — commonly used by developers for a quick pre-push check — did not run fsdocs build, so doc-script type errors were only caught in the full CI pipeline (GenerateDocs stage on Linux).

Fix

  1. docs/evaluation.fsx: changed both FsiEvaluator()new FsiEvaluator() to eliminate the FS0760 warnings.

  2. src/FSharp.Formatting.Literate/ParseScript.fs: improved the error message to include the file path ("errors found in '(file)'") and renamed the fail flag to hasErrors for clarity.

  3. build.fsx: added a CheckDocScripts stage (Linux-only, using the locally built fsdocs tool) to the Verify pipeline. Developers who run dotnet fsi build.fsx -- -p Verify after building the solution will now also type-check all documentation scripts with --strict.

Rationale & trade-offs

  • The full CI pipeline already has the permanent check via the GenerateDocs stage which installs fsdocs from NuGet artifacts and runs --strict. This PR preserves that unchanged.
  • The new CheckDocScripts stage in Verify uses the locally built fsdocs binary (src/fsdocs-tool/bin/Release/net10.0/fsdocs). It requires a prior dotnet build; running Verify without a pre-built binary will fail gracefully with "file not found".
  • The stage is skipped on Windows (same policy as GenerateDocs) since doc generation tooling is Linux-focused.

Test Status

  • dotnet build FSharp.Formatting.sln --configuration Release — succeeded (1 pre-existing FS0760 warning in BuildCommand.fs, unrelated to this PR)
  • dotnet test FSharp.Formatting.sln --configuration Release --no-build — all 499 tests pass (0 failures)
  • dotnet fantomas build.fsx src tests docs --check — no formatting issues

Generated by Repo Assist for issue #1081 ·

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@346204513ecfa08b81566450d7d599556807389f

- Fix FS0760 IDisposable warnings in docs/evaluation.fsx by using
  'new FsiEvaluator()' constructor syntax (two occurrences)
- Improve error message in ParseScript when type errors are found
  in a script file (now includes the file path)
- Add CheckDocScripts stage to the Verify pipeline in build.fsx so
  that 'dotnet fsi build.fsx -- -p Verify' also type-checks docs
  scripts with --strict, catching errors locally before CI

The full CI pipeline already ran 'fsdocs build --strict' in the
GenerateDocs stage (permanent check). The new CheckDocScripts stage
makes the same check available via the lighter-weight Verify pipeline.

Closes #1081

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dsyme dsyme marked this pull request as ready for review March 9, 2026 13:28
@nojaf
Copy link
Collaborator

nojaf commented Mar 9, 2026

/repo-assist there is no reason not to run this on Windows.

Remove the 'whenNot Windows' guard and use System.OperatingSystem.IsWindows()
to select the correct binary extension (fsdocs.exe on Windows, fsdocs on Unix).
This means the Verify pipeline now type-checks documentation scripts on all
platforms.

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

github-actions bot commented Mar 9, 2026

Commit pushed: 0f8ae6d

Generated by Repo Assist

@nojaf
Copy link
Collaborator

nojaf commented Mar 9, 2026

/repo-assist is "Verify" pipeline even running during CI?

@github-actions
Copy link
Contributor Author

github-actions bot commented Mar 9, 2026

🤖 Repo Assist here.

No — the "Verify" pipeline does not run during CI.

Here's how the pipelines are wired:

Pipeline runIfOnlySpecified When it runs
CI false Always — default when no -p flag is given
Verify true Only when explicitly called: dotnet fsi build.fsx -- -p Verify

The CI workflow (pull-requests.yml) runs dotnet fsi build.fsx with no arguments, so it always executes the CI pipeline and never the Verify pipeline.

The CheckDocScripts stage I added to Verify is purely a local developer convenience — a quick pre-push check that catches doc-script type errors without running the full CI pipeline (which would need to pack NuGet artifacts first). The actual doc-script type-checking in CI is already handled by the GenerateDocs stage in the CI pipeline, which installs fsdocs from the packed NuGet artifacts and runs fsdocs build --strict.

So the value of adding CheckDocScripts to Verify is marginal (only helps developers who already run dotnet fsi build.fsx -- -p Verify locally after a dotnet build). If you'd prefer to drop that addition and keep Verify unchanged, that's entirely reasonable — I'm happy to revert just that part.

Generated by Repo Assist for issue #1083 ·

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@346204513ecfa08b81566450d7d599556807389f

@nojaf
Copy link
Collaborator

nojaf commented Mar 9, 2026

/repo-assist add it to the general build pipeline as well

Move fsdocsLocalBin/checkDocScriptsStage definitions before the CI
pipeline and include the stage in CI (after Tests, before GenerateDocs).
This ensures doc-script type errors are caught on all CI runners, not
only when running the Verify pipeline locally.

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

github-actions bot commented Mar 9, 2026

Commit pushed: e7ab01c

Generated by Repo Assist

@nojaf
Copy link
Collaborator

nojaf commented Mar 9, 2026

/repo-assist remove the changelog changes you made. This has no value for end-users

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

github-actions bot commented Mar 9, 2026

Commit pushed: ae88599

Generated by Repo Assist

@nojaf nojaf requested a review from dsyme March 9, 2026 14:41
@dsyme dsyme merged commit a1df296 into main Mar 12, 2026
4 checks passed
@dsyme dsyme deleted the repo-assist/fix-issue-1081-script-ci-errors-a13ccc328276fea4 branch March 12, 2026 02:36
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.

CI should catch errors in scripts

2 participants