Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fully qualify OutputPath for PublishingContext - #9351

#9351
Merged
davidfowl merged 1 commit into
mainmicrosoft/aspire:mainfrom
safia/fix-output-pathmicrosoft/aspire:safia/fix-output-pathCopy head branch name to clipboard
May 16, 2025
Merged

Fully qualify OutputPath for PublishingContext#9351
davidfowl merged 1 commit into
mainmicrosoft/aspire:mainfrom
safia/fix-output-pathmicrosoft/aspire:safia/fix-output-pathCopy head branch name to clipboard

Conversation

@captainsafia

Copy link
Copy Markdown
Contributor

Closes #9346.

Copilot AI review requested due to automatic review settings May 16, 2025 05:19
@captainsafia
captainsafia requested a review from mitchdenny as a code owner May 16, 2025 05:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR ensures that the PublishingContext consistently receives a fully qualified OutputPath, addressing an issue where relative paths might cause unexpected behavior. The changes include adding an assertion in tests to verify the fully qualified path and updating the Publisher to use Path.GetFullPath.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
tests/Aspire.Hosting.Tests/PublishingTests.cs Adds an assertion to check that OutputPath is fully qualified in the test.
src/Aspire.Hosting/Publishing/Publisher.cs Updates the PublishingContext initialization to use a fully qualified path.

@github-actions github-actions Bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label May 16, 2025
}

var context = new PublishingContext(model, executionContext, serviceProvider, logger, cancellationToken, options.Value.OutputPath);
var context = new PublishingContext(model, executionContext, serviceProvider, logger, cancellationToken, Path.GetFullPath(options.Value.OutputPath));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hmm, relative to what? CWD? I think this is right.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yep -- it uses CWD as the base AFAIK. I'll remember to update the tests to check for this as a tack on to a future PR.

@davidfowl
davidfowl merged commit 08b8af7 into main May 16, 2025
@davidfowl
davidfowl deleted the safia/fix-output-path branch May 16, 2025 12:21
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PublishingContext.OutputPath should point to fully qualified path

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.