Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ If you go this route, remember add the `--resourceGroup` to all commands requiri

Download and unzip the latest CLI.zip file from [Releases](https://github.com/tfsaggregator/aggregator-cli/releases).
It requires [.Net Core 2.1](https://www.microsoft.com/net/download) installed on the machine.
To run Aggregator use `dotnet aggregator-cli.dll` followed by a verb and its options.
To run Aggregator run `aggregator-cli` or `dotnet aggregator-cli.dll` followed by a verb and its options.

### Verbs

Expand Down
2 changes: 1 addition & 1 deletion doc/command-examples.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Sample Aggregator CLI usage

In the following you will find many sample usage of Aggregator CLI commands.
Run `dotnet aggregator-cli.dll` followed by the command and any option.
Run `aggregator-cli` or `dotnet aggregator-cli.dll` followed by the command and any option.
All commands accept the `--verbose` option to print additional messages, useful in troubleshooting.


Expand Down
17 changes: 17 additions & 0 deletions src/aggregator-cli/aggregator-cli.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@echo off
REM Search if .Net Core installed
where /Q dotnet
IF %ERRORLEVEL% NEQ 0 (
echo .Net Core Runtime is missing, please install from https://dotnet.microsoft.com/download
goto bye
)
REM Check .Net Core version
FOR /f "delims=-" %%i IN ('dotnet --version') DO SET _DOTNETVER=%%i
IF q%_DOTNETVER:2.1=%==q%_DOTNETVER% (
echo Another version of .Net Core Runtime is installed, please install version 2.1 from https://dotnet.microsoft.com/download
goto bye
)
REM All good run aggregator forwarding any parameter
dotnet %~dp0aggregator-cli.dll %*

:bye
3 changes: 3 additions & 0 deletions src/aggregator-cli/aggregator-cli.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
</ItemGroup>

<ItemGroup>
<None Update="aggregator-cli.cmd">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="function-bin.zip">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand Down
9 changes: 9 additions & 0 deletions src/aggregator-cli/test/test5.rule
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.language=Csharp

if (self.Description.EndsWith(".")) {
self.Description = self.Description.TrimEnd('.');
return ".";
} else {
return "no .";
}

14 changes: 12 additions & 2 deletions src/aggregator-ruleng/Tracker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,25 @@ internal IList<WorkItemWrapper> LoadWorkItems(
.Select(id => new PermanentWorkItemId(id))
.GroupBy(k => tracked.ContainsKey(k))
.ToDictionary(g => g.Key, g => g.ToList());
// groups[true] is the set of IDs already tracked
// groups[false] is the set of new IDs

var inMemory = tracked
.Where(w => groups.ContainsKey(true)
? groups[true].Contains(w.Key)
: false)
.Select(w => w.Value.Current);
var loaded = loader(groups[false].Select(k => k.Value));

return inMemory.Union(loaded).ToList();
if (groups.ContainsKey(false))
{
var loaded = loader(groups[false].Select(k => k.Value));

return inMemory.Union(loaded).ToList();
}
else
{
return inMemory.ToList();
}
}

internal bool IsTracked(WorkItemWrapper workItemWrapper)
Expand Down