Skip to content

add missing python error message#2

Merged
MichalFrends1 merged 3 commits into
mainfrom
fspw-678
Dec 12, 2025
Merged

add missing python error message#2
MichalFrends1 merged 3 commits into
mainfrom
fspw-678

Conversation

@MatteoDelOmbra

@MatteoDelOmbra MatteoDelOmbra commented Dec 5, 2025

Copy link
Copy Markdown
Contributor

[]# Frends Task Pull Request

Summary

Review Checklist

1. Frends Task Project Files

  • Path: Frends.*/Frends.*/*.csproj
  • Targets .NET 8
  • Uses MIT license (<PackageLicenseExpression>MIT</PackageLicenseExpression>)
  • Contains required fields:
    • <Version>
    • <Authors>Frends</Authors>
    • <Description>
    • <RepositoryUrl>
    • <GenerateDocumentationFile>true</GenerateDocumentationFile>

2. File: FrendsTaskMetadata.json

  • Present: Frends.*/Frends.*/FrendsTaskMetadata.json
  • FrendsTaskMetadata.json contains correct task method reference
  • FrendsTaskMetadata.json is included in the project nuget package with path = "/"

3. File: README.md

  • Present: Frends.*/README.md
  • Contains badges (build, license, coverage)
  • Includes developer setup instructions
  • Does not include parameter descriptions

4. File: CHANGELOG.md

  • Present: Frends.*/CHANGELOG.md
  • Includes all functional changes
  • Indicates breaking changes with upgrade notes
  • Avoids non-functional notes like "refactored xyz"
  • CHANGELOG.md is included in the project nuget package with path = "/"

5. File: migration.json

  • Present: Frends.*/Frends.*/migration.json
  • Contains breaking change migration information for Frends, if breaking changes exist
  • migration.json is included in the project nuget package with path = "/"

