Repository navigation
Use shared helper for CLI log creation - #21276
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: dbbcfabd-6eb0-4db1-a205-a613b15587af
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 21276Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 21276" |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🟢 Approval recommended
No blocking issues were identified, and focused regression tests cover the changed behaviors, though tests were not executed in this environment.
No open issues 🎉
What changed in this PR
This PR strengthens CLI diagnostic log privacy by using the shared directory helper and enforcing owner-only Unix permissions.
Changes:
- Restricts Unix log files, including reused files, while preserving existing custom-directory and Windows permissions.
- Handles access-denied initialization failures by warning and disabling file logging.
- Adds regression tests and documents diagnostic log privacy.
| File | Description |
|---|---|
tests/Aspire.Cli.Tests/Diagnostics/FileLoggerProviderTests.cs |
Tests permissions, initialization failures, and log persistence. |
src/Aspire.Cli/README.md |
Documents permissions and sensitive log content. |
src/Aspire.Cli/Program.cs |
Passes the dedicated logs directory to the provider. |
src/Aspire.Cli/Diagnostics/FileLoggerProvider.cs |
Uses the shared helper and secures file creation and reuse. |
Review effort: Balanced
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
Jose Perez Rodriguez (joperezr)
left a comment
There was a problem hiding this comment.
LGTM, thanks Mitch
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: dbbcfabd-6eb0-4db1-a205-a613b15587af
Tests selector2 / 100 PR test projects · 4 PR jobs, from 5 changed files. Selected PR test projects (2 / 100)
Selected PR jobs (4)
How these were chosen — grouped by what changed📦 affected project 🧪 🧪 🧪 Job reasons
Selection computed for commit |
|
/backport to release/13.6 |
|
Started backporting to |
|
Mitch Denny (@mitchdenny) backporting to git am output$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch
Applying: Use shared helper for CLI log creation
Applying: Export container log copies for lifetime test evidence
Using index info to reconstruct a base tree...
A tests/Aspire.Cli.EndToEnd.Tests/Helpers/IntegrationHostLifetimeTestHelper.cs
A tests/Aspire.Cli.EndToEnd.Tests/IntegrationHostLifetimeTests.cs
Falling back to patching base and 3-way merge...
CONFLICT (modify/delete): tests/Aspire.Cli.EndToEnd.Tests/Helpers/IntegrationHostLifetimeTestHelper.cs deleted in HEAD and modified in Export container log copies for lifetime test evidence. Version Export container log copies for lifetime test evidence of tests/Aspire.Cli.EndToEnd.Tests/Helpers/IntegrationHostLifetimeTestHelper.cs left in tree.
CONFLICT (modify/delete): tests/Aspire.Cli.EndToEnd.Tests/IntegrationHostLifetimeTests.cs deleted in HEAD and modified in Export container log copies for lifetime test evidence. Version Export container log copies for lifetime test evidence of tests/Aspire.Cli.EndToEnd.Tests/IntegrationHostLifetimeTests.cs left in tree.
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0002 Export container log copies for lifetime test evidence
Error: The process '/usr/bin/git' failed with exit code 128 |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
✅ No documentation update needed. docs_optional → internal_refactor. No signals triggered (signal_count 0). The PR switches CLI log directory creation to a shared helper (FileLoggerProvider.cs, Program.cs, an internal README, and tests). It adds no new public surface, options, or user-visible strings. |
## Description Backport of #21276 to `release/13.6`. Use the shared directory helper when creating the CLI logs directory. Fixes # (issue) ### Validation - `./restore.sh` — passed, 0 warnings and 0 errors. - `MSBUILDTERMINALLOGGER=false dotnet test --project tests/Aspire.Cli.Tests/Aspire.Cli.Tests.csproj --no-launch-profile -- --filter-class '*.FileLoggerProviderTests' --filter-class '*.ProgramTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'` — passed, 23 tests, 0 failures and 0 skipped. ## Checklist - Is this feature complete? - [x] Yes. Ready to ship. - [ ] No. Follow-up changes expected. - Are you including unit tests for the changes and scenario tests if relevant? - [x] Yes - [ ] No - Did you add public API? - [ ] Yes - If yes, did you have an API Review for it? - [ ] Yes - [ ] No - Did you add `<remarks />` and `<code />` elements on your triple slash comments? - [ ] Yes - [ ] No - [x] No - Does the change make any security assumptions or guarantees? - [x] Yes - If yes, have you done a threat model and had a security review? - [ ] Yes - [x] No - [ ] No ## Customer Impact Makes CLI log creation use the shared helper. ## Testing Release restore passed; 23 focused logger and startup tests passed (exact commands recorded above). ## Risk Low. Localized CLI log creation change; no public API changes. ## Regression? Unknown. --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: Jose Perez Rodriguez <joperezr@microsoft.com> Copilot-Session: 8f47f33a-b5a8-4258-95d7-843d027f4064
Updated [Aspire.Hosting](https://github.com/microsoft/aspire) from 13.6.2 to 13.6.4. <details> <summary>Release notes</summary> _Sourced from [Aspire.Hosting's releases](https://github.com/microsoft/aspire/releases)._ ## 13.6.4 ## What's New in Aspire 13.6.4 Patch release for Aspire 13.6 that improves resource startup reliability, fixes Azure publishing with parameterized enum properties in TypeScript AppHosts, and tightens CLI diagnostic log permissions on Unix. ### 🐛 Fixes - 🖥️ **Resources could fail to start after a DCP create request timed out** — AppHost now checks whether a resource was created before retrying a timed-out or HTTP 504 request, avoiding a premature `FailedToStart` state when DCP completed the operation. API operations default to a 40-second timeout with an additional 20-second allowance before the first successful operation, and resource creation has a two-minute recovery budget. These limits can be configured through `DcpPublisher:KubernetesApiTimeout`, `DcpPublisher:KubernetesInitializationAdditionalTimeout`, and `DcpPublisher:KubernetesCreateRecoveryTimeout`. Established watch and log streams are not limited by these operation timeouts. Addresses startup timeouts reported in 13.6. Fixes [#20691](microsoft/aspire#20691). ([#20868](microsoft/aspire#20868), backport of [#20752](microsoft/aspire#20752), @danegsta) - ☁️ **TypeScript AppHosts could fail to publish parameterized Azure enum properties** — Assigning a `bicep().parameter(...)` expression to an enum-valued provisioning property, such as an Azure Storage SKU name, now works instead of failing with a type-assignment error. Type checking for literal values and incompatible expression types is preserved. Fixes a scenario introduced with the Azure provisioning proxy feature in 13.6. ([#20767](microsoft/aspire#20767), backport of [#20557](microsoft/aspire#20557), @sebastienros) - 🔒 **CLI diagnostic logs now use owner-only permissions on Unix** — Log files are restricted to owner read/write access (`0600`), including reused files, and the dedicated Aspire logs directory uses owner-only access (`0700`), repairing existing permissions when needed. Newly created custom log directories also use `0700`; existing custom parent directories and Windows permission behavior are unchanged. Diagnostic logs can contain sensitive data, including dashboard login URLs, so review them before sharing. ([#21282](microsoft/aspire#21282), backport of [#21276](microsoft/aspire#21276), @mitchdenny) --- *Full Changelog: [v13.6.3...v13.6.4](microsoft/aspire@v13.6.3...v13.6.4)* *Full commit: [c89352703f78ae46de90fbf751ed8b52b77b89bf](microsoft/aspire@c89352703f78ae46de90fbf751ed8b52b77b89bf)* ## 13.6.3 ## What's New in Aspire 13.6.3 Patch release for Aspire 13.6 that improves resource orchestration reliability by preventing unread resource watches from stalling resource updates and operations. ### 🐛 Fixes - 🖥️ **Resource operations could stall when a watch stopped being read** — AppHost now closes abandoned watch connections when setup is canceled and keeps reading resource events even when event handlers are slow. Resource event ordering, lifecycle callback dispatch, and the existing periodic reconnection safeguard are preserved. ([#21002](microsoft/aspire#21002), backport of [#20972](microsoft/aspire#20972), @danegsta) - 🔄 **Slow watchers could block other resource updates or watcher shutdown** — The bundled Developer Control Plane (DCP) is updated to 0.26.6, which keeps internal lifecycle watches draining and uses bounded, asynchronous watch delivery to prevent unread watches from blocking resource-change publication and unrelated watcher shutdown. ([#21215](microsoft/aspire#21215), @danegsta; includes [microsoft/dcp#307](microsoft/dcp#307)) --- *Full Changelog: [v13.6.2...v13.6.3](microsoft/aspire@v13.6.2...v13.6.3)* *Full commit: [38294b1b31552dae42a516cffa0cbc737ec08976](microsoft/aspire@38294b1b31552dae42a516cffa0cbc737ec08976)* Commits viewable in [compare view](microsoft/aspire@v13.6.2...v13.6.4). </details> Updated [Aspire.Hosting.AppHost](https://github.com/microsoft/aspire) from 13.6.2 to 13.6.4. <details> <summary>Release notes</summary> _Sourced from [Aspire.Hosting.AppHost's releases](https://github.com/microsoft/aspire/releases)._ ## 13.6.4 ## What's New in Aspire 13.6.4 Patch release for Aspire 13.6 that improves resource startup reliability, fixes Azure publishing with parameterized enum properties in TypeScript AppHosts, and tightens CLI diagnostic log permissions on Unix. ### 🐛 Fixes - 🖥️ **Resources could fail to start after a DCP create request timed out** — AppHost now checks whether a resource was created before retrying a timed-out or HTTP 504 request, avoiding a premature `FailedToStart` state when DCP completed the operation. API operations default to a 40-second timeout with an additional 20-second allowance before the first successful operation, and resource creation has a two-minute recovery budget. These limits can be configured through `DcpPublisher:KubernetesApiTimeout`, `DcpPublisher:KubernetesInitializationAdditionalTimeout`, and `DcpPublisher:KubernetesCreateRecoveryTimeout`. Established watch and log streams are not limited by these operation timeouts. Addresses startup timeouts reported in 13.6. Fixes [#20691](microsoft/aspire#20691). ([#20868](microsoft/aspire#20868), backport of [#20752](microsoft/aspire#20752), @danegsta) - ☁️ **TypeScript AppHosts could fail to publish parameterized Azure enum properties** — Assigning a `bicep().parameter(...)` expression to an enum-valued provisioning property, such as an Azure Storage SKU name, now works instead of failing with a type-assignment error. Type checking for literal values and incompatible expression types is preserved. Fixes a scenario introduced with the Azure provisioning proxy feature in 13.6. ([#20767](microsoft/aspire#20767), backport of [#20557](microsoft/aspire#20557), @sebastienros) - 🔒 **CLI diagnostic logs now use owner-only permissions on Unix** — Log files are restricted to owner read/write access (`0600`), including reused files, and the dedicated Aspire logs directory uses owner-only access (`0700`), repairing existing permissions when needed. Newly created custom log directories also use `0700`; existing custom parent directories and Windows permission behavior are unchanged. Diagnostic logs can contain sensitive data, including dashboard login URLs, so review them before sharing. ([#21282](microsoft/aspire#21282), backport of [#21276](microsoft/aspire#21276), @mitchdenny) --- *Full Changelog: [v13.6.3...v13.6.4](microsoft/aspire@v13.6.3...v13.6.4)* *Full commit: [c89352703f78ae46de90fbf751ed8b52b77b89bf](microsoft/aspire@c89352703f78ae46de90fbf751ed8b52b77b89bf)* ## 13.6.3 ## What's New in Aspire 13.6.3 Patch release for Aspire 13.6 that improves resource orchestration reliability by preventing unread resource watches from stalling resource updates and operations. ### 🐛 Fixes - 🖥️ **Resource operations could stall when a watch stopped being read** — AppHost now closes abandoned watch connections when setup is canceled and keeps reading resource events even when event handlers are slow. Resource event ordering, lifecycle callback dispatch, and the existing periodic reconnection safeguard are preserved. ([#21002](microsoft/aspire#21002), backport of [#20972](microsoft/aspire#20972), @danegsta) - 🔄 **Slow watchers could block other resource updates or watcher shutdown** — The bundled Developer Control Plane (DCP) is updated to 0.26.6, which keeps internal lifecycle watches draining and uses bounded, asynchronous watch delivery to prevent unread watches from blocking resource-change publication and unrelated watcher shutdown. ([#21215](microsoft/aspire#21215), @danegsta; includes [microsoft/dcp#307](microsoft/dcp#307)) --- *Full Changelog: [v13.6.2...v13.6.3](microsoft/aspire@v13.6.2...v13.6.3)* *Full commit: [38294b1b31552dae42a516cffa0cbc737ec08976](microsoft/aspire@38294b1b31552dae42a516cffa0cbc737ec08976)* Commits viewable in [compare view](microsoft/aspire@v13.6.2...v13.6.4). </details> Updated [Aspire.Hosting.Azure.ServiceBus](https://github.com/microsoft/aspire) from 13.6.2 to 13.6.4. <details> <summary>Release notes</summary> _Sourced from [Aspire.Hosting.Azure.ServiceBus's releases](https://github.com/microsoft/aspire/releases)._ ## 13.6.4 ## What's New in Aspire 13.6.4 Patch release for Aspire 13.6 that improves resource startup reliability, fixes Azure publishing with parameterized enum properties in TypeScript AppHosts, and tightens CLI diagnostic log permissions on Unix. ### 🐛 Fixes - 🖥️ **Resources could fail to start after a DCP create request timed out** — AppHost now checks whether a resource was created before retrying a timed-out or HTTP 504 request, avoiding a premature `FailedToStart` state when DCP completed the operation. API operations default to a 40-second timeout with an additional 20-second allowance before the first successful operation, and resource creation has a two-minute recovery budget. These limits can be configured through `DcpPublisher:KubernetesApiTimeout`, `DcpPublisher:KubernetesInitializationAdditionalTimeout`, and `DcpPublisher:KubernetesCreateRecoveryTimeout`. Established watch and log streams are not limited by these operation timeouts. Addresses startup timeouts reported in 13.6. Fixes [#20691](microsoft/aspire#20691). ([#20868](microsoft/aspire#20868), backport of [#20752](microsoft/aspire#20752), @danegsta) - ☁️ **TypeScript AppHosts could fail to publish parameterized Azure enum properties** — Assigning a `bicep().parameter(...)` expression to an enum-valued provisioning property, such as an Azure Storage SKU name, now works instead of failing with a type-assignment error. Type checking for literal values and incompatible expression types is preserved. Fixes a scenario introduced with the Azure provisioning proxy feature in 13.6. ([#20767](microsoft/aspire#20767), backport of [#20557](microsoft/aspire#20557), @sebastienros) - 🔒 **CLI diagnostic logs now use owner-only permissions on Unix** — Log files are restricted to owner read/write access (`0600`), including reused files, and the dedicated Aspire logs directory uses owner-only access (`0700`), repairing existing permissions when needed. Newly created custom log directories also use `0700`; existing custom parent directories and Windows permission behavior are unchanged. Diagnostic logs can contain sensitive data, including dashboard login URLs, so review them before sharing. ([#21282](microsoft/aspire#21282), backport of [#21276](microsoft/aspire#21276), @mitchdenny) --- *Full Changelog: [v13.6.3...v13.6.4](microsoft/aspire@v13.6.3...v13.6.4)* *Full commit: [c89352703f78ae46de90fbf751ed8b52b77b89bf](microsoft/aspire@c89352703f78ae46de90fbf751ed8b52b77b89bf)* ## 13.6.3 ## What's New in Aspire 13.6.3 Patch release for Aspire 13.6 that improves resource orchestration reliability by preventing unread resource watches from stalling resource updates and operations. ### 🐛 Fixes - 🖥️ **Resource operations could stall when a watch stopped being read** — AppHost now closes abandoned watch connections when setup is canceled and keeps reading resource events even when event handlers are slow. Resource event ordering, lifecycle callback dispatch, and the existing periodic reconnection safeguard are preserved. ([#21002](microsoft/aspire#21002), backport of [#20972](microsoft/aspire#20972), @danegsta) - 🔄 **Slow watchers could block other resource updates or watcher shutdown** — The bundled Developer Control Plane (DCP) is updated to 0.26.6, which keeps internal lifecycle watches draining and uses bounded, asynchronous watch delivery to prevent unread watches from blocking resource-change publication and unrelated watcher shutdown. ([#21215](microsoft/aspire#21215), @danegsta; includes [microsoft/dcp#307](microsoft/dcp#307)) --- *Full Changelog: [v13.6.2...v13.6.3](microsoft/aspire@v13.6.2...v13.6.3)* *Full commit: [38294b1b31552dae42a516cffa0cbc737ec08976](microsoft/aspire@38294b1b31552dae42a516cffa0cbc737ec08976)* Commits viewable in [compare view](microsoft/aspire@v13.6.2...v13.6.4). </details> Updated [Microsoft.AspNetCore.DataProtection](https://github.com/dotnet/dotnet) from 10.0.13 to 10.0.14. <details> <summary>Release notes</summary> _Sourced from [Microsoft.AspNetCore.DataProtection's releases](https://github.com/dotnet/dotnet/releases)._ No release notes found for this version range. Commits viewable in [compare view](https://github.com/dotnet/dotnet/commits). </details> Updated [Microsoft.EntityFrameworkCore](https://github.com/dotnet/dotnet) from 10.0.13 to 10.0.14. <details> <summary>Release notes</summary> _Sourced from [Microsoft.EntityFrameworkCore's releases](https://github.com/dotnet/dotnet/releases)._ No release notes found for this version range. Commits viewable in [compare view](https://github.com/dotnet/dotnet/commits). </details> Updated [Microsoft.EntityFrameworkCore.Abstractions](https://github.com/dotnet/dotnet) from 10.0.13 to 10.0.14. <details> <summary>Release notes</summary> _Sourced from [Microsoft.EntityFrameworkCore.Abstractions's releases](https://github.com/dotnet/dotnet/releases)._ No release notes found for this version range. Commits viewable in [compare view](https://github.com/dotnet/dotnet/commits). </details> Updated [Microsoft.EntityFrameworkCore.Sqlite](https://github.com/dotnet/dotnet) from 10.0.13 to 10.0.14. <details> <summary>Release notes</summary> _Sourced from [Microsoft.EntityFrameworkCore.Sqlite's releases](https://github.com/dotnet/dotnet/releases)._ No release notes found for this version range. Commits viewable in [compare view](https://github.com/dotnet/dotnet/commits). </details> Updated [Microsoft.Extensions.Configuration.Abstractions](https://github.com/dotnet/dotnet) from 10.0.13 to 10.0.14. <details> <summary>Release notes</summary> _Sourced from [Microsoft.Extensions.Configuration.Abstractions's releases](https://github.com/dotnet/dotnet/releases)._ No release notes found for this version range. Commits viewable in [compare view](https://github.com/dotnet/dotnet/commits). </details> Updated [Microsoft.Extensions.DependencyInjection.Abstractions](https://github.com/dotnet/dotnet) from 10.0.13 to 10.0.14. <details> <summary>Release notes</summary> _Sourced from [Microsoft.Extensions.DependencyInjection.Abstractions's releases](https://github.com/dotnet/dotnet/releases)._ No release notes found for this version range. Commits viewable in [compare view](https://github.com/dotnet/dotnet/commits). </details> Updated [Microsoft.Extensions.Hosting.Abstractions](https://github.com/dotnet/dotnet) from 10.0.13 to 10.0.14. <details> <summary>Release notes</summary> _Sourced from [Microsoft.Extensions.Hosting.Abstractions's releases](https://github.com/dotnet/dotnet/releases)._ No release notes found for this version range. Commits viewable in [compare view](https://github.com/dotnet/dotnet/commits). </details> Updated [Microsoft.Extensions.Logging.Abstractions](https://github.com/dotnet/dotnet) from 10.0.13 to 10.0.14. <details> <summary>Release notes</summary> _Sourced from [Microsoft.Extensions.Logging.Abstractions's releases](https://github.com/dotnet/dotnet/releases)._ No release notes found for this version range. Commits viewable in [compare view](https://github.com/dotnet/dotnet/commits). </details> Updated [Microsoft.Extensions.Options](https://github.com/dotnet/dotnet) from 10.0.13 to 10.0.14. <details> <summary>Release notes</summary> _Sourced from [Microsoft.Extensions.Options's releases](https://github.com/dotnet/dotnet/releases)._ No release notes found for this version range. Commits viewable in [compare view](https://github.com/dotnet/dotnet/commits). </details> Updated [Microsoft.Extensions.Options.ConfigurationExtensions](https://github.com/dotnet/dotnet) from 10.0.13 to 10.0.14. <details> <summary>Release notes</summary> _Sourced from [Microsoft.Extensions.Options.ConfigurationExtensions's releases](https://github.com/dotnet/dotnet/releases)._ No release notes found for this version range. Commits viewable in [compare view](https://github.com/dotnet/dotnet/commits). </details> Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore <dependency name> major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself) - `@dependabot ignore <dependency name> minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself) - `@dependabot ignore <dependency name>` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself) - `@dependabot unignore <dependency name>` will remove all of the ignore conditions of the specified dependency - `@dependabot unignore <dependency name> <ignore condition>` will remove the ignore condition of the specified dependency and ignore conditions </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Description
Use the shared directory helper when creating the CLI logs directory.
Fixes # (issue)
Checklist
<remarks />and<code />elements on your triple slash comments?