Skip to content

Release/3.0.0 #364

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

Merged
merged 150 commits into from
Mar 13, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
150 commits
Select commit Hold shift + click to select a range
62c532d
Added support for branch specific config
Dec 9, 2014
36c87a8
Implemented different versioning modes
Dec 10, 2014
ab38fd3
code cleanup
Dec 10, 2014
2c47502
changed branches
Dec 10, 2014
c2330e4
enhanced branches config
Dec 10, 2014
ded3425
Merge remote-tracking branch 'upstream/master' into BranchSpecificCon…
JakeGinnivan Jan 7, 2015
5da70ee
Fixed merge issue
JakeGinnivan Jan 7, 2015
ff3cbea
Merge remote-tracking branch 'upstream/master' into BranchSpecificCon…
JakeGinnivan Jan 8, 2015
67be1f6
Current branch configuration should be set by the context
JakeGinnivan Jan 7, 2015
3ecf6fa
Should match branch name only at start of line
JakeGinnivan Jan 7, 2015
3ad8b33
Fixed failing tests
JakeGinnivan Jan 8, 2015
3705f6f
Fixing tests which were affected by a git race condition. See https:/…
JakeGinnivan Jan 8, 2015
e7a5548
Found a workaround which is fixed now
JakeGinnivan Jan 8, 2015
e885ce7
Fixed issue found in review
JakeGinnivan Jan 8, 2015
9fd17dd
Merge pull request #339 from JakeGinnivan/ContextAssignsBranchConfigu…
JakeGinnivan Jan 8, 2015
a65a115
Throw error when user is using legacy configuration values
JakeGinnivan Jan 9, 2015
6f6305c
Merge pull request #342 from JakeGinnivan/legacyConfig
JakeGinnivan Jan 9, 2015
1d8a7f9
Initial refactoring around configuration, introducing EffectiveConfig…
JakeGinnivan Jan 8, 2015
74cd78f
Fixed failing tests
JakeGinnivan Jan 9, 2015
7a35a71
Created some tests around EffectiveConfig
JakeGinnivan Jan 9, 2015
b9b2a2b
Inspection error fix
JakeGinnivan Jan 9, 2015
5d86d09
Merge pull request #341 from JakeGinnivan/VariableProviderModes
JakeGinnivan Jan 9, 2015
3545141
Introduced VersionVariables rather than passing a Dictionary around
JakeGinnivan Jan 10, 2015
3d90664
Mode now changes the variables created and used by GitVersion
JakeGinnivan Jan 10, 2015
dc6f8b4
Changed the Continuous Deployment output to be more sensible
JakeGinnivan Jan 10, 2015
33c891a
Fixed a small issue with build metadata
JakeGinnivan Jan 10, 2015
95e744e
Merge pull request #343 from JakeGinnivan/VariableProviderUpdates
JakeGinnivan Jan 12, 2015
ea0e316
Deprecated NextVersion.txt
JakeGinnivan Jan 11, 2015
7b59651
Merge pull request #345 from JakeGinnivan/NoMoreNextVersionTxt
JakeGinnivan Jan 13, 2015
f85cd83
Starting on base version calculators
JakeGinnivan Jan 10, 2015
62b6f42
Added merge message base version strategy
JakeGinnivan Jan 10, 2015
b25220a
Adding LastTagBaseVersionStrategy
JakeGinnivan Jan 10, 2015
8ee25e8
Created NewNextVersionCalculator which is the new version calculation
JakeGinnivan Jan 10, 2015
a74bbf5
Added MetaDataCalculator in and fixed up some other shortcomings in t…
JakeGinnivan Jan 10, 2015
aa54a21
Uncomment line in GitVersionFinder to test new way of doing things. I…
JakeGinnivan Jan 10, 2015
7a0267f
Should not increment version when current commit is tagged
JakeGinnivan Jan 11, 2015
83d3862
Added missing base version finder
JakeGinnivan Jan 11, 2015
a952bb1
Allow inheriting of the parent branches increment strategy. Allows fe…
JakeGinnivan Jan 11, 2015
690399e
When branch configuration has 'Tag' set to 'useBranchName' it will us…
JakeGinnivan Jan 11, 2015
810d309
Fixed a few tests and the way inheriting increment strategy works
JakeGinnivan Jan 11, 2015
3e0be76
Base versions can specify whether the tag should be updated
JakeGinnivan Jan 11, 2015
2dbcc84
Fixing incorrect tests, when develop is branched from master it is st…
JakeGinnivan Jan 11, 2015
204d2bc
Fixed some exceptions which were causing tests to blow up and not get…
JakeGinnivan Jan 11, 2015
e999a62
Think the code is mostly there. It is now mainly fixing commit counti…
JakeGinnivan Jan 11, 2015
900ccf6
Fixed failing tests
JakeGinnivan Jan 12, 2015
8ab088f
Fixed build issue
JakeGinnivan Jan 14, 2015
b7c090d
Removed branch comparer
JakeGinnivan Jan 16, 2015
f7e30c4
Turned on new code
JakeGinnivan Jan 16, 2015
b924119
Merge pull request #346 from JakeGinnivan/ConfigBasedVersioningImprov…
JakeGinnivan Jan 16, 2015
9e0b0cb
#351 Fall back to default branch if not specified for dynamic reposit…
GeertvanHorrik Jan 17, 2015
a66119e
#351 Added support for GitVersionConfig.yaml
GeertvanHorrik Jan 17, 2015
d556d5b
#351 Improved unit tests to support configuration checks in dynamic r…
GeertvanHorrik Jan 17, 2015
7f3394c
Merge branch 'master' of https://github.com/ParticularLabs/GitVersion…
GeertvanHorrik Jan 17, 2015
d8d7593
Build fix
GeertvanHorrik Jan 17, 2015
e42b013
Fixed unit tests for dynamic repositories
GeertvanHorrik Jan 18, 2015
14487a0
Merge remote-tracking branch 'upstream/master' into BranchSpecificCon…
JakeGinnivan Jan 18, 2015
5605c49
Fix typo
JakeGinnivan Jan 18, 2015
76dc8c1
Fixed obsolete compiler warnings for YamlAlias attribute
JakeGinnivan Jan 18, 2015
03e9df5
Replacing obsolete usage of repo.Index.Stage with repo.Stage
JakeGinnivan Jan 18, 2015
91a71f8
Fixing compiler errors with conflicting types due to namespace removal
JakeGinnivan Jan 18, 2015
e9382e1
Fixed develop tests
JakeGinnivan Jan 18, 2015
85f76fc
Merge pull request #354 from JakeGinnivan/TypoFix
gep13 Jan 18, 2015
f6741a8
Resharper fix
GeertvanHorrik Jan 18, 2015
86e5b1a
Fix feature branch related tests
JakeGinnivan Jan 18, 2015
917ef91
Fixing a lot of commit counting in tests
JakeGinnivan Jan 18, 2015
e0bf106
Adding better logging around the new version calculation
JakeGinnivan Jan 18, 2015
07085ab
Added failing PR test
JakeGinnivan Jan 19, 2015
be87141
Fixed config inheritance for pull requests
JakeGinnivan Jan 24, 2015
a611c65
Fixed PR's from a fork
JakeGinnivan Jan 24, 2015
2c2019f
Filter remote branches to fix PRs
JakeGinnivan Jan 25, 2015
349dce8
Merge pull request #353 from JakeGinnivan/BuildWarningFixes
JakeGinnivan Feb 11, 2015
7af3377
Merge pull request #355 from JakeGinnivan/FixingTests
JakeGinnivan Feb 11, 2015
0eea2aa
Removed x86 solution build config
JakeGinnivan Feb 11, 2015
959f90b
Moved BuildServers tests to Core test project
JakeGinnivan Feb 11, 2015
f78871e
Removed a whole bunch of unused code
JakeGinnivan Feb 11, 2015
a31b530
Inlined a class which is only used in one place now
JakeGinnivan Feb 11, 2015
d5a2545
Removed LastMinorVersionFinder and OriginalDate from the assembly inf…
JakeGinnivan Feb 11, 2015
2f7a666
Removed VersionOnMasterFinder which is no longer used
JakeGinnivan Feb 11, 2015
66592d4
Inlined RecentTagVersionExtractor into only class using it
JakeGinnivan Feb 11, 2015
fee6a2e
Removed more unneeded code
JakeGinnivan Feb 11, 2015
b7b189a
Fixed a few more tests and collapsed the GitFlow/GitHubFlow test fold…
JakeGinnivan Feb 11, 2015
65d0c0c
Fixed a bunch more tests
JakeGinnivan Feb 11, 2015
b4ec263
Added some logging
JakeGinnivan Feb 11, 2015
184c862
Merge pull request #362 from JakeGinnivan/Cleanup
JakeGinnivan Feb 11, 2015
7a57e59
Merge pull request #363 from JakeGinnivan/MoreTestFixes
JakeGinnivan Feb 13, 2015
5b16cd1
Fixed MetaDataByCommitScenarios test.
JakeGinnivan Feb 13, 2015
805226d
Deleted MetaDataByCommitScenarios test as it can be decomposed into i…
JakeGinnivan Feb 13, 2015
ea56834
Got all tests passing
JakeGinnivan Feb 13, 2015
cc7441e
Merge remote-tracking branch 'upstream/master' into release/3.0.0
JakeGinnivan Feb 13, 2015
a7d9a05
Fixing compile issues after merge
JakeGinnivan Feb 13, 2015
cfee2fa
Removed unused class
JakeGinnivan Feb 13, 2015
90fdbc5
Small rename
JakeGinnivan Feb 13, 2015
903d407
These tests are covered elsewhere
JakeGinnivan Feb 13, 2015
18a59c3
Removed LambdaEqualityHelperFixture as it doesn't actually test anything
JakeGinnivan Feb 14, 2015
b718b46
Moved some test classes into Core tests from Task tests
JakeGinnivan Feb 14, 2015
e79162e
Merge branch 'pr/NextVersionForDynamicRepositories' of https://github…
JakeGinnivan Feb 14, 2015
db4bd4a
Removed commit retry by making random file contents variable length
JakeGinnivan Feb 14, 2015
b7e2826
Merge branch 'GeertvanHorrik-pr/NextVersionForDynamicRepositories' in…
JakeGinnivan Feb 14, 2015
50a3d20
Fixed some argument parser bugs
JakeGinnivan Feb 14, 2015
710b088
Updated command line help and added /showConfig argument
JakeGinnivan Feb 14, 2015
28c8531
Merge pull request #365 from JakeGinnivan/ArgumentParserImprovements
JakeGinnivan Feb 14, 2015
e95fda1
Improved formatting of NuGet pre-release tags
JakeGinnivan Feb 14, 2015
3ede844
Better Continuous Deployment solution
JakeGinnivan Feb 14, 2015
1146d58
Updating readme
JakeGinnivan Feb 14, 2015
a4cf51a
Merge pull request #366 from JakeGinnivan/BetterContinuousDeploymentL…
JakeGinnivan Feb 14, 2015
71e5377
Small update to readme
JakeGinnivan Feb 14, 2015
14ffad9
Resize image
JakeGinnivan Feb 14, 2015
1f29d1f
Small formatting change
JakeGinnivan Feb 14, 2015
d638b70
Updated breaking changes
JakeGinnivan Feb 14, 2015
23a6266
Verified #331 is fixed
JakeGinnivan Feb 14, 2015
b3792e0
More minor readme fixes
JakeGinnivan Feb 14, 2015
1959809
Prevent inlining to allow build server to pass
JakeGinnivan Feb 14, 2015
3f19a66
Fixes #360 - was taking last tag, now taking highest tag on that branch
JakeGinnivan Feb 15, 2015
d853e7b
Making it clear in the readme that GitVersion ships with default inte…
JakeGinnivan Feb 15, 2015
7c34c52
Made it easy to test Pull requests and verified #281 is fixed
JakeGinnivan Feb 15, 2015
6171f94
Removed more unused code
JakeGinnivan Feb 15, 2015
8577dd1
MergeMessageParser inlined and removed duplicated tests
JakeGinnivan Feb 15, 2015
182782e
Using PeeledTarget instead of Target
JakeGinnivan Feb 15, 2015
cd70b43
remove AssemblyVersioningScheme
SimonCropp Feb 15, 2015
d46e745
remove classic version from tags
SimonCropp Feb 15, 2015
2fdfc7e
Renaming integration test classes to be consistent
JakeGinnivan Feb 15, 2015
41211b0
RepositoryFixtureBase was not using the variable provider making it e…
JakeGinnivan Feb 15, 2015
dddc014
Renamed NewNextVersionCalculator to NewNextVersionCalculator
JakeGinnivan Feb 15, 2015
a3efe7d
Removed ShouldUpdateTag as context.IsCurrentCommitTagged should be en…
JakeGinnivan Feb 15, 2015
1a1e477
Updated readme to explain the magic string 'useBranchNameAsTag in the…
JakeGinnivan Feb 15, 2015
9ec391e
When commit is tagged, do not add commit count of 0. Leave empty (rem…
JakeGinnivan Feb 15, 2015
fe9e951
Added CONTRIBUTING.md
JakeGinnivan Feb 15, 2015
4deddb4
Small code warning fixes
JakeGinnivan Feb 15, 2015
73ce173
Small CONTRIBUTING update
JakeGinnivan Feb 15, 2015
3432b2e
Release 3.0: fix README formatting
yannisgu Feb 15, 2015
c9dd9ba
Merge pull request #369 from yannisgu/patch-2
JakeGinnivan Feb 16, 2015
7ca51bf
Fixed mode config inheritance, removed the commit count from metadata…
JakeGinnivan Feb 16, 2015
5d95af6
Fixed regression in GitVersionTask AssemblyInfoBuilder not making fil…
JakeGinnivan Feb 16, 2015
216b03c
Attempted fix for branch inheritance issue
JakeGinnivan Feb 16, 2015
f319232
Fixed exception when adding new branch specs to config
JakeGinnivan Feb 16, 2015
e549a4d
Fixed some issues in sample config
JakeGinnivan Feb 16, 2015
a525cfb
Adding VersionBumpingScenarios to make version bumping more discovera…
JakeGinnivan Feb 16, 2015
b29725c
Merge pull request #371 from JakeGinnivan/ReviewAndCommentFixes
JakeGinnivan Feb 16, 2015
33cd812
Small readme update
JakeGinnivan Feb 16, 2015
bb3fde8
Added info on how we calculate version to readme
JakeGinnivan Feb 18, 2015
f7b096f
Merge pull request #373 from JakeGinnivan/ReadmeUpdate
JakeGinnivan Feb 19, 2015
ae81188
Fixes #375 - Made known merge branch version number extraction case i…
Feb 24, 2015
43db528
fix IL error with visualize.fody
SimonCropp Mar 9, 2015
f18f189
Merge pull request #377 from anobleperson/release/3.0.0
JakeGinnivan Mar 9, 2015
ea74acb
also verify the exe
SimonCropp Mar 9, 2015
cdae6dc
Fixes #380 but on 3.0 branch
Mar 9, 2015
c96b55b
Simplify the merge version parsing code
Mar 9, 2015
0ee69e9
Simplify the merge version parsing code
Mar 9, 2015
ab9cc0d
Merge pull request #383 from eggapauli/feature/fix-merge-detection
JakeGinnivan Mar 13, 2015
f277ae7
Fixed failing test
JakeGinnivan Mar 13, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions BREAKING CHANGES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
v3.0.0
- Develop no longer tracks master
- NextVersion.txt has been deprecated, only GitVersion.yaml is supported
- `AssemblyFileSemVer` variable removed, AssemblyVersioningScheme configuration value makes this variable obsolete
- Variables `ClassicVersion` and `ClassicVersionWithTag` removed
- MSBuild task arguments (AssemblyVersioningScheme, DevelopBranchTag, ReleaseBranchTag, TagPrefix, NextVersion) have been removed, use GitVersionConfig.yaml instead
- GitVersionTask ReleaseDateAttribute no longer has OriginalReleaseDate
93 changes: 93 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# Contributing to GitVersion
We love contributions to get started contributing you might need:

- [Get started with git](http://rogerdudler.github.io/git-guide)
- [How to create a pull request](https://help.github.com/articles/using-pull-requests)
- [An issue to work on](https://github.com/ParticularLabs/GitVersion/labels/up-for-grabs) - We are on [Up for grabs](http://up-for-grabs.net/), our up for grabs issues are tagged `up-for-grabs`
- An understanding of our [architecture](#architecture) and how [we write tests](#writing-tests)

Once you know how to create a pull request and have an issue to work on, just post a comment saying you will work on it.
If you end up not being able to complete the task, please post another comment so others can pick it up.

Issues are also welcome, [failing tests](#writing-tests) are even more welcome.

# Architecture
GitVersion has three distict steps for calculating versions in v3.0.

1. If the current commit is tagged, the tag is used and build metadata (Excluding commit count) is added. The other two steps will not execute
2. A set of strategies are evaluated to decide on the base version and some metadata about that version.
These strategies include HighestReachableTag, NextVersionInConfig, MergedBranchWithVersion, VersionInBranchName etc.
3. The highest base version is selected, using that base version the new version is calculated.

Visually it looks something like this:
![Version Calculation](http://www.plantuml.com:80/plantuml/png/fLCxJyCm4DxzAsuib4P914i69De1CS38Vd6kYIN7ZcodK8aVp-KX6Y2fKCbY9NV-7lVb2WoOeoVOMRDNfH0lz1vUoNbbpGwrR3K6ws1p3rlk-bN8u972f2AC3GHEbLN8m1D1Jjg-mPuXAZvx9kL1ZW1KY5dOZczMI0Pf54VnHtf7jpaAWJg0sW-uXw4PK3Eb1sMaevfCW6i1_0m6po1l7HfPJUxvu5XYUOHLWq5MLptCudmMK9--u5glJ0dIEaVo1Dw3JgVM6Km4cM9mzyrQXHuQHnj7chhl0JcnIrHjno1wiWtgfi8eWVK_7OQAmBHrJWvORFVM2PmrE7AcWZGh-Lj0FvptVvLiUPnCdG_XhNhOov9wQ1fzv7nw5S5EwSvw6CDQNfnMwUAP0XQyQpj70nkx3Nn3p5NFY9IshbNWepKi8ublWFiSPkC0ee8El75Dv5aOxqZQBScbWpWn0Pe2wb6aM1p4Eea_0G00)

[Edit Diagram](http://www.plantuml.com/plantuml/form?url=http://www.plantuml.com/plantuml/png/fLCxJyCm4DxzAsuib4P914i69De1CS38Vd6kYIN7ZcodK8aVp-KX6Y2fKCbY9NV-7lVb2WoOeoVOMRDNfH0lz1vUoNbbpGwrR3K6ws1p3rlk-bN8u972f2AC3GHEbLN8m1D1Jjg-mPuXAZvx9kL1ZW1KY5dOZczMI0Pf54VnHtf7jpaAWJg0sW-uXw4PK3Eb1sMaevfCW6i1_0m6po1l7HfPJUxvu5XYUOHLWq5MLptCudmMK9--u5glJ0dIEaVo1Dw3JgVM6Km4cM9mzyrQXHuQHnj7chhl0JcnIrHjno1wiWtgfi8eWVK_7OQAmBHrJWvORFVM2PmrE7AcWZGh-Lj0FvptVvLiUPnCdG_XhNhOov9wQ1fzv7nw5S5EwSvw6CDQNfnMwUAP0XQyQpj70nkx3Nn3p5NFY9IshbNWepKi8ublWFiSPkC0ee8El75Dv5aOxqZQBScbWpWn0Pe2wb6aM1p4Eea_0G00)

**\*** Some strategies allow the version to be incremented, others don't. More info below
**+** This version is out of context with the rest of the example. It is here just to show what happens if the check is true

## Base Version Strategies
Currently we have the following strategies

- `HighestTagBaseVersionStrategy` - Finds the highest reachable tag from the current branch
- `VersionInBranchBaseVersionStrategy` - Extracts version information from the branch name. eg `release/3.0.0` will find `3.0.0`
- `ConfigNextVersionBaseVersionStrategy` - Returns the version from the GitVersion.yaml file
- `MergeMessageBaseVersionStrategy` - Finds version numbers from merge messages. eg. `Merge 'release/3.0.0' into 'master'` will return `3.0.0`
- `FallbackBaseVersionStrategy` - Always returns 0.1.0 for new repositories

Each strategy needs to return an instance of `BaseVersion` which has the following properties

- `Source` - Description of the source. eg `Merge message 'Merge 'release/3.0.0' into 'master''
- `ShouldIncrement` - Some strategies should have the version incremented, others do not. eg `ConfigNextVersionBaseVersionStrategy` returns false, `HighestTagBaseVersionStrategy` returns true
- `SemanticVersion` - SemVer of the base version strategy
- `BaseVersionSource` - Sha of the source. Commits will be counted from this Sha. Can be null (eg ConfigNextVersionBaseVersionStrategy returns null)
- `BranchNameOverride` - When `useBranchNameAsTag` is used, this allows the branch name to be changed by a base version.
VersionInBranchBaseVersionStrategy uses this to strip out anything before the first - or /. So `foo` ends up being evaluated as `foo`. If in doubt, just use null

# Writing Tests
We have made it super easy to write tests in GitVersion. Most tests you are interested in are in `GitVersionCore.Tests\IntegrationTests`.

There is a scenario class for each type of branch. For example MasterScenarios, FeatureBranchScenarios etc.

## 1. Find Appropriate Scenario class
Find where your issue would logically sit. Or create a new scenario class if it doesn't fit anywhere in particular.

## 2. Create a test method
We are currently using NUnit, so just create a descriptive test method and attribute it with `[Test]`

## 3. Use a fixture
We have a few fixtures for different scenarios.

- `EmptyRepositoryFixture` - Gives you an empty git repo to start with
- `RemoteRepositoryFixture` - A local repo tracking a test remote repository. The remote repo is available through the `Repository` property, the local is accessible via `LocalRepository`
- `BaseGitFlowRepositoryFixture` - A repo setup for GitFlow (has a develop branch checked out ready to go)

You can use a fixture by just `using` it. Like this
``` csharp
using (var fixture = new EmptyRepositoryFixture(new Config()))
{
}
```

## 4. Customise config
If you are using non-default configuration just modify the `Config` class before creating the fixture

## 5. Writing the scenario
We have a number of extension method off `IRepository` to make it easy to write tests at the flow level and not worry about creating/commiting files.

An example test looks like this:
``` csharp
fixture.Repository.MakeATaggedCommit("1.0.0");
fixture.Repository.CreateBranch("feature-test");
fixture.Repository.Checkout("feature-test");
fixture.Repository.MakeACommit();
fixture.Repository.MakeCommits(4);

fixture.AssertFullSemver("1.0.1-test.1+5");
```

The last line is the most important. `AssertFullSemver` will run GitVersion and assert that the full SemVer it calculates is what you expect.

## 6. Submit a pull request with the failing test
Even better include the fix, but a failing test is a great start
21 changes: 5 additions & 16 deletions GitVersion.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.30723.0
# Visual Studio 14
VisualStudioVersion = 14.0.22512.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitVersionExe", "GitVersionExe\GitVersionExe.csproj", "{C3578A7B-09A6-4444-9383-0DEAFA4958BD}"
EndProject
Expand All @@ -13,6 +13,9 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitVersionCore.Tests", "Git
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3EFFC5D6-88D0-49D9-BB53-E1B7EB49DD45}"
ProjectSection(SolutionItems) = preProject
BREAKING CHANGES.md = BREAKING CHANGES.md
CONTRIBUTING.md = CONTRIBUTING.md
GitVersionConfig.yaml = GitVersionConfig.yaml
LICENSE = LICENSE
README.md = README.md
EndProjectSection
Expand All @@ -24,47 +27,33 @@ EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C3578A7B-09A6-4444-9383-0DEAFA4958BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C3578A7B-09A6-4444-9383-0DEAFA4958BD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C3578A7B-09A6-4444-9383-0DEAFA4958BD}.Debug|x86.ActiveCfg = Debug|Any CPU
{C3578A7B-09A6-4444-9383-0DEAFA4958BD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C3578A7B-09A6-4444-9383-0DEAFA4958BD}.Release|Any CPU.Build.0 = Release|Any CPU
{C3578A7B-09A6-4444-9383-0DEAFA4958BD}.Release|x86.ActiveCfg = Release|Any CPU
{5A86453B-96FB-4B6E-A283-225BB9F753D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5A86453B-96FB-4B6E-A283-225BB9F753D3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5A86453B-96FB-4B6E-A283-225BB9F753D3}.Debug|x86.ActiveCfg = Debug|Any CPU
{5A86453B-96FB-4B6E-A283-225BB9F753D3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5A86453B-96FB-4B6E-A283-225BB9F753D3}.Release|Any CPU.Build.0 = Release|Any CPU
{5A86453B-96FB-4B6E-A283-225BB9F753D3}.Release|x86.ActiveCfg = Release|Any CPU
{F7AC0E71-3E9A-4F6D-B986-E004825A48E1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F7AC0E71-3E9A-4F6D-B986-E004825A48E1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F7AC0E71-3E9A-4F6D-B986-E004825A48E1}.Debug|x86.ActiveCfg = Debug|Any CPU
{F7AC0E71-3E9A-4F6D-B986-E004825A48E1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F7AC0E71-3E9A-4F6D-B986-E004825A48E1}.Release|Any CPU.Build.0 = Release|Any CPU
{F7AC0E71-3E9A-4F6D-B986-E004825A48E1}.Release|x86.ActiveCfg = Release|Any CPU
{BF905F84-382C-440D-92F5-C61108626D8D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BF905F84-382C-440D-92F5-C61108626D8D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BF905F84-382C-440D-92F5-C61108626D8D}.Debug|x86.ActiveCfg = Debug|Any CPU
{BF905F84-382C-440D-92F5-C61108626D8D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BF905F84-382C-440D-92F5-C61108626D8D}.Release|Any CPU.Build.0 = Release|Any CPU
{BF905F84-382C-440D-92F5-C61108626D8D}.Release|x86.ActiveCfg = Release|Any CPU
{F9741A0D-B9D7-4557-9A1C-A7252C1071F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F9741A0D-B9D7-4557-9A1C-A7252C1071F5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F9741A0D-B9D7-4557-9A1C-A7252C1071F5}.Debug|x86.ActiveCfg = Debug|Any CPU
{F9741A0D-B9D7-4557-9A1C-A7252C1071F5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F9741A0D-B9D7-4557-9A1C-A7252C1071F5}.Release|Any CPU.Build.0 = Release|Any CPU
{F9741A0D-B9D7-4557-9A1C-A7252C1071F5}.Release|x86.ActiveCfg = Release|Any CPU
{75C2BE85-1DAF-4E34-8305-B17AFAA982A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{75C2BE85-1DAF-4E34-8305-B17AFAA982A6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{75C2BE85-1DAF-4E34-8305-B17AFAA982A6}.Debug|x86.ActiveCfg = Debug|Any CPU
{75C2BE85-1DAF-4E34-8305-B17AFAA982A6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{75C2BE85-1DAF-4E34-8305-B17AFAA982A6}.Release|Any CPU.Build.0 = Release|Any CPU
{75C2BE85-1DAF-4E34-8305-B17AFAA982A6}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
2 changes: 2 additions & 0 deletions GitVersion.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=PossibleMistakenCallToGetType_002E2/@EntryIndexedValue">ERROR</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=PossibleNullReferenceException/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=PrivateFieldCanBeConvertedToLocalVariable/@EntryIndexedValue">ERROR</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantArgumentName/@EntryIndexedValue">DO_NOT_SHOW</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantArgumentNameForLiteralExpression/@EntryIndexedValue">DO_NOT_SHOW</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantAssignment/@EntryIndexedValue">ERROR</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantBaseConstructorCall/@EntryIndexedValue">ERROR</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantBoolCompare/@EntryIndexedValue">ERROR</s:String>
Expand Down
4 changes: 2 additions & 2 deletions GitVersionConfig.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
assembly-versioning-scheme: MajorMinor
next-version: 2.0.1
assembly-versioning-scheme: MajorMinorPatch
next-version: 3.0.0
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ public void BuildNumberIsFullSemVer()

semanticVersion.BuildMetaData.CommitDate = DateTimeOffset.Parse("2014-03-06 23:59:59Z");
semanticVersion.BuildMetaData.Sha = "commitSha";
new BuildServer().WriteIntegration(semanticVersion, writes.Add);
var variables = VariableProvider.GetVariablesFor(semanticVersion, AssemblyVersioningScheme.MajorMinorPatch, VersioningMode.ContinuousDelivery, "ci", false);
new BuildServer().WriteIntegration(writes.Add, variables);

writes[1].ShouldBe("1.2.3-beta.1+5");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
assembly-versioning-scheme: MajorMinorPatch
mode: ContinuousDelivery
tag-prefix: '[vV]'
continuous-delivery-fallback-tag: ci
branches:
master:
tag:
increment: Patch
preventIncrementOfMergedBranchVersion: true
release[/-]:
tag: beta
feature[/-]:
tag: useBranchName
increment: Inherit
hotfix[/-]:
tag: beta
support[/-]:
tag:
increment: Patch
preventIncrementOfMergedBranchVersion: true
develop:
mode: ContinuousDeployment
tag: unstable
increment: Minor
(pull|pull\-requests|pr)[/-]:
tag: PullRequest
increment: Inherit
tagNumberPattern: '[/-](?<number>\d+)[-/]'
89 changes: 78 additions & 11 deletions GitVersionCore.Tests/ConfigProviderTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
using System;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using ApprovalTests;
using GitVersion;
using GitVersion.Helpers;
using NUnit.Framework;
Expand All @@ -25,28 +28,87 @@ public void CanReadDocument()
{
const string text = @"
assembly-versioning-scheme: MajorMinor
develop-branch-tag: alpha
release-branch-tag: rc
next-version: 2.0.0
tag-prefix: '[vV|version-]'
mode: ContinuousDelivery
branches:
develop:
mode: ContinuousDeployment
tag: dev
release[/-]:
mode: continuousDeployment
tag: rc
";
SetupConfigFileContent(text);

var config = ConfigurationProvider.Provide(gitDirectory, fileSystem);
config.AssemblyVersioningScheme.ShouldBe(AssemblyVersioningScheme.MajorMinor);
config.DevelopBranchTag.ShouldBe("alpha");
config.ReleaseBranchTag.ShouldBe("rc");
config.NextVersion.ShouldBe("2.0.0");
config.TagPrefix.ShouldBe("[vV|version-]");
config.VersioningMode.ShouldBe(VersioningMode.ContinuousDelivery);
config.Branches["develop"].Tag.ShouldBe("dev");
config.Branches["release[/-]"].Tag.ShouldBe("rc");
config.Branches["release[/-]"].VersioningMode.ShouldBe(VersioningMode.ContinuousDeployment);
config.Branches["develop"].VersioningMode.ShouldBe(VersioningMode.ContinuousDeployment);
}

[Test]
public void CanReadOldDocument()
{
const string text = @"assemblyVersioningScheme: MajorMinor";
const string text = @"
assemblyVersioningScheme: MajorMinor
develop-branch-tag: alpha
release-branch-tag: rc
";
SetupConfigFileContent(text);
var error = Should.Throw<OldConfigurationException>(() => ConfigurationProvider.Provide(gitDirectory, fileSystem));
error.Message.ShouldContainWithoutWhitespace(@"GitVersionConfig.yaml contains old configuration, please fix the following errors:
assemblyVersioningScheme has been replaced by assembly-versioning-scheme
develop-branch-tag has been replaced by branch specific configuration.See https://github.com/ParticularLabs/GitVersion/wiki/Branch-Specific-Configuration
release-branch-tag has been replaced by branch specific configuration.See https://github.com/ParticularLabs/GitVersion/wiki/Branch-Specific-Configuration");
}

[Test]
public void OverwritesDefaultsWithProvidedConfig()
{
const string text = @"
next-version: 2.0.0
branches:
develop:
mode: ContinuousDeployment
tag: dev";
SetupConfigFileContent(text);
var defaultConfig = new Config();
var config = ConfigurationProvider.Provide(gitDirectory, fileSystem);
config.AssemblyVersioningScheme.ShouldBe(AssemblyVersioningScheme.MajorMinor);

config.NextVersion.ShouldBe("2.0.0");
config.AssemblyVersioningScheme.ShouldBe(defaultConfig.AssemblyVersioningScheme);
config.Branches["develop"].Increment.ShouldBe(defaultConfig.Branches["develop"].Increment);
config.Branches["develop"].VersioningMode.ShouldBe(defaultConfig.Branches["develop"].VersioningMode);
config.Branches["develop"].Tag.ShouldBe("dev");
}

[Test]
public void CanProvideConfigForNewBranch()
{
const string text = @"
next-version: 2.0.0
branches:
bug[/-]:
tag: bugfix";
SetupConfigFileContent(text);
var config = ConfigurationProvider.Provide(gitDirectory, fileSystem);

config.Branches["bug[/-]"].Tag.ShouldBe("bugfix");
}

[Test]
[MethodImpl(MethodImplOptions.NoInlining)]
public void CanWriteOutEffectiveConfiguration()
{
var config = ConfigurationProvider.GetEffectiveConfigAsString(gitDirectory, fileSystem);

Approvals.Verify(config);
}

[Test]
Expand All @@ -56,8 +118,8 @@ public void CanReadDefaultDocument()
SetupConfigFileContent(text);
var config = ConfigurationProvider.Provide(gitDirectory, fileSystem);
config.AssemblyVersioningScheme.ShouldBe(AssemblyVersioningScheme.MajorMinorPatch);
config.DevelopBranchTag.ShouldBe("unstable");
config.ReleaseBranchTag.ShouldBe("beta");
config.Branches["develop"].Tag.ShouldBe("unstable");
config.Branches["release[/-]"].Tag.ShouldBe("beta");
config.TagPrefix.ShouldBe("[vV]");
config.NextVersion.ShouldBe(null);
}
Expand All @@ -66,10 +128,12 @@ public void CanReadDefaultDocument()
public void VerifyInit()
{
var config = typeof(Config);
var aliases = config.GetProperties().Select(p => ((YamlAliasAttribute) p.GetCustomAttribute(typeof(YamlAliasAttribute))).Alias);
var aliases = config.GetProperties()
.Where(p => p.GetCustomAttribute<ObsoleteAttribute>() == null)
.Select(p => ((YamlMemberAttribute) p.GetCustomAttribute(typeof(YamlMemberAttribute))).Alias);
var writer = new StringWriter();

ConfigReader.WriteSample(writer);
ConfigSerialiser.WriteSample(writer);
var initFile = writer.GetStringBuilder().ToString();

foreach (var alias in aliases)
Expand All @@ -82,7 +146,10 @@ public void VerifyInit()
public void VerifyAliases()
{
var config = typeof(Config);
var propertiesMissingAlias = config.GetProperties().Where(p => p.GetCustomAttribute(typeof(YamlAliasAttribute)) == null).Select(p => p.Name);
var propertiesMissingAlias = config.GetProperties()
.Where(p => p.GetCustomAttribute<ObsoleteAttribute>() == null)
.Where(p => p.GetCustomAttribute(typeof(YamlMemberAttribute)) == null)
.Select(p => p.Name);

propertiesMissingAlias.ShouldBeEmpty();
}
Expand Down
Loading