diff --git a/.semver.txt b/.semver.txt index 4bf1778..9972f12 100644 --- a/.semver.txt +++ b/.semver.txt @@ -1 +1 @@ -1.0.60 +1.0.61 diff --git a/src/JiraTimeBot/JiraIntegration/JiraCommitEmulator.cs b/src/JiraTimeBot/JiraIntegration/JiraCommitEmulator.cs index 5a51b52..32e6b02 100644 --- a/src/JiraTimeBot/JiraIntegration/JiraCommitEmulator.cs +++ b/src/JiraTimeBot/JiraIntegration/JiraCommitEmulator.cs @@ -48,9 +48,10 @@ namespace JiraTimeBot.JiraIntegration { var item = new TaskTimeItem(issue.Key.Value, issue.Summary, - 1, - TimeSpan.Zero, + issue.Project, issue.Updated.GetValueOrDefault(date.Value), + TimeSpan.Zero, + 1, 1, CommitType.Task); workTasks.Add(item); @@ -60,9 +61,10 @@ namespace JiraTimeBot.JiraIntegration { var item = new TaskTimeItem(issue.Key.Value, issue.Summary, - 1, - TimeSpan.Zero, + issue.Project, issue.Updated.GetValueOrDefault(date.Value), + TimeSpan.Zero, + 1, 1, CommitType.Task); workTasks.Add(item); diff --git a/src/JiraTimeBot/Mercurial/MercurialLog.cs b/src/JiraTimeBot/Mercurial/MercurialLog.cs index 2bdc3f7..526e927 100644 --- a/src/JiraTimeBot/Mercurial/MercurialLog.cs +++ b/src/JiraTimeBot/Mercurial/MercurialLog.cs @@ -48,6 +48,8 @@ namespace JiraTimeBot.Mercurial continue; } + var directoryInfo = new DirectoryInfo(repoDirectory); + var repo = new Repository(repoDirectory); var logCommand = new LogCommand { @@ -74,9 +76,10 @@ namespace JiraTimeBot.Mercurial var task = new TaskTimeItem(changeset.Branch, commitMessage, - 1, - TimeSpan.Zero, + directoryInfo.Name, changeset.Timestamp, + TimeSpan.Zero, + 1, changeset.PathActions.Count, GetCommitType(changeset.Branch)); @@ -91,7 +94,7 @@ namespace JiraTimeBot.Mercurial var release = task.Branch.Replace("release", ""); task.Branch = branch; - task.Description = $"Подготовка и публикация версии {release}."; + task.Description = $"Подготовка и публикация версии {task.Project} {release}."; } workTasks.Add(task); _log?.Trace($" - Найден changeset: {changeset.Timestamp} - {changeset.Branch} - {changeset.AuthorEmailAddress} - {commitMessage}"); diff --git a/src/JiraTimeBot/Properties/AssemblyInfo.cs b/src/JiraTimeBot/Properties/AssemblyInfo.cs index c4e501d..5b6dc8b 100644 --- a/src/JiraTimeBot/Properties/AssemblyInfo.cs +++ b/src/JiraTimeBot/Properties/AssemblyInfo.cs @@ -1,31 +1,31 @@ -using System.Reflection; -using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("JiraTimeBot")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("JiraTimeBot")] -[assembly: AssemblyCopyright("Copyright © 2019")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("f3b89316-c38c-4ce6-9d88-0b1373cfba1a")] -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.60")] -[assembly: AssemblyFileVersion("1.0.60")] -[assembly: AssemblyInformationalVersion("1.0.60")] +using System.Reflection; +using System.Runtime.InteropServices; +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("JiraTimeBot")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("JiraTimeBot")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("f3b89316-c38c-4ce6-9d88-0b1373cfba1a")] +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("1.0.61")] +[assembly: AssemblyFileVersion("1.0.61")] +[assembly: AssemblyInformationalVersion("1.0.61")] diff --git a/src/JiraTimeBot/TaskTime/Objects/TaskTimeItem.cs b/src/JiraTimeBot/TaskTime/Objects/TaskTimeItem.cs index ef3e627..88c960d 100644 --- a/src/JiraTimeBot/TaskTime/Objects/TaskTimeItem.cs +++ b/src/JiraTimeBot/TaskTime/Objects/TaskTimeItem.cs @@ -11,12 +11,14 @@ namespace JiraTimeBot.TaskTime.Objects public int Commits { get; set; } public int FilesAffected { get; set; } public CommitType Type { get; set; } + public string Project { get; set; } - public TaskTimeItem(string branch, string description, int commits, TimeSpan timeSpent, DateTime startTime, - int filesAffected, CommitType type) + public TaskTimeItem(string branch, string description, string project, DateTime startTime, TimeSpan timeSpent, int commits, + int filesAffected = 1, CommitType type = CommitType.Task) { Branch = branch; Description = description; + Project = project; Commits = commits; TimeSpent = timeSpent; StartTime = startTime; diff --git a/src/JiraTimeBot/TaskTime/TaskTimeByCommitsCalculator.cs b/src/JiraTimeBot/TaskTime/TaskTimeByCommitsCalculator.cs index 341fdb3..4796683 100644 --- a/src/JiraTimeBot/TaskTime/TaskTimeByCommitsCalculator.cs +++ b/src/JiraTimeBot/TaskTime/TaskTimeByCommitsCalculator.cs @@ -95,9 +95,10 @@ namespace JiraTimeBot.TaskTime { return new TaskTimeItem(timeControlTask, "Ведение учета времени", - 1, - TimeSpan.FromMinutes(minutes), + "Service", DateTime.Now, + TimeSpan.FromMinutes(minutes), + 1, 1, CommitType.Task); } diff --git a/src/JiraTimeBot/TaskTime/TaskTimeSpread.cs b/src/JiraTimeBot/TaskTime/TaskTimeSpread.cs index bad79c1..d1b762f 100644 --- a/src/JiraTimeBot/TaskTime/TaskTimeSpread.cs +++ b/src/JiraTimeBot/TaskTime/TaskTimeSpread.cs @@ -43,9 +43,10 @@ namespace JiraTimeBot.TaskTime var taskTimeItem = new TaskTimeItem( taskGroup.Key, sb.ToString(), - taskGroup.Sum(f => f.Commits), - timeSpent, + taskGroup.First().Project, taskGroup.Min(f => f.StartTime), + timeSpent, + taskGroup.Sum(f => f.Commits), taskGroup.Sum(f => f.FilesAffected), taskGroup.First().Type);