Octopack Version number is too short

We have problem with the Octopack version number limitation.
Our team city build give this error when I want to put the branch name to the package version.
error OCTONUGET: The special version part cannot exceed 20 characters
I know it may be limitation of the nuget, but we need to solve it.
We would like to use this branch name because we use a lot of feature branch and we need to deploy them therefor we need to idetify, but the version number is not enough.
This is the setting of the build: %build_number%-%teamcity.build.branch%
We use git and sometimes our feature branch name is too long like /JIRA-1234-something-feature-name

Do you have any idea to solve this?

Hi,

As you said, this is a NuGet limitation. When passing the value to OctoPack, could you trim it to the first 20 characters, or to something like JIRA-1234?

Paul

Yes. It can be a solution, but you know I 'm not able to trim it in the teamcity build configuration. The octopack could trim it easily. Does it make sense?

Just got bit by this NuGet limitation. Our build numbers have the format “major.minor.buildCounter-branchName” where “branchName” can be as long as the developer wants (and feature branches tend do be long).

I understand that the only workaround is to trim it to 20 characters, but would be nice if Octopack/Octo.exe could do this for us and trim it automatically, so we could save a build step. :wink:

Thanks,
Caio Proiete

Hi Caio,

Thanks for your suggestion! I have created a UserVoice item for this


Please feel free to go and comment and vote.

Thanks!
Vanessa

I too was bit by this issue, but I found a workaround that I think is a good one. I started using this application:

On each build, this will generate the current Semantic Version number of the repository, based on it’s current state. I then pass the generated version number along to Octopus as part of our deployment process. For us, this works really well.

Hope that helps!

@Gary: thanks for the suggestion.

I’ve experimented with GitVersion a few weeks ago, and we ran into the same problem (which is the NuGet limitation).

We need the ability to deploy (from Octopus) any feature branch and we need an easy way to find the branch we want to deploy when creating a new release in Octopus.

The convention we use is PackageId.SemVer-BranchName. E.g.:

  • MyApp.1.0.0.4-JIRA-1238-aa-some-meaningful-description
  • MyApp.1.0.0.3-JIRA-1231-bb-some-meaningful-description
  • MyApp.1.0.0.2-JIRA-1235-bb-some-meaningful-description
  • MyApp.1.0.0.1-JIRA-1234-cc-some-meaningful-description
  • etc.

Where “aa, bb, cc” are the initials of the developers who sent the pull-request, and the JIRA ticket number is part of the branch name (also convention).

We then include the SHA1 and other important info in the Release Notes of the package

Ps. Realized I’ve put an additional “0” in the version numbers. These should read:

  • MyApp.1.0.4-JIRA-1238-aa-some-meaningful-description
  • MyApp.1.0.3-JIRA-1231-bb-some-meaningful-description
  • MyApp.1.0.2-JIRA-1235-bb-some-meaningful-description
  • MyApp.1.0.1-JIRA-1234-cc-some-meaningful-description
  • etc.