Skip to content

Handle DocFX exit codes in BuildCommand - #19

Merged
bdovaz merged 1 commit into
mainfrom
copilot/extract-buildcommand-exitcode-changes
Oct 15, 2026
Merged

bdovaz merged 1 commit into
mainfrom
copilot/extract-buildcommand-exitcode-changes

Conversation

Copilot AI commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

DocFX failures were silent because RunCommand didn't return the process exit code. A non-zero exit meant the caller had no way to detect failure without checking file existence afterward—a weak, delayed signal.

Changes

  • Utils.RunCommand signature: Now returns Task<int> instead of Task to surface the exit code
  • BuildCommand: Captures the exit code and immediately checks for failure:
    int exitCode = await Utils.RunCommand("docfx", docFxArguments, ...);
    
    if (exitCode != 0)
    {
        result = false;
        logger.LogError("DocFX exited with code {ExitCode} for Unity '{RepositoryTag}'", exitCode, repositoryTag);
        continue;
    }

This makes DocFX errors visible at the point of failure rather than relying on downstream checks. The version is now skipped immediately with a clear error log.


Note: This extracts a focused fix from a larger PR to isolate exit code handling from unrelated changes (regex and pagination fixes).

- Change Utils.RunCommand return type from Task to Task<int> to return process exit code
- Capture exit code from DocFX command in BuildCommand
- Check if exit code is non-zero and skip further processing if DocFX fails
- Log error message with exit code when DocFX fails

Fixes: Extract changes from PR #9

Co-authored-by: bdovaz <950602+bdovaz@users.noreply.github.com>
Copilot AI changed the title fix: Handle DocFX exit codes in BuildCommand Handle DocFX exit codes in BuildCommand Oct 15, 2026
Copilot AI requested a review from bdovaz October 15, 2026 11:00
@bdovaz
bdovaz marked this pull request as ready for review October 15, 2026 11:09
@bdovaz
bdovaz merged commit e763c22 into main Oct 15, 2026
2 of 3 checks passed
@bdovaz
bdovaz deleted the copilot/extract-buildcommand-exitcode-changes branch October 15, 2026 11:53
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.

2 participants