Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Disable PoolName validation #2459

Merged
merged 2 commits into from
Sep 29, 2022
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
5 changes: 4 additions & 1 deletion src/ApiService/ApiService/OneFuzzTypes/Validated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ public sealed override void Write(Utf8JsonWriter writer, T value, JsonSerializer

[JsonConverter(typeof(Converter))]
public sealed record PoolName : ValidatedString {
private static bool IsValid(string input) => Check.IsNameLike(input);
// NOTE: PoolName is currently _not_ validated, since this
// can break existing users. When CSHARP-RELEASE happens, we can
// try to synchronize other breaking changes with that.
private static bool IsValid(string input) => true;

private PoolName(string value) : base(value) {
Debug.Assert(IsValid(value));
Expand Down
2 changes: 1 addition & 1 deletion src/ApiService/Tests/ValidatedStringTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public void ContainerNames(string name, bool valid) {
Assert.Equal(valid, Container.TryParse(name, out var _));
}

[Theory]
[Theory(Skip = "Validation is disabled for now")]
[InlineData("xyz", true)]
[InlineData("", false)]
[InlineData("Default-Ubuntu20.04-Standard_D2", true)]
Expand Down