tfsaggregator / aggregator-cli

A new version of Aggregator aiming at Azure DevOps (ex Visual Studio Team Services)
https://tfsaggregator.github.io/
Apache License 2.0
74 stars 32 forks source link

Instance names containing capital letters break mapping listing #127

Closed sobjornstad closed 4 years ago

sobjornstad commented 4 years ago

Steps to reproduce

The rule used is unlikely to be relevant, but here's a hello-world rule exhibiting the behavior, just in case:

.lang=C#

var appliesToWorkItemTypes = new[] {"Task", "Bug", "Milestone"};
if (!appliesToWorkItemTypes.Contains(self.WorkItemType))
{
    return $"Work item type was {self.WorkItemType}, so this rule will not be considered.";
}

var parent = self.Parent;
if (parent == null)
{
    return $"Work item has no parent, so this rule will not be considered.";
}

var children = parent.Children;
if (children.All(c => c.State == "Closed"))
{
    parent.State = "Closed";
    return "Parent was closed";
}
else
{
    return "Parent was not closed";
}
  1. Install an instance with a name containing uppercase letters, e.g., MyTfsAggregator.
  2. Install a rule to that instance (such as the one above) and map it.
  3. Attempt a list.mappings --instance MyTfsAggregator.

Expected behavior

The mapping I just created will be listed.

Actual behavior

[2020-05-27 13:28:59Z] aggregator-cli v0.9.10 (build: 0.9.10.0 Release) (c) Copyright © TFS Aggregator Team
[2020-05-27 13:29:00Z] Connected to dev.azure.com
[2020-05-27 13:29:01Z] No rule mappings found.
[2020-05-27 13:29:01Z] Succeeded

Suspected cause

It appears that Aggregator lowercases the name as it creates resources when installing the instance, along with appending aggregator, so the stored reference is to mytfsaggregatoraggregator. When calling list.mappings, this lowercasing step is not carried out, causing the same input value to refer to something else.

Simply referring to mytfsaggregator rather than the MyTfsAggregator provided earlier in the install.instance command line is sufficient to make the mappings show up.

Environment

Aggregator v0.9.10, launched through Windows PowerShell 5.1. Windows 10 1809 (Build 17763.1217).

giuliov commented 4 years ago

Fix merged with PR #144

sobjornstad commented 4 years ago

Thanks!

On Tue, Jul 21, 2020, at 12:09, Giulio Vian wrote:

Fix merged with PR #144 https://github.com/tfsaggregator/aggregator-cli/pull/144

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tfsaggregator/aggregator-cli/issues/127#issuecomment-661988379, or unsubscribe https://github.com/notifications/unsubscribe-auth/AARUZRQPBOSHL4QVORDBZGTR4XDUNANCNFSM4NMMVLZQ.

giuliov commented 4 years ago

fixed in 0.9.14