microsoft / microsoft/powerplatform-vscode

`pac solution sync` does not honour packagetype in solution.xml

Open
#913 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
277
Forks
60
Avg merge
1d 1h
Merged PRs (30d)
14

Description

If I clone a solution with unmanaged package type when I subsequently perform a solution sync I'd expect only the unmanaged solution to be cloned and the package type to stay as unmanaged. This does not happen, the unmanaged and managed solutions are exported and the solution is unpacked in 'both' mode.

Similarly, if I initially cloned in managed mode I'd expect that to be remembered and honoured by any future pac solution sync.

To reproduce:

  1. pac solution clone --packagetype unmanaged --solution myAmazingThing
  2. Notice that <managed>0</managed> is in Other\Solution.xml indicating solution is of the unmanaged export style
  3. Now sync pac solution sync

Expected result

  1. A single unmanaged export is performed
  2. Solution.xml should be unchanged, and still have <managed>0</managed>

Actual result

  1. Two solution exports are performed (unmanaged and managed)
  2. Solution.xml is changed and now in 'both' mode, i.e. <managed>2</managed>

Workaround

Remember to type pac solution sync --packagetype unmanaged with the correct package type (as appropriate)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the pac solution sync command and how it determines packagetype after pac solution clone. Compare the resulting exports and Other\Solution.xml values for managed, unmanaged, and both modes. Done means sync performs only the remembered export and preserves the existing <managed> value without requiring an explicit --packagetype.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.