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
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void SingleSource_SourceDeserialized()
{
new ApplicationSource()
{
RepoUrl = new Uri("https://github.com/fake/octopus-test.git"),
OriginalRepoUrl = "https://github.com/fake/octopus-test.git",
TargetRevision = "test-branch",
Path = "octopus-app"
}
Expand Down Expand Up @@ -109,13 +109,13 @@ public void TwoSources_SourcesDeserialized()
{
new ApplicationSource()
{
RepoUrl = new Uri("https://github.com/fake/octopus-test.git"),
OriginalRepoUrl = "https://github.com/fake/octopus-test.git",
TargetRevision = "test-branch",
Path = "octopus-app"
},
new ApplicationSource()
{
RepoUrl = new Uri("https://github.com/fake/octopus-test2.git"),
OriginalRepoUrl = "https://github.com/fake/octopus-test2.git",
TargetRevision = "test-branch2",
Path = "octopus-app2"
}
Expand Down Expand Up @@ -166,7 +166,7 @@ public void NoSourceType_SourceTypesIsEmpty()
{
new ApplicationSource()
{
RepoUrl = new Uri("https://github.com/fake/octopus-test.git"),
OriginalRepoUrl = "https://github.com/fake/octopus-test.git",
TargetRevision = "test-branch",
Path = "octopus-app"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public void Init()
{
new ApplicationSource()
{
RepoUrl = new Uri(OriginPath),
OriginalRepoUrl = OriginPath,
Path = "files",
TargetRevision = argoCDBranchName.Value,
Helm = new HelmConfig()
Expand Down Expand Up @@ -166,7 +166,7 @@ public void HelmSource_NoPath_DontUpdate()
})
.WithSource(new ApplicationSource
{
RepoUrl = new Uri(OriginPath),
OriginalRepoUrl = OriginPath,
TargetRevision = ArgoCDBranchFriendlyName
},
SourceTypeConstants.Helm)
Expand Down Expand Up @@ -350,7 +350,7 @@ public void SingleSourceWithWrongScoping_DontUpdate()
{
new ApplicationSource()
{
RepoUrl = new Uri(OriginPath),
OriginalRepoUrl = OriginPath,
Path = "files",
TargetRevision = argoCDBranchName.Value,
Name = "wrong-scoping",
Expand Down Expand Up @@ -428,7 +428,7 @@ public void RefSourceWithWrongScoping_DontUpdate()
{
new ApplicationSource()
{
RepoUrl = new Uri("https://github.com/doesnt/exist.git"),
OriginalRepoUrl = "https://github.com/doesnt/exist.git",
Path = "files",
Helm = new HelmConfig()
{
Expand All @@ -441,7 +441,7 @@ public void RefSourceWithWrongScoping_DontUpdate()
},
new ApplicationSource()
{
RepoUrl = new Uri(OriginPath),
OriginalRepoUrl = OriginPath,
TargetRevision = argoCDBranchName.Value,
Ref = "values",
}
Expand Down Expand Up @@ -517,7 +517,7 @@ public void HelmSourceWithExplicitValuesFile_MissingImagePath_WarnAndDontUpdate(
{
new ApplicationSource()
{
RepoUrl = new Uri(OriginPath),
OriginalRepoUrl = OriginPath,
TargetRevision = argoCDBranchName.Value,
Path = "files",
Helm = new HelmConfig()
Expand Down Expand Up @@ -603,7 +603,7 @@ public void HelmSourceWithImplicitValuesFile_MissingImagePath_WarnAndDontUpdate(
{
new ApplicationSource()
{
RepoUrl = new Uri(OriginPath),
OriginalRepoUrl = OriginPath,
TargetRevision = argoCDBranchName.Value,
Path = "files",
Name = "helm-source",
Expand Down Expand Up @@ -682,7 +682,7 @@ public void RefSourceWithMissingImagePath_WarnAndDontUpdate()
{
new ApplicationSource()
{
RepoUrl = new Uri("https://github.com/doesnt/exist.git"),
OriginalRepoUrl = "https://github.com/doesnt/exist.git",
Path = "files",
Helm = new HelmConfig()
{
Expand All @@ -694,7 +694,7 @@ public void RefSourceWithMissingImagePath_WarnAndDontUpdate()
},
new ApplicationSource()
{
RepoUrl = new Uri(OriginPath),
OriginalRepoUrl = OriginPath,
TargetRevision = argoCDBranchName.Value,
Ref = "values",
Name = "ref-source",
Expand Down Expand Up @@ -773,7 +773,7 @@ public void RefSourceWithMissingImagePathIfRefSourceNotInScope_DontWarnAndDontUp
{
new ApplicationSource()
{
RepoUrl = new Uri("https://github.com/doesnt/exist.git"),
OriginalRepoUrl = "https://github.com/doesnt/exist.git",
Path = "files",
Helm = new HelmConfig()
{
Expand All @@ -785,7 +785,7 @@ public void RefSourceWithMissingImagePathIfRefSourceNotInScope_DontWarnAndDontUp
},
new ApplicationSource()
{
RepoUrl = new Uri(OriginPath),
OriginalRepoUrl = OriginPath,
TargetRevision = argoCDBranchName.Value,
Ref = "values",
}
Expand Down Expand Up @@ -890,7 +890,7 @@ public void HelmSourceWithHelmConfigurationAndImplicitValuesFile_IncludeValuesFi
})
.WithSource(new ApplicationSource
{
RepoUrl = new Uri(OriginPath),
OriginalRepoUrl = OriginPath,
Path = "",
TargetRevision = ArgoCDBranchFriendlyName,
Helm = new HelmConfig()
Expand Down Expand Up @@ -980,7 +980,7 @@ public void HelmSourceWithHelmConfigurationAndNoImplicitValuesFile_ExcludeValues
})
.WithSource(new ApplicationSource
{
RepoUrl = new Uri(OriginPath),
OriginalRepoUrl = OriginPath,
Path = "",
TargetRevision = ArgoCDBranchFriendlyName,
Helm = new HelmConfig()
Expand Down Expand Up @@ -1071,7 +1071,7 @@ public void HelmSourceWithHelmConfigurationIncludesImplicitValuesFile_IncludeVal
})
.WithSource(new ApplicationSource
{
RepoUrl = new Uri(OriginPath),
OriginalRepoUrl = OriginPath,
Path = "",
TargetRevision = ArgoCDBranchFriendlyName,
Helm = new HelmConfig()
Expand Down Expand Up @@ -1164,7 +1164,7 @@ public void HelmSourceWithImplicitValuesFile_Update()
})
.WithSource(new ApplicationSource
{
RepoUrl = new Uri(OriginPath),
OriginalRepoUrl = OriginPath,
Path = "",
TargetRevision = ArgoCDBranchFriendlyName
},
Expand Down Expand Up @@ -1243,7 +1243,7 @@ public void RefSourceWithHelmImageMatches_Update()
})
.WithSource(new ApplicationSource
{
RepoUrl = new Uri("https://github.com/org/repo"),
OriginalRepoUrl = "https://github.com/org/repo",
Path = "",
TargetRevision = ArgoCDBranchFriendlyName,
Helm = new HelmConfig
Expand All @@ -1261,7 +1261,7 @@ public void RefSourceWithHelmImageMatches_Update()
Name = "ref-source",
Ref = "values",
TargetRevision = ArgoCDBranchFriendlyName,
RepoUrl = new Uri(OriginPath),
OriginalRepoUrl = OriginPath,
},
SourceTypeConstants.Directory)
.Build();
Expand Down Expand Up @@ -1364,7 +1364,7 @@ public void RefSourceWithHelmImageMatchesAndPath_IgnoresFilesUnderPath()
})
.WithSource(new ApplicationSource
{
RepoUrl = new Uri("https://github.com/org/repo"),
OriginalRepoUrl = "https://github.com/org/repo",
Path = "",
TargetRevision = ArgoCDBranchFriendlyName,
Helm = new HelmConfig
Expand All @@ -1383,7 +1383,7 @@ public void RefSourceWithHelmImageMatchesAndPath_IgnoresFilesUnderPath()
Ref = "values",
Path = "include/",
TargetRevision = ArgoCDBranchFriendlyName,
RepoUrl = new Uri(OriginPath),
OriginalRepoUrl = OriginPath,
},
SourceTypeConstants.Directory)
.Build();
Expand Down Expand Up @@ -1427,7 +1427,7 @@ void AssertOutputVariables(bool updated = true, string matchingApplicationTotalS
using var _ = new AssertionScope();
var serviceMessages = log.Messages.GetServiceMessagesOfType("setVariable");
serviceMessages.GetPropertyValue("ArgoCD.GatewayIds").Should().Be(GatewayId);
serviceMessages.GetPropertyValue("ArgoCD.GitUris").Should().Be(updated ? new Uri(OriginPath).AbsoluteUri : string.Empty);
serviceMessages.GetPropertyValue("ArgoCD.GitUris").Should().Be(updated ? OriginPath : string.Empty);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the changes, we are expecting to echo out the actual original repo urls, not a converted one.

serviceMessages.GetPropertyValue("ArgoCD.UpdatedImages").Should().Be(updated ? updatedImages.ToString() : "0");
serviceMessages.GetPropertyValue("ArgoCD.MatchingApplications").Should().Be("App1");
serviceMessages.GetPropertyValue("ArgoCD.MatchingApplicationTotalSourceCounts").Should().Be(matchingApplicationTotalSourceCounts);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public void Init()
})
.WithSource(new ApplicationSource()
{
RepoUrl = new Uri(OriginPath),
OriginalRepoUrl = OriginPath,
Path = "",
TargetRevision = ArgoCDBranchFriendlyName,
}, SourceTypeConstants.Directory)
Expand Down Expand Up @@ -138,7 +138,7 @@ public void PluginSourceType_DontUpdate()
})
.WithSource(new ApplicationSource()
{
RepoUrl = new Uri(OriginPath),
OriginalRepoUrl = OriginPath,
Path = "",
TargetRevision = ArgoCDBranchFriendlyName,
}, SourceTypeConstants.Plugin)
Expand Down Expand Up @@ -381,7 +381,7 @@ public void DirectorySource_NoPath_DontUpdate()
})
.WithSource(new ApplicationSource()
{
RepoUrl = new Uri(OriginPath),
OriginalRepoUrl = OriginPath,
TargetRevision = ArgoCDBranchFriendlyName,
}, SourceTypeConstants.Directory)
.Build();
Expand Down Expand Up @@ -446,7 +446,7 @@ public void KustomizeSource_NoPath_DontUpdate()
})
.WithSource(new ApplicationSource()
{
RepoUrl = new Uri(OriginPath),
OriginalRepoUrl = OriginPath,
TargetRevision = ArgoCDBranchFriendlyName,
}, SourceTypeConstants.Kustomize)
.Build();
Expand Down Expand Up @@ -511,7 +511,7 @@ public void KustomizeSource_HasKustomizationFile_Update()
})
.WithSource(new ApplicationSource()
{
RepoUrl = new Uri(OriginPath),
OriginalRepoUrl = OriginPath,
Path = "",
TargetRevision = ArgoCDBranchFriendlyName,
}, SourceTypeConstants.Kustomize)
Expand Down Expand Up @@ -599,7 +599,7 @@ public void KustomizeSource_NoKustomizationFile_DontUpdate()
})
.WithSource(new ApplicationSource()
{
RepoUrl = new Uri(OriginPath),
OriginalRepoUrl = OriginPath,
Path = "",
TargetRevision = ArgoCDBranchFriendlyName,
}, SourceTypeConstants.Kustomize)
Expand Down Expand Up @@ -634,7 +634,7 @@ void AssertOutputVariables(bool updated = true, string matchingApplicationTotalS
using var _ = new AssertionScope();
var serviceMessages = log.Messages.GetServiceMessagesOfType("setVariable");
serviceMessages.GetPropertyValue("ArgoCD.GatewayIds").Should().Be(GatewayId);
serviceMessages.GetPropertyValue("ArgoCD.GitUris").Should().Be(updated ? new Uri(OriginPath).AbsoluteUri : string.Empty);
serviceMessages.GetPropertyValue("ArgoCD.GitUris").Should().Be(updated ? OriginPath : string.Empty);
serviceMessages.GetPropertyValue("ArgoCD.UpdatedImages").Should().Be(updated ? "1" : "0");
serviceMessages.GetPropertyValue("ArgoCD.MatchingApplications").Should().Be("App1");
serviceMessages.GetPropertyValue("ArgoCD.MatchingApplicationTotalSourceCounts").Should().Be(matchingApplicationTotalSourceCounts);
Expand Down
Loading