chocolatey / chocolatey/choco

new - Token replacement with in nuspec should more closely match nuget

Open
#2,100 3 comments 0 reactions 0 assignees View on GitHub
0 - Backlog Enhancement
Dominant language
C#
Stars
11.5k
Forks
960
PR merge metrics
No merged PRs in 30d

Description

### What You Are Seeing?

Within the scaffolded .nuspec template generated by a command such as choco new -n bob, there are some tokens for replacement. Since choco uses nuget pack, I was able to successfully replace the default token _REPLACE_ with $version$ and remove the need to edit/substitute the file.

### What is Expected?

- Editing or token-substitution should be handled by the build tooling.
- Tokens should be named for ease of replacement
- Tokens should follow nuspec standards
- Command-line should be used for all steps in pipeline

Should the default choco new command scaffold a valid nuspec with proper tokens, and verify on pack that all tokens are set?
This might require a feature flag to ensure backwards compatibility in builds and updates to tutorials and help.

There is some variations between nuspec and csproj behavior, not sure if fixed.

I got here from following the tutorial

### How Did You Get This To Happen? (Steps to Reproduce)

```powershell
choco new -n bob
choco pack -build .\bob\bob.nuspec --outputdirectory .\build --version=0.0.1-alpha
```

### Output Log

```plaintext
Chocolatey v0.10.15
'__REPLACE__' is not a valid version string.
Parameter name: version
```

Full Log Output

~~~sh
PLACE LOG CONTENT HERE - WE NEED _ALL_ DETAILED OUTPUT BASED ON THE ABOVE TO BE ABLE TO PROVIDE SUPPORT (YOU WILL FIND THAT IN THE $env:ChocolateyInstall\logs\chocolatey.log between the `=====`)
~~~

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with `choco new -n bob` and the shown `choco pack` command, then inspect the generated bob.nuspec and token handling used by pack. Compare the scaffolded tokens with the linked NuGet replacement-token standards and determine the required compatibility and validation scope. Done means the scaffold produces valid, consistently replaceable tokens and packing verifies that required values are set.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, powershell
Domain
build-system, cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.