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

Strategies for assembly versioning #147

Merged
merged 2 commits into from
May 8, 2014
Merged

Conversation

nulltoken
Copy link
Contributor

Current state of affairs

Currently asmversion is set to major.minor.0.0 for the purpose of this discussion lets call this strategy MajorMinor

Other potential strategies

  • MajorOnly= `major.0.0.0``
  • Strict= major.minor.patch.0
  • None = `1.0.0.0``

Proposed changes

In order to relieve some of the pain with strongnaming until we can remove it we (NServiceBus) has decided to only put the major into our asm version to avoid asmredirects for minor + patch updates. Ie we're applying the MajorOnlystrategy from above. I propose that we add at least that one to GitVersion

Defaults

Should we keep the current strategy as the default?

The way I see it the MajorMinor is somewhat between all the others and if you follow SemVer AND is strongnamed I argue that MajorOnlyis more appropriate.

For non strongnamed projects the obvious strategy would be the Strict since its non lossy. Could we in anyway detect this and adjust accordingly?

If we can't detect perhaps Strictis the best default and then strongnamed projects can override depending if they follow SemVer or not?

@andreasohlund
Copy link
Contributor Author

@GeertvanHorrik
Copy link
Contributor

I think strict must be the default.

@nulltoken nulltoken self-assigned this May 3, 2014
@nulltoken
Copy link
Contributor

I've started to work on this.

@nulltoken
Copy link
Contributor

I've pushed up two commits to get some early feedback.

Main changes:

  • Replaced the SignAssembly Task property in favor of AssemblyVersioningScheme
  • Used MinorMinorPatch instead of Strict

@nulltoken
Copy link
Contributor

Hmmm. Build failed.

I'm a bit puzzled by the error message:

Test(s) failed. System.Exception : Approvals is not set up to use your test framework.
It currently supports [NUnit, MsTest, MbUnit, xUnit.net, xUnit.extensions, Machine.Specifications (MSpec)]
To add one use ApprovalTests.StackTraceParsers.StackTraceParser.AddParser() method to add implementation of ApprovalTests.StackTraceParsers.IStackTraceParser with support for your testing framework.
To learn how to implement one see http://blog.approvaltests.com/2012/01/creating-namers.html

@SimonCropp Could you please give me a hand here? Previous commit was also relying on Approvals and passed.

@SimonCropp
Copy link
Contributor

@nulltoken can u try putting debug-info to full on the release build of the test project? if that doesnt work (and u r comfortable with the current state) merge it and I will fix it in dev

@JakeGinnivan
Copy link
Contributor

This error can happen for release builds. Without the source location approval tests doesn't work. @SimonCropp's fix should work

@JakeGinnivan
Copy link
Contributor

I have also had to attribute my test method with no-inlining which also has fixed this issue for me in the past

@andreasohlund
Copy link
Contributor Author

Are we all good with strict being the default?

@JakeGinnivan
Copy link
Contributor

Yep, strict is good.

The issue with not being strict by default is it actually sucks for the people that use strong naming for real reasons (like simon)

@nulltoken
Copy link
Contributor

Ok. I more or less managed to have the tests pass (thanks to @SimonCropp and @JakeGinnivan help).

Now there's a different kind of failure:

[11:31:55]Step 5/5: xUnit (Command Line)
[11:31:56][Step 5/5] Step xUnit (Command Line) failed

Any idea? Once this is solved I'll clean up the history from my attempts.

@JakeGinnivan
Copy link
Contributor

This is my fault. I can't look into it for now. Just disable that build step for now until I can look into it

@nulltoken
Copy link
Contributor

@JakeGinnivan Disabling the last step fixed the issue. Thanks!

@nulltoken
Copy link
Contributor

All good now.

  • Tests are passing
  • Commit history cleaned up

@andreasohlund
Copy link
Contributor Author

Looks good to me!

@andreasohlund andreasohlund merged commit 36b298f into master May 8, 2014
@andreasohlund andreasohlund deleted the ntk/assembly-version branch May 21, 2014 12:01
@andreasohlund
Copy link
Contributor Author

@nulltoken I just saw that MajorMinor is missing. Was that removed on purpose?
cc @yvesgoeleven

@nulltoken
Copy link
Contributor

@nulltoken I just saw that MajorMinor is missing. Was that removed on purpose?

Duh. That's a mistake. 😳

I'll send a PR this evening along with some tests to cover this assembly versionning scheme.

__shamefully crawling back under my rock**

@andreasohlund
Copy link
Contributor Author

No worries!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants