60 writes to Repository
aspire (4)
Configuration\ConfigSourceService.cs (4)
166
Repository
= repository!,
248
Repository
= source.Repository,
447
Repository
= source.Repository,
539
Repository
= source.Repository,
Aspire.Cli.Tests (56)
Backchannel\AppHostConnectionResolverTests.cs (1)
29
Repository
= "https://git.example/configuration",
Commands\AgentInitCommandTests.cs (1)
265
new ConfigSource {
Repository
= "https://git.example/configuration", Path = "aspire.config.json", AppliedVersion = "version-1" },
Commands\ConfigSourceCommandTests.cs (7)
29
Repository
= "https://git.example/configuration",
305
Repository
= s_source.Repository,
489
new ConfigSource {
Repository
= "https://parent.example/configuration", Path = "parent.json", AppliedVersion = "parent-version" },
570
var selectedSource = new ConfigSource {
Repository
= s_source.Repository, Path = "selected.json", AppliedVersion = s_source.AppliedVersion };
657
var selectedSource = new ConfigSource {
Repository
= s_source.Repository, Path = "selected.json", AppliedVersion = s_source.AppliedVersion };
699
Repository
= "https://selected.example/configuration",
901
Repository
= "https://solution.example/configuration",
Configuration\ConfigSourceServiceGitTests.cs (18)
49
var source = new ConfigSource {
Repository
= workspace.Path, Path = AspireConfigFile.FileName };
90
var source = new ConfigSource {
Repository
= workspace.Path, Path = AspireConfigFile.FileName };
143
var source = new ConfigSource {
Repository
= workspace.Path, Path = AspireConfigFile.FileName };
172
Repository
= source.Repository,
384
var source = new ConfigSource {
Repository
= workspace.Path, Path = path };
408
var source = new ConfigSource {
Repository
= repository.FullName, Path = path };
436
var source = new ConfigSource {
Repository
= workspace.Path, Path = AspireConfigFile.FileName };
468
new() {
Repository
= workspace.Path, Path = AspireConfigFile.FileName },
499
new() {
Repository
= workspace.Path, Path = AspireConfigFile.FileName }, workspace.CreateDirectory("cache").FullName, TestContext.Current.CancellationToken));
509
new() {
Repository
= workspace.Path, Path = AspireConfigFile.FileName }, workspace.CreateDirectory("cache").FullName, TestContext.Current.CancellationToken));
523
var source = new ConfigSource {
Repository
= workspace.Path, Path = AspireConfigFile.FileName };
554
new() {
Repository
= workspace.Path, Path = AspireConfigFile.FileName, Ref = reference },
572
new() {
Repository
= workspace.Path, Path = AspireConfigFile.FileName, Ref = expectedCommit },
584
var source = new ConfigSource {
Repository
= workspace.Path, Path = AspireConfigFile.FileName };
604
var pinned = await client.CheckAsync(new() {
Repository
= source.Repository, Path = source.Path, Ref = original.Commit },
630
new() {
Repository
= workspace.Path, Path = AspireConfigFile.FileName, Ref = reference },
651
new() {
Repository
= workspace.Path, Path = AspireConfigFile.FileName }, workspace.CreateDirectory("cache").FullName, TestContext.Current.CancellationToken));
673
Repository
= workspace.Path,
Configuration\ConfigSourceServiceTests.cs (27)
48
Repository
= s_appliedSource.Repository,
139
Repository
= difference == "repository" ? "https://other.example/config" : s_appliedSource.Repository,
144
var ignoredSource = new ConfigSource {
Repository
= s_appliedSource.Repository, Path = "ignored.json", AppliedVersion = "ignored-version" };
256
Repository
= s_appliedSource.Repository,
341
Repository
= s_appliedSource.Repository,
504
Repository
= "https://git.example/organization/config",
509
Repository
= s_source.Repository,
580
Repository
= repository,
596
new ConfigSource {
Repository
= repository, Path = s_source.Path }.Validate();
605
new ConfigSource {
Repository
= repository.FullName, Path = s_source.Path }.Validate();
624
Assert.Throws<ConfigSourceException>(() => new ConfigSource {
Repository
= repository, Path = s_source.Path }.Validate());
633
Assert.Throws<ConfigSourceException>(() => new ConfigSource {
Repository
= repository, Path = s_source.Path }.Validate());
647
Assert.Throws<ConfigSourceException>(() => new ConfigSource {
Repository
= s_source.Repository, Path = path }.Validate());
659
new ConfigSource {
Repository
= s_source.Repository, Path = s_source.Path, Ref = reference }.Validate();
678
Assert.Throws<ConfigSourceException>(() => new ConfigSource {
Repository
= s_source.Repository, Path = s_source.Path, Ref = reference }.Validate()).Message);
689
var expected = new ConfigSource {
Repository
= s_source.Repository, Path = s_source.Path, Ref = "preview" };
723
Assert.Equivalent(detected ? new ConfigSource {
Repository
= ConfigSourceService.MicrosoftRepository, Path = AspireConfigFile.FileName } : null,
785
Assert.Equivalent(accepted ? new ConfigSource {
Repository
= ConfigSourceService.MicrosoftRepository, Path = AspireConfigFile.FileName } : null,
1043
Repository
= s_appliedSource.Repository,
1084
new ConfigSource {
Repository
= s_source.Repository, Path = s_source.Path, AppliedVersion = "version-2" },
1183
Repository
= s_appliedSource.Repository,
1297
Repository
= s_appliedSource.Repository,
1439
var invalid = new ConfigSource {
Repository
= repository, Path = s_source.Path, Ref = gitRef, AppliedVersion = "version-1" };
1585
service.GetCacheDirectory(new() {
Repository
= s_source.Repository, Path = "other.json" }));
1587
service.GetCacheDirectory(new() {
Repository
= s_source.Repository, Path = s_source.Path, Ref = "preview" }));
1589
service.GetCacheDirectory(new() {
Repository
= s_source.Repository, Path = s_source.Path, Ref = "preview" }),
1590
service.GetCacheDirectory(new() {
Repository
= s_source.Repository, Path = s_source.Path, Ref = "main" }));
TestServices\TestConfigSourceServices.cs (2)
57
Repository
= source.Repository,
118
Repository
= state.Repository,
59 references to Repository
aspire (30)
Configuration\ConfigSource.cs (19)
39
=> first.
Repository
== second.
Repository
45
if (string.IsNullOrWhiteSpace(
Repository
) || string.IsNullOrWhiteSpace(Path))
52
var isLocal = System.IO.Path.IsPathFullyQualified(
Repository
);
53
var isUrl = Uri.TryCreate(
Repository
, UriKind.Absolute, out var uri)
59
var at =
Repository
.IndexOf('@');
60
var colon =
Repository
.IndexOf(':');
61
var isScp = at > 0 && colon > at + 1 && colon <
Repository
.Length - 1
62
&& !
Repository
.Contains("://", StringComparison.Ordinal)
63
&& !
Repository
[..colon].Contains('/')
64
&& !
Repository
.Contains('\\')
65
&&
Repository
[0] != '-'
66
&&
Repository
[..at].All(c => char.IsAsciiLetterOrDigit(c) || c is '.' or '_' or '-')
67
&& Uri.CheckHostName(
Repository
[(at + 1)..colon]) != UriHostNameType.Unknown;
68
if (
Repository
.Any(char.IsControl)
69
|| (!isLocal && (
Repository
.Any(char.IsWhiteSpace)
70
||
Repository
.Contains('?') ||
Repository
.Contains('#')
71
||
Repository
.StartsWith('-') || (!isUrl && !isScp))))
Configuration\ConfigSourceService.cs (11)
174
source.
Repository
, source.Path, source.Ref ?? ConfigSourceStrings.DefaultBranch,
248
Repository = source.
Repository
,
277
source.
Repository
, source.Path, snapshot.Metadata.Commit,
319
var identity = new ConfigSourceIdentity(source.
Repository
, source.Path, source.Ref);
330
foreach (var group in sources.GroupBy(source => new ConfigSourceIdentity(source.
Repository
, source.Path, source.Ref)))
417
var key = XxHash3.HashToUInt64(Encoding.UTF8.GetBytes($"{source.
Repository
}\n{source.Path}\n{source.Ref ?? ""}")).ToString("x16", CultureInfo.InvariantCulture);
424
var key = new ConfigSourceIdentity(source.
Repository
, source.Path, source.Ref);
447
Repository = source.
Repository
,
539
Repository = source.
Repository
,
638
resolvedCommit = await git.ResolveReferenceAsync(source.
Repository
, source.GetGitRef(), workingDirectory, mode, cancellationToken);
653
await git.FetchAsync(repositoryDirectory, source.
Repository
, source.GetGitRef(),
Aspire.Cli.Tests (29)
Commands\ConfigSourceCommandTests.cs (4)
305
Repository = s_source.
Repository
,
570
var selectedSource = new ConfigSource { Repository = s_source.
Repository
, Path = "selected.json", AppliedVersion = s_source.AppliedVersion };
657
var selectedSource = new ConfigSource { Repository = s_source.
Repository
, Path = "selected.json", AppliedVersion = s_source.AppliedVersion };
1066
[CliConfigNames.InitSourceUrl] = s_source.
Repository
Configuration\ConfigSourceServiceGitTests.cs (3)
172
Repository = source.
Repository
,
417
Assert.Equal(repository.FullName, config.ConfigSource!.
Repository
);
604
var pinned = await client.CheckAsync(new() { Repository = source.
Repository
, Path = source.Path, Ref = original.Commit },
Configuration\ConfigSourceServiceTests.cs (21)
48
Repository = s_appliedSource.
Repository
,
139
Repository = difference == "repository" ? "https://other.example/config" : s_appliedSource.
Repository
,
144
var ignoredSource = new ConfigSource { Repository = s_appliedSource.
Repository
, Path = "ignored.json", AppliedVersion = "ignored-version" };
256
Repository = s_appliedSource.
Repository
,
341
Repository = s_appliedSource.
Repository
,
509
Repository = s_source.
Repository
,
527
"repository": "{{s_source.
Repository
}}",
647
Assert.Throws<ConfigSourceException>(() => new ConfigSource { Repository = s_source.
Repository
, Path = path }.Validate());
659
new ConfigSource { Repository = s_source.
Repository
, Path = s_source.Path, Ref = reference }.Validate();
678
Assert.Throws<ConfigSourceException>(() => new ConfigSource { Repository = s_source.
Repository
, Path = s_source.Path, Ref = reference }.Validate()).Message);
689
var expected = new ConfigSource { Repository = s_source.
Repository
, Path = s_source.Path, Ref = "preview" };
693
[CliConfigNames.InitSourceUrl] = s_source.
Repository
,
1043
Repository = s_appliedSource.
Repository
,
1084
new ConfigSource { Repository = s_source.
Repository
, Path = s_source.Path, AppliedVersion = "version-2" },
1183
Repository = s_appliedSource.
Repository
,
1297
Repository = s_appliedSource.
Repository
,
1419
[CliConfigNames.InitSourceUrl] = s_source.
Repository
,
1585
service.GetCacheDirectory(new() { Repository = s_source.
Repository
, Path = "other.json" }));
1587
service.GetCacheDirectory(new() { Repository = s_source.
Repository
, Path = s_source.Path, Ref = "preview" }));
1589
service.GetCacheDirectory(new() { Repository = s_source.
Repository
, Path = s_source.Path, Ref = "preview" }),
1590
service.GetCacheDirectory(new() { Repository = s_source.
Repository
, Path = s_source.Path, Ref = "main" }));
TestServices\TestConfigSourceServices.cs (1)
57
Repository = source.
Repository
,