Skip to content

Commit

Permalink
- another bumps of default timeout
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Biret <[email protected]>
  • Loading branch information
baywet committed Nov 28, 2023
1 parent 6ef5cec commit f6ebbdf
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Kiota.Builder.EqualityComparers;

internal sealed partial class OpenApiServerComparer : IEqualityComparer<OpenApiServer>
{
[GeneratedRegex("^https?://", RegexOptions.IgnoreCase | RegexOptions.Compiled, 200)]
[GeneratedRegex("^https?://", RegexOptions.IgnoreCase | RegexOptions.Compiled, 500)]
private static partial Regex protocolCleanupRegex();
public bool Equals(OpenApiServer? x, OpenApiServer? y)
{
Expand Down
18 changes: 9 additions & 9 deletions src/Kiota.Builder/Extensions/OpenApiUrlTreeNodeExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public static partial class OpenApiUrlTreeNodeExtensions
private static string GetDotIfBothNotNullOfEmpty(string x, string y) => string.IsNullOrEmpty(x) || string.IsNullOrEmpty(y) ? string.Empty : ".";
private static readonly Func<string, string> replaceSingleParameterSegmentByItem =
static x => x.IsPathSegmentWithSingleSimpleParameter() ? "item" : x;
private static readonly char[] namespaceNameSplitCharacters = new[] { '.', '-', '$' }; //$ref from OData
private static readonly char[] namespaceNameSplitCharacters = ['.', '-', '$']; //$ref from OData
internal static string GetNamespaceFromPath(this string currentPath, string prefix) =>
prefix +
((currentPath?.Contains(PathNameSeparator, StringComparison.OrdinalIgnoreCase) ?? false) ?
Expand All @@ -38,10 +38,10 @@ public static string GetNodeNamespaceFromPath(this OpenApiUrlTreeNode currentNod
return currentNode.Path.GetNamespaceFromPath(prefix);
}
//{id}, name(idParam={id}), name(idParam='{id}'), name(idParam='{id}',idParam2='{id2}')
[GeneratedRegex(@"(?:\w+)?=?'?\{(?<paramName>\w+)\}'?,?", RegexOptions.Singleline, 200)]
[GeneratedRegex(@"(?:\w+)?=?'?\{(?<paramName>\w+)\}'?,?", RegexOptions.Singleline, 500)]
private static partial Regex PathParametersRegex();
// microsoft.graph.getRoleScopeTagsByIds(ids=@ids)
[GeneratedRegex(@"=@(\w+)", RegexOptions.Singleline, 200)]
[GeneratedRegex(@"=@(\w+)", RegexOptions.Singleline, 500)]
private static partial Regex AtSignPathParameterRegex();
private const char RequestParametersChar = '{';
private const char RequestParametersEndChar = '}';
Expand Down Expand Up @@ -81,7 +81,7 @@ public static IEnumerable<OpenApiParameter> GetPathParametersForCurrentSegment(t
return Enumerable.Empty<OpenApiParameter>();
}
private const char PathNameSeparator = '\\';
[GeneratedRegex(@"-?id\d?}?$", RegexOptions.Singleline | RegexOptions.IgnoreCase, 200)]
[GeneratedRegex(@"-?id\d?}?$", RegexOptions.Singleline | RegexOptions.IgnoreCase, 500)]
private static partial Regex idClassNameCleanup();
///<summary>
/// Returns the class name for the node with more or less precision depending on the provided arguments
Expand Down Expand Up @@ -142,7 +142,7 @@ private static string GetSegmentName(this OpenApiUrlTreeNode currentNode, Struct
"yml",
"txt",
};
[GeneratedRegex(@"[\r\n\t]", RegexOptions.Singleline, 200)]
[GeneratedRegex(@"[\r\n\t]", RegexOptions.Singleline, 500)]
private static partial Regex descriptionCleanupRegex();
public static string CleanupDescription(this string? description) => string.IsNullOrEmpty(description) ? string.Empty : descriptionCleanupRegex().Replace(description, string.Empty);
public static string GetPathItemDescription(this OpenApiUrlTreeNode currentNode, string label, string? defaultValue = default)
Expand Down Expand Up @@ -174,9 +174,9 @@ private static bool IsPathSegmentWithNumberOfParameters(this string currentSegme

return eval(currentSegment.Where(static x => x == RequestParametersChar));
}
[GeneratedRegex(@"\.(?:json|yaml|yml|csv|txt)$", RegexOptions.Singleline, 200)]
[GeneratedRegex(@"\.(?:json|yaml|yml|csv|txt)$", RegexOptions.Singleline, 500)]
private static partial Regex stripExtensionForIndexersRegex(); // so {param-name}.json is considered as indexer
[GeneratedRegex(@"\{\w+\}\.(?:json|yaml|yml|csv|txt)$", RegexOptions.Singleline, 200)]
[GeneratedRegex(@"\{\w+\}\.(?:json|yaml|yml|csv|txt)$", RegexOptions.Singleline, 500)]
private static partial Regex stripExtensionForIndexersTestRegex(); // so {param-name}.json is considered as indexer
public static bool IsComplexPathMultipleParameters(this OpenApiUrlTreeNode currentNode) =>
(currentNode?.Segment?.IsPathSegmentWithNumberOfParameters(static x => x.Any()) ?? false) && !currentNode.IsPathSegmentWithSingleSimpleParameter();
Expand Down Expand Up @@ -215,7 +215,7 @@ public static string GetUrlTemplate(this OpenApiUrlTreeNode currentNode)
SanitizePathParameterNamesForUrlTemplate(currentNode.Path.Replace('\\', '/'), pathReservedPathParametersIds) +
queryStringParameters;
}
[GeneratedRegex(@"{(?<paramname>[^}]+)}", RegexOptions.Singleline, 200)]
[GeneratedRegex(@"{(?<paramname>[^}]+)}", RegexOptions.Singleline, 500)]
private static partial Regex pathParamMatcher();
private static string SanitizePathParameterNamesForUrlTemplate(string original, HashSet<string> reservedParameterNames)
{
Expand All @@ -236,7 +236,7 @@ public static string SanitizeParameterNameForUrlTemplate(this string original)
.Replace(".", "%2E", StringComparison.OrdinalIgnoreCase)
.Replace("~", "%7E", StringComparison.OrdinalIgnoreCase);// - . ~ are invalid uri template character but don't get encoded by Uri.EscapeDataString
}
[GeneratedRegex(@"%[0-9A-F]{2}", RegexOptions.Singleline, 200)]
[GeneratedRegex(@"%[0-9A-F]{2}", RegexOptions.Singleline, 500)]
private static partial Regex removePctEncodedCharacters();
public static string SanitizeParameterNameForCodeSymbols(this string original, string replaceEncodedCharactersWith = "")
{
Expand Down
4 changes: 2 additions & 2 deletions src/Kiota.Builder/Extensions/StringExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public static string ReplaceDotsWithSlashInNamespaces(this string? namespaced)
///<summary>
/// Cleanup regex that removes all special characters from ASCII 0-127
///</summary>
[GeneratedRegex(@"[""\s!#$%&'()*,./:;<=>?@\[\]\\^`’{}|~-](?<followingLetter>\w)?", RegexOptions.Singleline, 200)]
[GeneratedRegex(@"[""\s!#$%&'()*,./:;<=>?@\[\]\\^`’{}|~-](?<followingLetter>\w)?", RegexOptions.Singleline, 500)]
private static partial Regex propertyCleanupRegex();
private const string CleanupGroupName = "followingLetter";
public static string CleanupSymbolName(this string? original)
Expand Down Expand Up @@ -181,7 +181,7 @@ public static string CleanupSymbolName(this string? original)

return result;
}
[GeneratedRegex(@"^(?<number>\d+)", RegexOptions.Singleline, 200)]
[GeneratedRegex(@"^(?<number>\d+)", RegexOptions.Singleline, 500)]
private static partial Regex NumbersSpellingRegex();
private static readonly Dictionary<char, string> SpelledOutNumbers = new() {
{'0', "Zero"},
Expand Down
2 changes: 1 addition & 1 deletion src/Kiota.Builder/Refiners/RubyRefiner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ parameterType.TypeDefinition is CodeClass parameterTypeClass &&
}
CrawlTree(currentElement, x => UpdateReferencesToDisambiguatedClasses(x, classesToUpdate, suffix));
}
[GeneratedRegex(@"\\.(<letter>\\w)", RegexOptions.IgnoreCase | RegexOptions.Singleline, 200)]
[GeneratedRegex(@"\\.(<letter>\\w)", RegexOptions.IgnoreCase | RegexOptions.Singleline, 500)]
private static partial Regex CapitalizedFirstLetterAfterDot();
private static void FlattenModelsNamespaces(CodeElement currentElement, CodeNamespace modelsNS)
{
Expand Down
6 changes: 3 additions & 3 deletions src/Kiota.Builder/Writers/CLI/CliCodeMethodWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -881,10 +881,10 @@ private static string NormalizeToOption(string input)
return result.ToLowerInvariant();
}

[GeneratedRegex("(?<=[a-z])[-_\\.]+([A-Za-z])", RegexOptions.Singleline, 200)]
[GeneratedRegex("(?<=[a-z])[-_\\.]+([A-Za-z])", RegexOptions.Singleline, 500)]
private static partial Regex DelimitedRegex();
[GeneratedRegex("(?<=[a-z])([A-Z])", RegexOptions.Singleline, 200)]
[GeneratedRegex("(?<=[a-z])([A-Z])", RegexOptions.Singleline, 500)]
private static partial Regex CamelCaseRegex();
[GeneratedRegex("([A-Z])", RegexOptions.Singleline, 200)]
[GeneratedRegex("([A-Z])", RegexOptions.Singleline, 500)]
private static partial Regex UppercaseRegex();
}
2 changes: 1 addition & 1 deletion src/Kiota.Builder/Writers/Java/CodeMethodWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ private void WriteFactoryMethodBody(CodeMethod codeElement, CodeClass parentClas
else
writer.WriteLine($"return new {parentClass.Name}();");
}
[GeneratedRegex(@"_(?<idx>\d+)", RegexOptions.Singleline, 200)]
[GeneratedRegex(@"_(?<idx>\d+)", RegexOptions.Singleline, 500)]
private static partial Regex factoryMethodIndexParser();
private static void WriteFactoryOverloadMethod(CodeMethod codeElement, CodeClass parentClass, LanguageWriter writer)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Kiota.Builder/Writers/Java/JavaConventionService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public void WriteLongDescription(CodeElement element, LanguageWriter writer, IEn
writer.WriteLine(DocCommentEnd);
}
}
[GeneratedRegex(@"[^\u0000-\u007F]+", RegexOptions.None, 200)]
[GeneratedRegex(@"[^\u0000-\u007F]+", RegexOptions.None, 500)]
private static partial Regex nonAsciiReplaceRegex();
internal static string RemoveInvalidDescriptionCharacters(string originalDescription) =>
string.IsNullOrEmpty(originalDescription) ?
Expand Down
2 changes: 1 addition & 1 deletion src/Kiota.Builder/Writers/Php/CodeEnumWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public override void WriteCodeElement(CodeEnum codeElement, LanguageWriter write
writer.WriteLine($"public const {GetEnumValueName(enumProperty.Name)} = '{enumProperty.WireName}';");
}
}
[GeneratedRegex(@"([A-Z]{1})", RegexOptions.Singleline, 200)]
[GeneratedRegex(@"([A-Z]{1})", RegexOptions.Singleline, 500)]
private static partial Regex _enumValueNameRegex();
private static string GetEnumValueName(string original)
{
Expand Down
4 changes: 2 additions & 2 deletions src/kiota/KiotaHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,9 @@ private static Option<string> GetManifestOption(string defaultValue)
manifestOption.AddAlias("-a");
return manifestOption;
}
[GeneratedRegex(@"^[a-zA-Z_][\w_-]+", RegexOptions.Singleline, 200)]
[GeneratedRegex(@"^[a-zA-Z_][\w_-]+", RegexOptions.Singleline, 500)]
private static partial Regex classNameRegex();
[GeneratedRegex(@"^[\w][\w\._-]+", RegexOptions.Singleline, 200)]
[GeneratedRegex(@"^[\w][\w\._-]+", RegexOptions.Singleline, 500)]
private static partial Regex namespaceNameRegex();
private static Command GetGenerateCommand()
{
Expand Down
2 changes: 1 addition & 1 deletion src/kiota/Rpc/Server.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ private static IEnumerable<string> GetOperationsFromTreeNode(OpenApiUrlTreeNode
Enumerable.Empty<string>())
.Union(node.Children.SelectMany(static x => GetOperationsFromTreeNode(x.Value)));
}
[GeneratedRegex(@"{\w+}", RegexOptions.Singleline, 200)]
[GeneratedRegex(@"{\w+}", RegexOptions.Singleline, 500)]
private static partial Regex indexingNormalizationRegex();
private static string NormalizeOperationNodePath(OpenApiUrlTreeNode node, OperationType operationType, bool forIndexing = false)
{
Expand Down

0 comments on commit f6ebbdf

Please sign in to comment.