6. Source Code Documentation

  • Path: Frends.*/Frends.*/*.cs
  • Every public method and class has:
    • <summary> XML comments
    • <example> XML comments
    • Optionally <frendsdocs> XML comments, if needed
  • Follows Microsoft C# code conventions
  • Uses semantic task result documentation (Success, Error, Data)

7. GitHub Actions Workflows

  • Path: .github/workflows/*.yml
  • Task has required workflow files:
    • *_test.yml
    • *_main.yml
    • *_release.yml
  • Correct workdir pointing to task folder
  • Docker setup included if task depends on external system (docker-compose.yml)

8. Task Result Object Structure

  • Path: Frends.*/Frends.*/*.cs
  • Category attribute is present, if applicable
  • All task result classes include:
    • Success (bool)
    • Task-specific return value (e.g., Data, FilePaths), if needed
    • Error object with Message and AdditionalInfo
  • Result structure is flat and simple
  • Does not use 3rd-party types
  • Uses dynamic JToken only when structure is unknown

Additional Notes

Summary by CodeRabbit

  • New Features

    • Added pre-execution validation to check Python is available before running scripts.
  • Bug Fixes

    • Improved error messaging to provide clearer feedback when Python is not installed or not found in PATH.
  • Chores

    • Bumped package version to 1.1.0; minor formatting fixes in tests.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai

coderabbitai Bot commented Dec 5, 2025

Copy link
Copy Markdown

Walkthrough

Adds async pre-execution validation for Python availability, consolidates OS/shell logic into private helpers, sets CreateNoWindow for spawned processes, bumps package version to 1.1.0, and updates CHANGELOG with a clearer error message when Python is missing or not on PATH.

Changes

Cohort / File(s) Summary
Version & Changelog
Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.csproj, Frends.Python.ExecuteScript/CHANGELOG.md
Package version updated to 1.1.0; changelog entry added (2025-12-05) documenting clearer error messaging when Python is not installed or not found in PATH.
Core implementation
Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.cs
Added async pre-execution validation ValidatePythonAvailability(cancellationToken); introduced private helpers IsWindows() and GetArgumentsPrefix() for OS/shell logic; replaced inline OS checks with helpers; set ProcessStartInfo.CreateNoWindow = true.
Tests (formatting)
Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.Tests/UnitTests.cs
Trailing newline/EOF formatting adjusted only; no functional changes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Inspect async/cancellation handling and thrown exception messages in ValidatePythonAvailability.
  • Verify IsWindows() and GetArgumentsPrefix() correctness across platforms and consistent usage where process start info is assembled.
  • Confirm CreateNoWindow = true is appropriate and that validation runs before any command construction or process execution.

Poem

🐰 I sniff the PATH beneath the moonlit sky,
I poke and wait till python answers "hi".
Helpers neat my hopping trail of code,
Version climbed, the quiet process strode—
Now carrots call; I bound off on the road. 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'add missing python error message' is directly related to the main change: improving error messaging when Python is not found, as documented in the CHANGELOG and implemented via ValidatePythonAvailability.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fspw-678

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between be4d731 and 48538c0.

📒 Files selected for processing (1)
  • Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.cs (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.cs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build / Check Code Quality

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 90ac00d and 99223de.

📒 Files selected for processing (4)
  • Frends.Python.ExecuteScript/CHANGELOG.md (1 hunks)
  • Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.Tests/UnitTests.cs (1 hunks)
  • Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.cs (2 hunks)
  • Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.csproj (1 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
Frends.*/Frends.*.Tests/*

⚙️ CodeRabbit configuration file

Frends.*/Frends.*.Tests/*: Confirm unit tests exist and provide at least 80% coverage.
Tests should:

  • Load secrets via dotenv
  • Use mocking where real systems can't be simulated
  • Follow Microsoft unit testing naming and structuring conventions

Files:

  • Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.Tests/UnitTests.cs
Frends.*/Frends.*/*.cs

⚙️ CodeRabbit configuration file

Frends.*/Frends.*/*.cs: Ensure every public method and class:

  • Has and XML comments
  • If the documentation is very long then it can also use element
  • Follows Microsoft C# code conventions
  • Uses semantic task result documentation (e.g., Success, Error, Data)

Frends.*/Frends.*/*.cs: Validate all task result classes include:

  • Success (bool)
  • Task-specific return value (e.g. Data, FilePaths)
  • Error object with Message and AdditionalInfo
  • Ensure result structure is flat, simple, and avoids 3rd-party types.
    • Use dynamic or JToken only when the structure is unknown.

Files:

  • Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.Tests/UnitTests.cs
  • Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.cs
Frends.*/**/*.cs

⚙️ CodeRabbit configuration file

Frends.*/**/*.cs: Code must follow Microsoft C# coding standards, including:

  • PascalCase for public members and task parameters
  • Proper naming for abbreviations (Csv, Url, Api)
  • Use of var only when type is obvious
  • Clean structure and no unused code

Files:

  • Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.Tests/UnitTests.cs
  • Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.cs
Frends.*/CHANGELOG.md

⚙️ CodeRabbit configuration file

