{"action":"created","issue":{"url":"https://api.github.com/repos/GitTools/GitVersion/issues/1356","repository_url":"https://api.github.com/repos/GitTools/GitVersion","labels_url":"https://api.github.com/repos/GitTools/GitVersion/issues/1356/labels{/name}","comments_url":"https://api.github.com/repos/GitTools/GitVersion/issues/1356/comments","events_url":"https://api.github.com/repos/GitTools/GitVersion/issues/1356/events","html_url":"https://github.com/GitTools/GitVersion/issues/1356","id":288983246,"number":1356,"title":"\"Mainline development mode doesn't yet support pre-release tags on master\"","user":{"login":"Kieranties","id":351423,"avatar_url":"https://avatars1.githubusercontent.com/u/351423?v=4","gravatar_id":"","url":"https://api.github.com/users/Kieranties","html_url":"https://github.com/Kieranties","followers_url":"https://api.github.com/users/Kieranties/followers","following_url":"https://api.github.com/users/Kieranties/following{/other_user}","gists_url":"https://api.github.com/users/Kieranties/gists{/gist_id}","starred_url":"https://api.github.com/users/Kieranties/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kieranties/subscriptions","organizations_url":"https://api.github.com/users/Kieranties/orgs","repos_url":"https://api.github.com/users/Kieranties/repos","events_url":"https://api.github.com/users/Kieranties/events{/privacy}","received_events_url":"https://api.github.com/users/Kieranties/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-01-16T17:03:44Z","updated_at":"2018-03-22T22:46:22Z","closed_at":null,"author_association":"NONE","body":"## Brief\r\n\r\nI'm using the [beta 13 release](https://github.com/GitTools/GitVersion/releases/tag/v4.0.0-beta.13) with `mainline` mode enabled for the repository.\r\nMy configuration sets up a `preview` branch which is designed to build as pre-release and is tagged by the build server with pre-release tags. (I know this sounds like the default release branch configuration, but bear with me. I'm having to name things with current internal naming conventions.)\r\n\r\n```yaml\r\nmode: Mainline\r\ntag-prefix: 'build\\/'\r\nlegacy-semver-padding: 5\r\nbuild-metadata-padding: 5\r\ncommits-since-version-source-padding: 5\r\nbranches:\r\n  preview:\r\n    mode: ContinuousDeployment\r\n    regex: preview[/-]\r\n    tag: useBranchName\r\n    source-branches: ['master', 'preview', 'release']\r\n```\r\n\r\n## Scenario\r\n1. The preview branch has built previously and has been tagged with a pre-release tag\r\n2. A developer creates a feature branch from the tagged commit on the preview branch.\r\n3. A pull request is raised to merge the feature branch back to the preview branch\r\n\r\n### Expected\r\n\r\nThe pull-request is able to be versioned to enable the PR build to execute.\r\n\r\n### Actual\r\n\r\nAn error is thrown:\r\n\r\n```\r\nERROR [01/16/18 16:39:07:53] An unexpected error occurred:\r\nSystem.NotSupportedException: Mainline development mode doesn't yet support pre-release tags on master\r\n   at GitVersion.VersionCalculation.MainlineVersionCalculator.FindMainlineModeVersion(BaseVersion baseVersion, GitVersionContext context)\r\n   at GitVersion.VersionCalculation.NextVersionCalculator.FindVersion(GitVersionContext context)\r\n   at GitVersion.GitVersionFinder.FindVersion(GitVersionContext context)\r\n   at GitVersion.ExecuteCore.<>c__DisplayClass6_0.<ExecuteInternal>b__0(IRepository repo)\r\n   at GitVersion.GitPreparer.WithRepository[TResult](Func`2 action)\r\n   at GitVersion.ExecuteCore.ExecuteGitVersion(String targetUrl, String dynamicRepositoryLocation, Authentication authentication, String targetBranch,\r\nBoolean noFetch, String workingDirectory, String commitId, Config overrideConfig, Boolean noCache)\r\n   at GitVersion.SpecifiedArgumentRunner.Run(Arguments arguments, IFileSystem fileSystem)\r\n   at GitVersion.Program.VerifyArgumentsAndRun()\r\n```\r\n\r\n## Additonal\r\n\r\nI can see that this is an explicit decision in the code base, but I'd like to understand why. \r\nI had hoped that setting `mode: ContinuousDeployment` for the preview branch would have forced commits into the branch to always increment the pre-release version, but it seems mainline mode still affects the counts  in the branch. "},"comment":{"url":"https://api.github.com/repos/GitTools/GitVersion/issues/comments/375482171","html_url":"https://github.com/GitTools/GitVersion/issues/1356#issuecomment-375482171","issue_url":"https://api.github.com/repos/GitTools/GitVersion/issues/1356","id":375482171,"user":{"login":"asbjornu","id":12283,"avatar_url":"https://avatars0.githubusercontent.com/u/12283?v=4","gravatar_id":"","url":"https://api.github.com/users/asbjornu","html_url":"https://github.com/asbjornu","followers_url":"https://api.github.com/users/asbjornu/followers","following_url":"https://api.github.com/users/asbjornu/following{/other_user}","gists_url":"https://api.github.com/users/asbjornu/gists{/gist_id}","starred_url":"https://api.github.com/users/asbjornu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asbjornu/subscriptions","organizations_url":"https://api.github.com/users/asbjornu/orgs","repos_url":"https://api.github.com/users/asbjornu/repos","events_url":"https://api.github.com/users/asbjornu/events{/privacy}","received_events_url":"https://api.github.com/users/asbjornu/received_events","type":"User","site_admin":false},"created_at":"2018-03-22T22:46:22Z","updated_at":"2018-03-22T22:46:22Z","author_association":"OWNER","body":"If overriding `mode` in a branch doesn't work, that sounds like a bug. If you're already poking around in the source code, would you mind submitting a pull request addressing that?"}}
{"actor":{"display_login":"asbjornu"}}