Fix: task.addattachment blocked by restricted command mode (0.3.1)#23
Merged
Merged
Conversation
…live test) Running the packaged 0.3.0 task on a real agent surfaced: ##vso[task.addattachment] is not allowed in this step due to policy restrictions The restrictions.commands.mode="restricted" added to tb-main/task.json in the Phase 2 "modern task metadata" work does not allow task.addattachment, which is exactly how TBMain hands the results payload to the build-results tab. With it blocked, the attachment was never written and the tab showed "No test results found". The mock-test harness doesn't enforce the agent's command policy, so this only appeared on a real run. - Remove the commands.mode="restricted" restriction from tb-main/task.json (keep the settableVariables allowlist, which works and adds real value). - Bump 0.3.0 -> 0.3.1. tb-stop-tunnel keeps restricted mode: it only emits ##vso[task.complete], which IS allowed in restricted mode.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (4)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughThe package version is updated from 0.3.0 to 0.3.1 in three manifests. The task configuration removes its restricted command mode while retaining the allowed settable variables configuration. ChangesPackage and task updates
Estimated code review effort: 1 (Trivial) | ~3 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found in live testing 🎯
Running the packaged 0.3.0
TBMaintask on a real Microsoft-hosted agent produced this warning, and the build-results tab showed "No test results found":Root cause
The
restrictions: { commands: { mode: "restricted" } }I added totb-main/task.jsonin the Phase 2 "modern task metadata" step does not permittask.addattachment— which is exactly howTBMainhands the results payload to the tab. With it blocked, the attachment is never written, so the (correctly-working) tab has nothing to render.The
mock-testharness doesn't enforce the agent's command policy, so this only showed up on a real run — precisely the live-org validation I flagged as necessary.Fix
commands.mode: "restricted"fromtb-main/task.json(keep thesettableVariablesallowlist — it works and adds real value).0.3.0→0.3.1.tb-stop-tunnelkeeps restricted mode: it only emits##vso[task.complete], which is allowed in restricted mode.Note
The 0.3.0 draft release has this bug — don't publish 0.3.0; 0.3.1 is the fixed release. Validated end-to-end against a live Azure DevOps org (re-run pending).
Summary by CodeRabbit