Frends.*/CHANGELOG.md: Validate format against Keep a Changelog (https://keepachangelog.com/en/1.0.0/)
Include all functional changes and indicate breaking changes with upgrade notes.
Avoid notes like "refactored xyz" unless it affects functionality.

Files:

  • Frends.Python.ExecuteScript/CHANGELOG.md
Frends.*/Frends.*/*.csproj

⚙️ CodeRabbit configuration file

Frends.*/Frends.*/*.csproj: Ensure the .csproj targets .NET 6 or 8, uses the MIT license, and includes the following fields:

= Frends


= true
= MIT
Follow Microsoft C# project file conventions.

Files:

  • Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.csproj
🪛 GitHub Actions: ExecuteScript_build_test
Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.cs

[error] 51-51: System.InvalidOperationException: Process is already associated with a real process, so the requested operation cannot be performed.


[error] 79-79: System.InvalidOperationException: Process is already associated with a real process, so the requested operation cannot be performed.


[error] 79-79: System.InvalidOperationException: Process is already associated with a real process, so the requested operation cannot be performed.


[error] 60-60: System.InvalidOperationException: Process is already associated with a real process, so the requested operation cannot be performed.


[error] 80-80: System.InvalidOperationException: Process is already associated with a real process, so the requested operation cannot be performed.


[error] 116-116: System.InvalidOperationException: Process is already associated with a real process, so the requested operation cannot be performed.


[error] 140-140: System.InvalidOperationException: Process is already associated with a real process, so the requested operation cannot be performed.


[error] 125-125: System.InvalidOperationException: Process is already associated with a real process, so the requested operation cannot be performed.

Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.csproj

[error] 51-51: InvalidOperationException: Process is already associated with a real process, so the requested operation cannot be performed.


[error] 79-79: InvalidOperationException: Process is already associated with a real process, so the requested operation cannot be performed.

🔇 Additional comments (3)
Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.csproj (1)

6-6: Version bump is consistent and metadata meets project guidelines

Target framework, documentation generation, MIT license tag, and repository metadata remain correct; version 1.1.0 matches the new changelog entry. No further changes needed here.

Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.Tests/UnitTests.cs (1)

155-155: No functional changes in tests

Only EOF formatting changed; the existing tests still exercise the primary execution paths. After fixing the Process handling in Python.ExecuteScript, please re-run the ExecuteScript_build_test workflow to confirm all tests pass.

Frends.Python.ExecuteScript/CHANGELOG.md (1)

3-8: 1.1.0 changelog entry is clear and correctly formatted

The new 1.1.0 section follows the Keep a Changelog structure and succinctly documents the behavioral change (more specific error when Python is missing). Looks good.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.cs (1)

142-142: Add braces for clarity and consistency.

Microsoft C# conventions recommend always using braces for control statements, even single-line blocks, to prevent future maintenance errors and improve readability.

Apply this diff:

         finally
         {
-            if (!process.HasExited) process.Kill(true);
+            if (!process.HasExited)
+            {
+                process.Kill(true);
+            }
         }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 99223de and be4d731.

📒 Files selected for processing (1)
  • Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.cs (2 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
Frends.*/Frends.*/*.cs

⚙️ CodeRabbit configuration file

Frends.*/Frends.*/*.cs: Ensure every public method and class:

  • Has and XML comments
  • If the documentation is very long then it can also use element
  • Follows Microsoft C# code conventions
  • Uses semantic task result documentation (e.g., Success, Error, Data)

Frends.*/Frends.*/*.cs: Validate all task result classes include:

  • Success (bool)
  • Task-specific return value (e.g. Data, FilePaths)
  • Error object with Message and AdditionalInfo
  • Ensure result structure is flat, simple, and avoids 3rd-party types.
    • Use dynamic or JToken only when the structure is unknown.

Files:

  • Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.cs
Frends.*/**/*.cs

⚙️ CodeRabbit configuration file

Frends.*/**/*.cs: Code must follow Microsoft C# coding standards, including:

  • PascalCase for public members and task parameters
  • Proper naming for abbreviations (Csv, Url, Api)
  • Use of var only when type is obvious
  • Clean structure and no unused code

Files:

  • Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.cs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build / Check Code Quality
🔇 Additional comments (3)
Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.cs (3)

39-41: LGTM! Good fail-fast validation and consistent use of helpers.

The pre-execution Python availability check ensures early failure with a clear message, and the refactored command generation using IsWindows() improves consistency.


44-45: LGTM! Cleaner ProcessStartInfo setup.

The use of IsWindows() and GetArgumentsPrefix() helpers improves code clarity and reduces duplication.


150-152: LGTM! Clean helper methods.

Both GetArgumentsPrefix() and IsWindows() are simple, focused helpers that improve code maintainability and reduce duplication across the class.

@MichalFrends1
MichalFrends1 merged commit 855e804 into main Dec 12, 2025
5 checks passed
@MichalFrends1
MichalFrends1 deleted the fspw-678 branch December 12, 2025 07:55
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