Skip to content

Conversation

@captainsafia
Copy link
Member

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
Copy link
Contributor

Copilot AI left a comment

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
Member

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
Member 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
255 checks passed
@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