Enlighten RequiresFramework35SP1Assembly task for multithreaded mode#13575
Enlighten RequiresFramework35SP1Assembly task for multithreaded mode#13575jankratochvilcz wants to merge 2 commits intomainfrom
Conversation
The task computes a single boolean output from in-memory inputs only: no filesystem, environment, process, or AppDomain access, and no shared mutable static state. Per the multithreaded-task-migration skill (Step 1b), the `[MSBuildMultiThreadableTask]` attribute alone is sufficient -- `IMultiThreadableTask` is not implemented because there is no `TaskEnvironment` consumer. Adds baseline unit tests covering each predicate in `Execute`, the `CreateDesktopShortcut` framework-version gate, and the SP1/Net35 sentinel identity short-circuit, since the task previously had no direct coverage. Fixes #13572 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Decorates RequiresFramework35SP1Assembly as multithreadable (attribute-only) as part of the built-in task multithreaded migration, and adds direct unit tests to lock in existing ClickOnce-related predicate behavior.
Changes:
- Add
[MSBuildMultiThreadableTask]toRequiresFramework35SP1Assembly. - Add new unit tests covering the task’s independent trigger conditions (URL, shortcut + TFV gate, signing, suite name, and
IncludeHash=false/ sentinel identities).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/Tasks/RequiresFramework35SP1Assembly.cs | Marks the task as eligible for multithreaded execution via attribute. |
| src/Tasks.UnitTests/RequiresFramework35SP1Assembly_Tests.cs | Adds predicate-focused unit coverage for RequiresMinimumFramework35SP1 computation. |
There was a problem hiding this comment.
Review Summary — Multithreaded Task Migration for RequiresFramework35SP1Assembly
Overall: Clean PR, correct migration. The task is purely in-memory (string compares, Version parse/compare, ITaskItem metadata reads) with no filesystem, environment variable, process, or shared static state access. The [MSBuildMultiThreadableTask] attribute alone (without IMultiThreadableTask) is the correct approach per the migration guidance.
✅ What looks good
| Dimension | Assessment |
|---|---|
| Multithreaded migration | Correct — attribute-only pattern matches Message, Error, Warning, Telemetry, etc. No IMultiThreadableTask needed since there are no file/env operations. |
| Static state safety | Verified — ConvertFrameworkVersionToString and CompareFrameworkVersions are pure static functions. No shared mutable state. |
| Backwards compatibility | No behavior change — attribute is additive metadata only. |
| Test coverage | Strong — 14 tests covering defaults, each Execute predicate independently, version parsing edge cases (v-prefix and bare), SP1/sentinel identity short-circuit, and the CreateDesktopShortcut TFV gate. |
| Test isolation | Each test creates its own task instance via CreateTask(). No shared state between tests. |
| Concurrency | Task instance is not shared across threads. All fields are instance-scoped. Safe. |
| API surface | No public API changes — [MSBuildMultiThreadableTask] is detected by namespace/name, not assembly. |
| Naming / conventions | Test class follows {TaskName}_Tests convention. Method names describe behavior clearly. |
📝 Minor suggestions (non-blocking)
#nullable disableon new file — Project guidelines say new files should use nullable reference types. Minor style point.- Missing negative test for benign items — A test with items present but not triggering (e.g.,
IncludeHash=true, non-matching identity) would strengthen theIsExcludedFileOrSP1Filenegative-path coverage.
No correctness issues, no breaking changes, no performance concerns.
Generated by Expert Code Review (on open) for issue #13575 · ● 1.9M
- Drop SigningManifests=true default from CreateTask helper. Split the defaults case into two tests so the bare-default behavior (UncheckedSigning triggers) is documented alongside the signing-enabled no-trigger baseline. Per-predicate tests now set SigningManifests=true explicitly. - Remove `#nullable disable` from the new test file per repo convention for new files. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
RequiresFramework35SP1Assemblyis purely in-memory (string compares,Versionparse/compare,ITaskItemmetadata reads) — no filesystem, env vars, process start, or shared static state. Per themultithreaded-task-migrationskill Step 1b, the[MSBuildMultiThreadableTask]attribute alone is sufficient;IMultiThreadableTaskis not needed. No code changes toExecuteor helpers, no targets change, no ChangeWave.The task previously had no direct unit coverage. Added 14 test cases locking in the contract: defaults, each
Executepredicate triggering independently, theCreateDesktopShortcutTFV ≥ v3.5 gate (bothv-prefixed and bare version strings), and the SP1/Net35Client sentinel identity short-circuit. Passing onnet10.0andnet472.Fixes #13572