Conversation
WalkthroughAdds a new Frends.Python.ExecuteScript task (targets .NET 8) with input/options/result types, cross‑platform process execution and error handling, unit tests and test data, project/packaging/metadata, documentation/license/changelog, and three GitHub Actions workflows for CI/CD. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Caller
participant Task as Python.ExecuteScript
participant Shell as OS Shell / Process
participant EH as ErrorHandler
Caller->>Task: ExecuteScript(Input, Options, CancellationToken)
alt IsPreparationNeeded
Task->>Task: Build prep command + python command
else
Task->>Task: Build python command (File or Inline + args)
end
Task->>Shell: Start shell process (cmd /C or /bin/bash -c), redirect stdout/stderr
par Read streams
Shell-->>Task: StdOut (async)
Shell-->>Task: StdErr (async)
end
Shell-->>Task: ExitCode
alt ExitCode == 0
Task-->>Caller: Result { Success=true, ExitCode, StandardOutput, StandardError }
else
Task->>EH: Handle(exception or non-zero exit, options, exitCode, stdErr, stdOut)
alt options.ThrowErrorOnFailure == true
EH--x Caller: Exception thrown
else
EH-->>Task: Result { Success=false, ExitCode, Error, StandardError, StandardOutput }
Task-->>Caller: Result
end
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ 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). (2)
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. 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. Comment Pre-merge checks❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
|
There was a problem hiding this comment.
Actionable comments posted: 14
🧹 Nitpick comments (19)
Frends.Python.ExecuteScript/CHANGELOG.md (1)
3-7: Keep a Changelog compliance: use “Added” for initial release and include Unreleased section.Initial release items belong under “Added”, and an Unreleased section is recommended.
Apply:
# Changelog -## [1.0.0] - 2025-09-11 - -### Changed - -- Initial implementation +## [Unreleased] + +## [1.0.0] - 2025-09-11 + +### Added + +- Initial implementation of ExecuteScript taskFrends.Python.ExecuteScript/Frends.Python.ExecuteScript.Tests/TestData/script.py (1)
1-1: Drop UTF‑8 BOM and add trailing newline.Prevents occasional encoding surprises on some Python setups and keeps style consistent.
Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.Tests/TestData/scriptWithArgs.py (1)
1-2: Guard against missing argument to make test data self‑describing.Keeps failures clearer if called without args; harmless for current tests.
Apply:
import sys -print(f"Hello, {sys.argv[1]}!") +if len(sys.argv) < 2: + print("Usage: scriptWithArgs.py <name>") + raise SystemExit(1) +print(f"Hello, {sys.argv[1]}!")Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Definitions/ExecutionMode.cs (1)
3-7: Add XML docs to satisfy CS1591 and doc rules.Public enum and members are undocumented.
Apply:
-namespace Frends.Python.ExecuteScript.Definitions; +namespace Frends.Python.ExecuteScript.Definitions; -public enum ExecutionMode +/// <summary> +/// Specifies how Python is executed. +/// </summary> +public enum ExecutionMode { - Script = 1, - Inline = 2, + /// <summary> + /// Execute a Python file from <c>ScriptPath</c>. + /// </summary> + Script = 1, + /// <summary> + /// Execute inline code from <c>Code</c> using <c>python -c</c>. + /// </summary> + Inline = 2, }Frends.Python.ExecuteScript/README.md (2)
3-3: Replace placeholder description with a concise task summary.README should state what the task does.
Apply:
-Description of what the Task will do. +Execute Python code from a file or inline string, optionally running a preparation script first (e.g., install deps). Captures exit code, stdout, and stderr. Cross‑platform (.NET 8).
35-36: Avoid bare URL; make it a link.Minor markdownlint fix.
Apply:
-StyleCop.Analyzer version (unmodified version 1.1.118) used to analyze code uses Apache-2.0 license, full text and -source code can be found at https://github.com/DotNetAnalyzers/StyleCopAnalyzers +StyleCop.Analyzer version (unmodified version 1.1.118) used to analyze code uses Apache-2.0 license, full text and +source code can be found at [https://github.com/DotNetAnalyzers/StyleCopAnalyzers](https://github.com/DotNetAnalyzers/StyleCopAnalyzers)Frends.Python.ExecuteScript/Apache-2.0 (1)
1-93: Clarify third‑party license vs. project license (MIT confirmed).Repo root contains LICENSE (MIT). Frends.Python.ExecuteScript/Apache-2.0 appears to be a third‑party license (likely StyleCop.Analyzers) — move that file into ThirdPartyNotices/ (e.g., ThirdPartyNotices/StyleCop.Analyzers/Apache-2.0) and keep the MIT LICENSE at the repository root.
.github/workflows/ExecuteScript_build_and_test_on_main.yml (1)
1-19: Add concurrency and lock down permissions; pin reusable workflow ref
- Prevent duplicated runs on rapid pushes and tighten default token.
- Pin the reusable workflow to a commit SHA for supply‑chain safety.
Apply:
name: ExecuteScript_build_main +permissions: + contents: read on: push: @@ jobs: build: - uses: FrendsPlatform/FrendsTasks/.github/workflows/linux_build_main.yml@main + uses: FrendsPlatform/FrendsTasks/.github/workflows/linux_build_main.yml@<PINNED_COMMIT_SHA> + concurrency: + group: executescript-main-${{ github.ref }} + cancel-in-progress: trueConfirm the called workflow expects secrets.badge_service_api_key (exact name) and not a different casing.
.github/workflows/ExecuteScript_release.yml (1)
1-13: Harden release workflow (pin ref, perms, approvals)
- Pin the reusable workflow, set minimal permissions, and use an environment for manual approval.
name: ExecuteScript_release +permissions: + contents: read @@ jobs: build: - uses: FrendsPlatform/FrendsTasks/.github/workflows/release.yml@main + uses: FrendsPlatform/FrendsTasks/.github/workflows/release.yml@<PINNED_COMMIT_SHA> + environment: release + concurrency: + group: executescript-release + cancel-in-progress: falseEnsure the target environment has protection rules (required reviewers) enabled.
.github/workflows/ExecuteScript_build_and_test_on_push.yml (1)
1-21: Add concurrency, pin reusable workflow, and minimal token
- Avoid redundant CI for branch pushes; lock down token; pin workflow ref.
name: ExecuteScript_build_test +permissions: + contents: read @@ jobs: build: - uses: FrendsPlatform/FrendsTasks/.github/workflows/linux_build_test.yml@main + uses: FrendsPlatform/FrendsTasks/.github/workflows/linux_build_test.yml@<PINNED_COMMIT_SHA> + concurrency: + group: executescript-push-${{ github.ref }} + cancel-in-progress: trueDouble‑check the reused workflow input name is prebuild_command (not pre_build_command).
Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Definitions/Error.cs (1)
6-20: Align examples and consider sealing the type
- The examples (“Unable to join strings.”) don’t match the task domain (Python execution). Use a script‑failure example for clarity.
- Consider sealing the class to keep the result contract stable.
-public class Error +public sealed class Error { /// <summary> /// Summary of the error. /// </summary> - /// <example>Unable to join strings.</example> + /// <example>Script failed with exit code 1.</example> public string Message { get; set; } @@ - /// <example>object { Exception Exception }</example> + /// <example>object { string ExitCode, string StandardError }</example> // TODO: Add task specific additional information. Strong typing is recommended when reasonable. public dynamic AdditionalInfo { get; set; } }Please confirm that AdditionalInfo contents remain flat and serializable (no raw Exception instances) per guidelines.
Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.csproj (1)
33-37: Pack README alongside FrendsTaskMetadata.jsonNuGet.org will render README automatically when included.
<ItemGroup> <None Include="FrendsTaskMetadata.json" Pack="true" PackagePath="/"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> + <None Include="README.md" Pack="true" PackagePath="/" /> </ItemGroup>Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/GlobalSuppressions.cs (1)
3-11: Reasonable suppression setMatches project conventions; nothing blocking. Revisit over time to drop broad suppressions (SA1503, SA1200) if feasible.
Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.Tests/Frends.Python.ExecuteScript.Tests.csproj (1)
27-40: Deduplicate CopyToOutput includesThe glob already copies all TestData. The explicit entries are redundant.
<ItemGroup> <None Update="TestData\**\*.*"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> - <None Update="TestData\prepScript.sh"> - <CopyToOutputDirectory>Always</CopyToOutputDirectory> - </None> - <None Update="TestData\scriptWithArgs.py"> - <CopyToOutputDirectory>Always</CopyToOutputDirectory> - </None> - <None Update="TestData\scriptWithImport.py"> - <CopyToOutputDirectory>Always</CopyToOutputDirectory> - </None> </ItemGroup>Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Definitions/Result.cs (2)
14-18: Fix incorrect XML for ExitCodeSummary/example are copy-paste leftovers.
- /// <summary> - /// Input string repeated the specified number of times. - /// </summary> - /// <example>foobar,foobar</example> + /// <summary> + /// Process exit code returned by the Python execution. + /// </summary> + /// <example>0</example> public int ExitCode { get; set; }
26-27: Add XML docs for StandardOutput and StandardError; fix whitespaceThis addresses the analyzer warning and pipeline whitespace gripe.
- - public string StandardOutput { get; set; } - public string StandardError { get; set; } + /// <summary> + /// Captured stdout of the Python process. + /// </summary> + /// <example>Hello, World!</example> + public string StandardOutput { get; set; } + + /// <summary> + /// Captured stderr of the Python process. + /// </summary> + /// <example>ModuleNotFoundError: No module named 'numpy'</example> + public string StandardError { get; set; }Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Helpers/ErrorHandler.cs (1)
8-16: Fix XML param name and document all parametersMismatch between XML and signature triggers CS1572/CS1573.
- /// <param name="errorMessage">Message to throw in error event</param> - /// <returns>Throw exception if a flag is true, else return Result with Error info</returns> - public static Result Handle(Exception exception, bool throwOnFailure, string errorMessageOnFailure, int exitCode, + /// <param name="errorMessageOnFailure">Message to throw/append on failure.</param> + /// <param name="exitCode">Exit code captured from the Python process, if available.</param> + /// <param name="stdError">Captured stderr.</param> + /// <param name="stdOutput">Captured stdout.</param> + /// <returns>Throws when configured; otherwise returns a failure Result populated with error details.</returns> + public static Result Handle(Exception exception, bool throwOnFailure, string errorMessageOnFailure, int exitCode, string stdError, string stdOutput)Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.cs (2)
60-63: Use a more specific exception and include exit code.Improves diagnosability and avoids generic Exception.
Apply this diff:
- throw new Exception($"Process failed with error: \n{stdError}"); + throw new InvalidOperationException($"Python process exited with code {exitCode}. See StandardError for details.");
1-11: Optional: allow overriding Python executable and working directory.Add Options.PythonExecutable and Options.WorkingDirectory to reduce environment coupling and improve portability.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (25)
.github/workflows/ExecuteScript_build_and_test_on_main.yml(1 hunks).github/workflows/ExecuteScript_build_and_test_on_push.yml(1 hunks).github/workflows/ExecuteScript_release.yml(1 hunks)Frends.Python.ExecuteScript/Apache-2.0(1 hunks)Frends.Python.ExecuteScript/CHANGELOG.md(1 hunks)Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.Tests/Frends.Python.ExecuteScript.Tests.csproj(1 hunks)Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.Tests/GlobalSuppressions.cs(1 hunks)Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.Tests/TestData/prepScript.ps1(1 hunks)Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.Tests/TestData/prepScript.sh(1 hunks)Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.Tests/TestData/script.py(1 hunks)Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.Tests/TestData/scriptWithArgs.py(1 hunks)Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.Tests/TestData/scriptWithImport.py(1 hunks)Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.Tests/UnitTests.cs(1 hunks)Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.sln(1 hunks)Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Definitions/Error.cs(1 hunks)Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Definitions/ExecutionMode.cs(1 hunks)Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Definitions/Input.cs(1 hunks)Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Definitions/Options.cs(1 hunks)Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Definitions/Result.cs(1 hunks)Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.cs(1 hunks)Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.csproj(1 hunks)Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/FrendsTaskMetadata.json(1 hunks)Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/GlobalSuppressions.cs(1 hunks)Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Helpers/ErrorHandler.cs(1 hunks)Frends.Python.ExecuteScript/README.md(1 hunks)
🧰 Additional context used
📓 Path-based instructions (7)
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.Tests/Frends.Python.ExecuteScript.Tests.csprojFrends.Python.ExecuteScript/Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.csproj
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/Frends.Python.ExecuteScript.Tests.csprojFrends.Python.ExecuteScript/Frends.Python.ExecuteScript.Tests/UnitTests.csFrends.Python.ExecuteScript/Frends.Python.ExecuteScript.Tests/GlobalSuppressions.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/Definitions/ExecutionMode.csFrends.Python.ExecuteScript/Frends.Python.ExecuteScript/Definitions/Error.csFrends.Python.ExecuteScript/Frends.Python.ExecuteScript/Definitions/Result.csFrends.Python.ExecuteScript/Frends.Python.ExecuteScript.Tests/UnitTests.csFrends.Python.ExecuteScript/Frends.Python.ExecuteScript/Definitions/Input.csFrends.Python.ExecuteScript/Frends.Python.ExecuteScript/Definitions/Options.csFrends.Python.ExecuteScript/Frends.Python.ExecuteScript/Helpers/ErrorHandler.csFrends.Python.ExecuteScript/Frends.Python.ExecuteScript/GlobalSuppressions.csFrends.Python.ExecuteScript/Frends.Python.ExecuteScript.Tests/GlobalSuppressions.csFrends.Python.ExecuteScript/Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.cs
Frends.*/README.md
⚙️ CodeRabbit configuration file
Frends.*/README.md: Confirm README includes:
- Badges (build, license, coverage)
- Developer setup instructions (e.g., credentials, Docker setup, if needed)
- Do not include parameter descriptions; those are auto-generated.
- Use clear, markdown-formatted sections.
Files:
Frends.Python.ExecuteScript/README.md
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.csFrends.Python.ExecuteScript/Frends.Python.ExecuteScript/GlobalSuppressions.csFrends.Python.ExecuteScript/Frends.Python.ExecuteScript.Tests/GlobalSuppressions.csFrends.Python.ExecuteScript/Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.cs
Frends.*/Frends.*/FrendsTaskMetadata.json
⚙️ CodeRabbit configuration file
Ensure FrendsTaskMetadata.json is present in every task project folder. This file is required for Frends task metadata parsing.
Files:
Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/FrendsTaskMetadata.json
🧬 Code graph analysis (8)
Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Definitions/ExecutionMode.cs (1)
Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.cs (1)
Python(17-111)
Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Definitions/Error.cs (1)
Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.cs (1)
Python(17-111)
Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Definitions/Result.cs (3)
Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.cs (1)
Python(17-111)Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Helpers/ErrorHandler.cs (1)
Result(15-45)Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Definitions/Error.cs (1)
Error(6-20)
Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.Tests/UnitTests.cs (3)
Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.cs (2)
Python(17-111)Task(27-79)Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Definitions/Input.cs (1)
Input(9-17)Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Definitions/Options.cs (1)
Options(9-25)
Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Definitions/Input.cs (2)
Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.cs (1)
Python(17-111)Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.Tests/UnitTests.cs (1)
Input(21-29)
Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Definitions/Options.cs (2)
Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.cs (1)
Python(17-111)Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.Tests/UnitTests.cs (1)
Options(31-31)
Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Helpers/ErrorHandler.cs (3)
Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.cs (1)
Python(17-111)Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Definitions/Result.cs (1)
Result(6-28)Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Definitions/Error.cs (1)
Error(6-20)
Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.cs (5)
Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Definitions/Result.cs (1)
Result(6-28)Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Helpers/ErrorHandler.cs (2)
Result(15-45)ErrorHandler(6-46)Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Definitions/Input.cs (1)
Input(9-17)Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Definitions/Options.cs (1)
Options(9-25)Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Definitions/Error.cs (1)
Error(6-20)
🪛 GitHub Check: build / Build on ubuntu-22.04
Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Definitions/ExecutionMode.cs
[warning] 6-6:
Enumeration items should be documented
[warning] 5-5:
Enumeration items should be documented
[warning] 3-3:
Elements should be documented
[warning] 6-6:
Missing XML comment for publicly visible type or member 'ExecutionMode.Inline'
[warning] 5-5:
Missing XML comment for publicly visible type or member 'ExecutionMode.Script'
[warning] 3-3:
Missing XML comment for publicly visible type or member 'ExecutionMode'
Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Definitions/Result.cs
[warning] 26-26:
Missing XML comment for publicly visible type or member 'Result.StandardOutput'
Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Definitions/Input.cs
[warning] 14-14:
Elements should be documented
[warning] 13-13:
Elements should be documented
[warning] 12-12:
Elements should be documented
[warning] 11-11:
Elements should be documented
[warning] 15-15:
Single line comment should begin with a space.
[warning] 14-14:
Single line comment should begin with a space.
[warning] 12-12:
Single line comment should begin with a space.
[warning] 16-16:
Missing XML comment for publicly visible type or member 'Input.Arguments'
[warning] 15-15:
Missing XML comment for publicly visible type or member 'Input.Code'
[warning] 14-14:
Missing XML comment for publicly visible type or member 'Input.ScriptPath'
[warning] 13-13:
Missing XML comment for publicly visible type or member 'Input.ExecutionMode'
[warning] 12-12:
Missing XML comment for publicly visible type or member 'Input.PreparationScriptPath'
[warning] 11-11:
Missing XML comment for publicly visible type or member 'Input.IsPreparationNeeded'
🪛 GitHub Actions: ExecuteScript_build_test
Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Definitions/ExecutionMode.cs
[warning] 3-3: CS1591: Missing XML comment for publicly visible type or member 'ExecutionMode'.
Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Definitions/Result.cs
[error] 25-25: WHITESPACE: Fix whitespace formatting. Replace 9 characters with '\n\s\s\s\s'.
Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.Tests/UnitTests.cs
[error] 105-105: prepScript.sh failed: line 1: source: filename argument required (source: usage: source filename [arguments]).
[error] 84-84: prepScript.sh failed: line 1: source: filename argument required (source: usage: source filename [arguments]).
[error] 118-118: prepScript.sh failed: line 1: source: filename argument required (source: usage: source filename [arguments]).
[error] 138-138: prepScript.sh failed: line 1: source: filename argument required (source: usage: source filename [arguments]).
[error] 73-73: prepScript.sh failed: line 1: source: filename argument required (source: usage: source filename [arguments]).
[error] 93-93: prepScript.sh failed: line 1: source: filename argument required (source: usage: source filename [arguments]).
[error] 129-129: prepScript.sh failed: line 1: source: filename argument required (source: usage: source filename [arguments]).
Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Definitions/Input.cs
[warning] 11-11: SA1600: Elements should be documented.
Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Helpers/ErrorHandler.cs
[warning] 13-13: CS1572: XML comment has a param tag for 'errorMessage', but there is no parameter by that name.
[warning] 15-15: CS1573: Parameter 'errorMessageOnFailure' has no matching param tag in the XML comment for 'ErrorHandler.Handle(Exception, bool, string, int, string, string)' (but other parameters do).
🪛 markdownlint-cli2 (0.17.2)
Frends.Python.ExecuteScript/README.md
36-36: Bare URL used
(MD034, no-bare-urls)
🪛 Shellcheck (0.10.0)
Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.Tests/TestData/prepScript.sh
[error] 1-1: This file has a UTF-8 BOM. Remove it with: LC_CTYPE=C sed '1s/^...//' < yourscript .
(SC1082)
[error] 1-1: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
(SC2148)
[warning] 3-3: ShellCheck can't follow non-constant source. Use a directive to specify location.
(SC1090)
🔇 Additional comments (6)
Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/FrendsTaskMetadata.json (1)
1-7: Metadata looks correct; verify csproj packaging and remove BOM if present.TaskMethod matches Frends.Python.ExecuteScript.Python.ExecuteScript (found in Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.cs). I couldn't confirm whether Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.csproj packs FrendsTaskMetadata.json to the NuGet root or copies it to output, nor whether the JSON contains a UTF‑8 BOM — ensure the csproj includes packaging/CopyToOutputDirectory for FrendsTaskMetadata.json and save the JSON without a BOM.
Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.sln (1)
1-40: Solution structure LGTMProjects, configurations, and Solution Items are correctly wired. Nothing blocking.
Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Definitions/Options.cs (2)
11-17: Default behavior LGTMThrowErrorOnFailure default=true aligns with guidelines and tests.
22-25: Set the default to null; only mark the property nullable if you enable NRTTests assign ErrorMessageOnFailure = null but the repo does not enable nullable reference types. Change the DefaultValue to null and either leave the property as-is or enable nullable and make it nullable.
- Change in Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Definitions/Options.cs:
- [DefaultValue("")] + [DefaultValue(null)] public string ErrorMessageOnFailure { get; set; }
- If you want compiler null-safety: enable enable in Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.csproj and change the property to:
public string? ErrorMessageOnFailure { get; set; }
- Confirm the UI respects [DisplayFormat(DataFormatString = "Text")] for the editor; if not, use the attribute your UI expects.
Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.Tests/GlobalSuppressions.cs (1)
3-10: Suppressions look fine for the test assemblyNo functional risk; aligns with project-wide StyleCop posture.
Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.Tests/TestData/scriptWithImport.py (1)
1-4: LGTMSimple, deterministic test fixture.
| /// <summary> | ||
| /// Essential parameters. | ||
| /// </summary> | ||
| public class Input | ||
| { | ||
| public bool IsPreparationNeeded { get; set; } | ||
| public string PreparationScriptPath { get; set; } //flag true only | ||
| public ExecutionMode ExecutionMode { get; set; } | ||
| public string ScriptPath { get; set; } //script mode only | ||
| public string Code { get; set; } //inline mode only | ||
| public string[] Arguments { get; set; } = []; | ||
| } |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Add XML docs and validation attributes for public task parameters
Public members need summaries/examples; add basic validation hints per guidelines.
public class Input
{
- public bool IsPreparationNeeded { get; set; }
- public string PreparationScriptPath { get; set; } //flag true only
- public ExecutionMode ExecutionMode { get; set; }
- public string ScriptPath { get; set; } //script mode only
- public string Code { get; set; } //inline mode only
- public string[] Arguments { get; set; } = [];
+ /// <summary>Whether to run a preparation script before executing Python.</summary>
+ /// <example>false</example>
+ [DefaultValue(false)]
+ public bool IsPreparationNeeded { get; set; }
+
+ /// <summary>Path to a preparation script (.ps1 on Windows, .sh on Unix). Required when <see cref="IsPreparationNeeded"/> is true.</summary>
+ /// <example>C:\temp\prep.ps1</example>
+ [DisplayFormat(DataFormatString = "Text")]
+ public string PreparationScriptPath { get; set; }
+
+ /// <summary>Execution mode: run from file or inline code.</summary>
+ /// <example>ExecutionMode.Script</example>
+ public ExecutionMode ExecutionMode { get; set; }
+
+ /// <summary>Absolute path to a Python script. Required when <see cref="ExecutionMode"/> is Script.</summary>
+ /// <example>/opt/app/script.py</example>
+ [DisplayFormat(DataFormatString = "Text")]
+ public string ScriptPath { get; set; }
+
+ /// <summary>Inline Python code to execute. Required when <see cref="ExecutionMode"/> is Inline.</summary>
+ /// <example>print("Hello, World!")</example>
+ [DisplayFormat(DataFormatString = "Text")]
+ public string Code { get; set; }
+
+ /// <summary>Arguments passed to the Python process.</summary>
+ /// <example>["arg1","arg2"]</example>
+ public string[] Arguments { get; set; } = [];
}Committable suggestion skipped: line range outside the PR's diff.
🧰 Tools
🪛 GitHub Check: build / Build on ubuntu-22.04
[warning] 14-14:
Elements should be documented
[warning] 13-13:
Elements should be documented
[warning] 12-12:
Elements should be documented
[warning] 11-11:
Elements should be documented
[warning] 15-15:
Single line comment should begin with a space.
[warning] 14-14:
Single line comment should begin with a space.
[warning] 12-12:
Single line comment should begin with a space.
[warning] 16-16:
Missing XML comment for publicly visible type or member 'Input.Arguments'
[warning] 15-15:
Missing XML comment for publicly visible type or member 'Input.Code'
[warning] 14-14:
Missing XML comment for publicly visible type or member 'Input.ScriptPath'
[warning] 13-13:
Missing XML comment for publicly visible type or member 'Input.ExecutionMode'
[warning] 12-12:
Missing XML comment for publicly visible type or member 'Input.PreparationScriptPath'
[warning] 11-11:
Missing XML comment for publicly visible type or member 'Input.IsPreparationNeeded'
🪛 GitHub Actions: ExecuteScript_build_test
[warning] 11-11: SA1600: Elements should be documented.
🤖 Prompt for AI Agents
In Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Definitions/Input.cs
around lines 6 to 17, the public properties lack XML documentation and
validation attributes; add XML <summary> comments (and <example> where helpful)
for each property and apply appropriate data annotations: mark ScriptPath
required when ExecutionMode is Script, Code required when ExecutionMode is
Inline, PreparationScriptPath required when IsPreparationNeeded is true, add
[Required] to properties that are always mandatory (e.g., ExecutionMode), add
[Url] or a path-format hint if paths must be absolute or validated, add
[MinLength]/[MaxLength] for Code and Arguments as appropriate, and initialize
Arguments to an empty array correctly; ensure comments briefly describe intended
usage and constraints per guidelines.
There was a problem hiding this comment.
Actionable comments posted: 0
♻️ Duplicate comments (1)
Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.Tests/TestData/prepScript.sh (1)
1-5: Make the script CI-safe: remove BOM, add shebang + strict mode, avoid activation, use venv’s python -m pipBOM + no shebang causes shell ambiguity (and
sourcemay fail under /bin/sh). Prefer explicit bash, strict flags, and install via the venv interpreter without activating the environment.Apply:
- -echo "Preparing environment..." -python3 -m venv ./myenv -source ./myenv/bin/activate -pip install numpy +#!/usr/bin/env bash +set -euo pipefail +echo "Preparing environment..." +python3 -m venv ./myenv +./myenv/bin/python -m pip install -q numpyRun to confirm BOM removal and shebang presence:
#!/bin/bash set -euo pipefail f="Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.Tests/TestData/prepScript.sh" # BOM check (should produce no output) rg -nP '^\xEF\xBB\xBF' "$f" || true # Shebang check (should show line 1) rg -n '^#!' -n "$f" # Quick ShellCheck (if available) command -v shellcheck >/dev/null && shellcheck -s bash "$f" || echo "shellcheck not installed"
🧹 Nitpick comments (1)
Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.Tests/TestData/prepScript.sh (1)
1-5: Add a trailing newline at EOFKeeps POSIX tools and diffs cleaner.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.Tests/Frends.Python.ExecuteScript.Tests.csproj(1 hunks)Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.Tests/TestData/prepScript.sh(1 hunks)Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.cs(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.Tests/Frends.Python.ExecuteScript.Tests.csproj
- Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.cs
🧰 Additional context used
🪛 Shellcheck (0.10.0)
Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.Tests/TestData/prepScript.sh
[error] 1-1: This file has a UTF-8 BOM. Remove it with: LC_CTYPE=C sed '1s/^...//' < yourscript .
(SC1082)
[error] 1-1: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
(SC2148)
⏰ 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). (2)
- GitHub Check: build / Check Code Quality
- GitHub Check: build / Build on ubuntu-22.04
There was a problem hiding this comment.
Actionable comments posted: 0
♻️ Duplicate comments (1)
Frends.Python.ExecuteScript/README.md (1)
13-13: Add developer setup prerequisites under Building.Required by the checklist; also helps local test reliability. Mirrors prior feedback.
## Building + +### Prerequisites + +- .NET SDK 8.0+ +- Python 3.8+ available on PATH +- pip (bundled with Python) +- On Windows: PowerShell 5+; on Linux/macOS: Bash +- Ensure `python --version` and `pip --version` succeed in the same shell used for `dotnet test`. + +### Verify environment + +```bash +python --version +pip --version +dotnet --version +```
🧹 Nitpick comments (3)
Frends.Python.ExecuteScript/README.md (3)
11-11: Brand capitalization: “Frends”Use consistent product casing.
-You can install the Task via frends UI Task View. +You can install the Task via Frends UI Task View.
25-31: Use fenced code blocks for multi-step commands.Easier to copy/paste and scan.
-Run the tests - -`dotnet test` +Run the tests + +```bash +dotnet test +``` @@ -`dotnet pack --configuration Release` +```bash +dotnet pack --configuration Release +```
35-36: Fix bare URL and name; satisfy markdownlint MD034.Use a markdown link and correct package name “StyleCop.Analyzers”.
-StyleCop.Analyzer version (unmodified version 1.1.118) used to analyze code uses Apache-2.0 license, full text and -source code can be found at https://github.com/DotNetAnalyzers/StyleCopAnalyzers +StyleCop.Analyzers (unmodified version 1.1.118) is used to analyze code and is licensed under Apache-2.0. Full text and source: +[github.com/DotNetAnalyzers/StyleCopAnalyzers](https://github.com/DotNetAnalyzers/StyleCopAnalyzers)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (9)
Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.Tests/UnitTests.cs(1 hunks)Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Definitions/Error.cs(1 hunks)Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Definitions/ExecutionMode.cs(1 hunks)Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Definitions/Input.cs(1 hunks)Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Definitions/Result.cs(1 hunks)Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.cs(1 hunks)Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.csproj(1 hunks)Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Helpers/ErrorHandler.cs(1 hunks)Frends.Python.ExecuteScript/README.md(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (8)
- Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Definitions/ExecutionMode.cs
- Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Definitions/Error.cs
- Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.cs
- Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.Tests/UnitTests.cs
- Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Definitions/Input.cs
- Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Helpers/ErrorHandler.cs
- Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Definitions/Result.cs
- Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.csproj
🧰 Additional context used
📓 Path-based instructions (1)
Frends.*/README.md
⚙️ CodeRabbit configuration file
Frends.*/README.md: Confirm README includes:
- Badges (build, license, coverage)
- Developer setup instructions (e.g., credentials, Docker setup, if needed)
- Do not include parameter descriptions; those are auto-generated.
- Use clear, markdown-formatted sections.
Files:
Frends.Python.ExecuteScript/README.md
🪛 markdownlint-cli2 (0.17.2)
Frends.Python.ExecuteScript/README.md
36-36: Bare URL used
(MD034, no-bare-urls)
⏰ 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). (2)
- GitHub Check: build / Build on ubuntu-22.04
- GitHub Check: build / Check Code Quality
🔇 Additional comments (2)
Frends.Python.ExecuteScript/README.md (2)
5-7: Badges look good (build, coverage, license).Meets the checklist requirement. Keep these current as workflows evolve.
5-6: Confirm coverage badge source.Ensure the custom coverage badge endpoint reflects this task’s path and branch filters; otherwise it may show stale data.
There was a problem hiding this comment.
Actionable comments posted: 0
♻️ Duplicate comments (1)
Frends.Python.ExecuteScript/README.md (1)
25-30: Prerequisites added — resolves earlier feedback.The developer prerequisites section addresses the prior request to document required tools.
🧹 Nitpick comments (2)
Frends.Python.ExecuteScript/README.md (2)
19-22: Optional: Add a short “Developer setup” section.A minimal setup snippet (verify Python/pip on PATH) would help first‑time contributors.
### Build the project `dotnet build` +### Developer setup (optional) + +Verify Python and pip are available on PATH: + +```bash +python --version +pip --version +``` + +On Windows, ensure PowerShell is available; on Linux/macOS, ensure Bash is available. No additional Python packages are required to build or run the tests. +
41-42: Fix markdownlint MD034 (bare URL) and correct package name/wording.Use a markdown link and the correct package name “StyleCop.Analyzers”.
-StyleCop.Analyzer version (unmodified version 1.1.118) used to analyze code uses Apache-2.0 license, full text and -source code can be found at https://github.com/DotNetAnalyzers/StyleCopAnalyzers +StyleCop.Analyzers (unmodified version 1.1.118) is used to analyze the code and is licensed under Apache-2.0. Full text and +source code can be found at <https://github.com/DotNetAnalyzers/StyleCopAnalyzers>.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
.github/workflows/ExecuteScript_build_and_test_on_main.yml(1 hunks).github/workflows/ExecuteScript_build_and_test_on_push.yml(1 hunks).github/workflows/ExecuteScript_release.yml(1 hunks)Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Definitions/Input.cs(1 hunks)Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.cs(1 hunks)Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.csproj(1 hunks)Frends.Python.ExecuteScript/README.md(1 hunks)README.md(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- README.md
🚧 Files skipped from review as they are similar to previous changes (6)
- .github/workflows/ExecuteScript_build_and_test_on_push.yml
- Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.cs
- .github/workflows/ExecuteScript_build_and_test_on_main.yml
- Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Frends.Python.ExecuteScript.csproj
- Frends.Python.ExecuteScript/Frends.Python.ExecuteScript/Definitions/Input.cs
- .github/workflows/ExecuteScript_release.yml
🧰 Additional context used
📓 Path-based instructions (1)
Frends.*/README.md
⚙️ CodeRabbit configuration file
Frends.*/README.md: Confirm README includes:
- Badges (build, license, coverage)
- Developer setup instructions (e.g., credentials, Docker setup, if needed)
- Do not include parameter descriptions; those are auto-generated.
- Use clear, markdown-formatted sections.
Files:
Frends.Python.ExecuteScript/README.md
🪛 markdownlint-cli2 (0.17.2)
Frends.Python.ExecuteScript/README.md
42-42: Bare URL used
(MD034, no-bare-urls)
🔇 Additional comments (1)
Frends.Python.ExecuteScript/README.md (1)
5-7: Badges look good.Build, coverage, and MIT license badges are present and correctly formatted.
[]# Frends Task Pull Request
Summary
Review Checklist
1. Frends Task Project Files
Frends.*/Frends.*/*.csproj<PackageLicenseExpression>MIT</PackageLicenseExpression>)<Version><Authors>Frends</Authors><Description><RepositoryUrl><GenerateDocumentationFile>true</GenerateDocumentationFile>2. File: FrendsTaskMetadata.json
Frends.*/Frends.*/FrendsTaskMetadata.json3. File: README.md
Frends.*/README.md4. File: CHANGELOG.md
Frends.*/CHANGELOG.md5. File: migration.json
Frends.*/Frends.*/migration.json6. Source Code Documentation
Frends.*/Frends.*/*.cs<summary>XML comments<example>XML comments<frendsdocs>XML comments, if needed7. GitHub Actions Workflows
.github/workflows/*.yml*_test.yml*_main.yml*_release.yml8. Task Result Object Structure
Frends.*/Frends.*/*.csSuccess(bool)Additional Notes
Summary by CodeRabbit
New Features
Tests
Documentation
Chores