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