Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(vscode): Add function to create and update solution file with Logic App .csproj #6721

Merged
merged 7 commits into from
Mar 10, 2025

Conversation

samikay101
Copy link
Contributor

@samikay101 samikay101 commented Mar 3, 2025

Work Item Links


Type of Change

  • Feature
  • Bug Fix

Current Behavior

Feature Context:

Currently, there is no automated way to create a solution file (.sln) and add the Logic App .csproj file within the test directory. Users have to manually create a solution file and register the project.

Bug Context:

When a user creates a unit test in a multi-project setup, the incorrect project may be selected, leading to invalid workflow creation.


New Behavior & Fixes

Feature Enhancement:

This PR introduces the updateSolutionWithProject function, which automates the following steps:

  1. Creates a new solution file (Tests.sln) if one does not already exist in the test directory.
  2. Computes the relative path of the Logic App .csproj file from the test directory.
  3. Adds the .csproj file to the solution using dotnet sln add.

This enhancement ensures seamless project setup for Logic App solutions.

Bug Fix:

Expected Behavior:

  • If the wrong project is selected, no workflow should be created, and an error should be displayed to the user.

Actual Behavior:

  • A workflow is incorrectly generated with wrong fields and incorrect folder placements, leading to invalid configurations and potential failures.

Repro Steps:

  1. Open the multi-project environment.
  2. Attempt to create a unit test.
  3. Select an incorrect project during the process.
  4. Observe that a workflow is still created but with incorrect fields and incorrect folder locations.

Proposed Fix:

  • Implement validation to ensure the correct project is selected before allowing workflow creation.
  • If an incorrect project is chosen, halt workflow generation and display a clear error message.
  • Validate folder placement logic to prevent incorrect structure generation.

Acceptance Criteria:

  • If an incorrect project is selected, the system should not create a workflow.
  • A clear error message should inform the user that the project selection is invalid.
  • Workflows should only be created in the correct project folder with the expected fields.

Impact of Change

  • This is a breaking change.
    (No breaking changes; this is a feature addition and bug fix.)

Test Plan

  • Unit tests added to apps/vs-code-designer/src/app/commands/workflows/unitTest/test/saveBlankUnitTest.test.ts
  • Unit test added to apps/vs-code-designer/src/app/utils/test/UnitTesting/unitTestUtils.test.ts

Screenshots or Videos (if applicable)

*(Attach any relevant screenshots or recordings showing the fix in action.)

@samikay101 samikay101 marked this pull request as ready for review March 10, 2025 18:18
@samikay101 samikay101 requested a review from hartra344 as a code owner March 10, 2025 18:18
@ccastrotrejo ccastrotrejo merged commit 477070c into Azure:dev/unitTestCodeful Mar 10, 2025
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants