Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5ed6ab2f69 | |||
| 470b3d93de | |||
| b9059e1b85 | |||
| 3694e5703c | |||
| 80189e2414 |
@@ -122,8 +122,19 @@ static class AutomateFunction
|
|||||||
bool changed = !Equals(entry.Value, releaseObjectPropDict[entry.Key]);
|
bool changed = !Equals(entry.Value, releaseObjectPropDict[entry.Key]);
|
||||||
if (changed)
|
if (changed)
|
||||||
{
|
{
|
||||||
string diff =
|
object? releaseValue = releaseObjectPropDict[entry.Key];
|
||||||
$"Property ({entry.Key}) changed from ({releaseObjectPropDict[entry.Key]}) to ({entry.Value})";
|
object? testValue = entry.Value;
|
||||||
|
string diff = $"Property ({entry.Key}) changed";
|
||||||
|
if (
|
||||||
|
releaseValue is not null
|
||||||
|
&& testValue is not null
|
||||||
|
&& !releaseValue.GetType().Equals(testValue.GetType())
|
||||||
|
)
|
||||||
|
{
|
||||||
|
diff +=
|
||||||
|
$" from ({releaseObjectPropDict[entry.Key]}) to ({entry.Value})";
|
||||||
|
}
|
||||||
|
|
||||||
if (!diffDictionary.ContainsKey(entry.Key))
|
if (!diffDictionary.ContainsKey(entry.Key))
|
||||||
{
|
{
|
||||||
diffDictionary.Add(entry.Key, diff);
|
diffDictionary.Add(entry.Key, diff);
|
||||||
@@ -175,10 +186,14 @@ static class AutomateFunction
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//automationContext.AttachInfoToObjects(ADDED, new List<string>() { testObject.id });
|
// we're skipping objects without an applicationId for now, since we're doing so in the release commit
|
||||||
addedList.Add(
|
if (!string.IsNullOrEmpty(testObject.applicationId))
|
||||||
new Tuple<string, string>(testObject.id, testObject.speckle_type)
|
{
|
||||||
);
|
//automationContext.AttachInfoToObjects(ADDED, new List<string>() { testObject.id });
|
||||||
|
addedList.Add(
|
||||||
|
new Tuple<string, string>(testObject.id, testObject.speckle_type)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -193,7 +208,7 @@ static class AutomateFunction
|
|||||||
if (addedList.Count + deletedList.Count + modifiedList.Count > 0)
|
if (addedList.Count + deletedList.Count + modifiedList.Count > 0)
|
||||||
{
|
{
|
||||||
automationContext.MarkRunFailed(
|
automationContext.MarkRunFailed(
|
||||||
$"Run failed due to {addedList.Count} ADDED, {modifiedList.Count} MODIFIED, and {deletedList.Count} DELETED objects compared to the release commit."
|
$"Run failed due to {addedList.Count} ADDED, {modifiedList.Count} MODIFIED, and {deletedList.Count} DELETED objects compared to the release commit ({unchangedCount} objects were unchanged)."
|
||||||
);
|
);
|
||||||
|
|
||||||
addedList.ForEach(
|
addedList.ForEach(
|
||||||
@@ -208,6 +223,11 @@ static class AutomateFunction
|
|||||||
$"MODIFIED object: id( {o.Item1} ), type( {o.Item2} ), changed props:( {o.Item3} )"
|
$"MODIFIED object: id( {o.Item1} ), type( {o.Item2} ), changed props:( {o.Item3} )"
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
automationContext.AttachWarningToObjects(
|
||||||
|
MODIFIED,
|
||||||
|
modifiedList.Select(o => o.Item1).ToList()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user