Improve json formatting#1
Merged
Merged
Conversation
eerhardt
reviewed
Dec 16, 2023
eerhardt
reviewed
Dec 16, 2023
eerhardt
reviewed
Dec 16, 2023
|
|
||
| foreach (var match in Indentation().EnumerateMatches(value)) | ||
| { | ||
| if (match.Index > index) |
Owner
There was a problem hiding this comment.
In what case is match.Index <= index possible?
Collaborator
Author
There was a problem hiding this comment.
When the first match is at the beginning of the line.
eerhardt
reviewed
Dec 16, 2023
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aspire.MongoDB.Driver.Tests", "tests\Aspire.MongoDB.Driver.Tests\Aspire.MongoDB.Driver.Tests.csproj", "{E592E447-BA3C-44FA-86C1-EBEDC864A644}" | ||
| Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aspire.MongoDB.Driver.Tests", "tests\Aspire.MongoDB.Driver.Tests\Aspire.MongoDB.Driver.Tests.csproj", "{E592E447-BA3C-44FA-86C1-EBEDC864A644}" | ||
| EndProject | ||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConfigurationSchemaGenerator.Tests", "tests\ConfigurationSchemaGenerator.Tests\ConfigurationSchemaGenerator.Tests.csproj", "{00FEA181-84C9-42A7-AC81-29A9F176A1A0}" |
eerhardt
added a commit
that referenced
this pull request
Jan 2, 2024
…icrosoft#1423) * Update the rest of the components to use the ConfigSchemaGenerator. Also fixing a couple bugs in the generator: - Allow for just a LoggingCategories attribute - Fix a bug in the exclusion paths, which needs the node to be hooked to the parent to get the full path - Skip unsupported collections - Add some more int types * Improve json formatting (#1) --------- Co-authored-by: Sébastien Ros <sebastienros@gmail.com>
eerhardt
pushed a commit
that referenced
this pull request
Feb 26, 2025
eerhardt
added a commit
that referenced
this pull request
Jul 15, 2025
There are expectations in other integrations that primitive environment variables are serialized to strings and not random objects like enums and bools. Fix microsoft#10432 Related Work Items: #1
eerhardt
pushed a commit
that referenced
this pull request
Apr 27, 2026
…osoft#16446) * feat(ci): add test failure retry patterns with config validation and pattern matching Add eng/test-retry-patterns.json with initial transient failure patterns (ECONNRESET, DNS failures, SSL errors, timeouts, Windows 0xC0000142). Add pattern matching functions to auto-rerun-transient-ci-failures.js: - loadRetryPatternsConfig: reads and validates JSON config - validateRetryPatternsConfig: schema validation + regex compilation - extractFailedTestsFromTrx: regex-based TRX XML parsing - matchesRetryPattern: string/regex matching with case-insensitive support - matchTestFailurePatterns: AND-within/OR-across rule matching - matchJobLogPattern: job name + log text pattern matching Add 30 tests in Infrastructure.Tests covering: - Config JSON structure and schema validation (C#) - Regex compilation validation via Node.js harness (V8 engine) - Pattern matching: substring, regex, AND/OR logic, disabled rules - TRX parsing: failed test extraction, output cap, XML entity decoding - Validation edge cases: unknown props, wrong version, missing reason Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * feat(ci): add test failure retry support to auto-rerun workflow Extend the auto-rerun-transient-ci-failures workflow to detect transient test failures in addition to infrastructure failures. Two new matching paths: 1. Job log pattern matching: analyzeFailedJobs now accepts an optional retryPatternsConfig and runs a 3rd classification pass using matchJobLogPattern for test-execution-failure jobs. 2. TRX-based pattern matching: After job classification, the YAML workflow downloads the All-TestResults artifact, extracts .trx files, and matches failed test output against testFailurePatterns from eng/test-retry-patterns.json. When matches are found, all skipped test-execution-failure jobs are promoted to retryable. New exported JS functions: - hasTestExecutionFailureStep: checks if a job has test execution steps - analyzeTrxFiles: parses TRX contents, matches against patterns, dedupes - promoteTestExecutionFailureJobs: pure function to move jobs to retryable - selectTestResultsArtifact: picks newest non-expired artifact under cap Safety rails: - Existing maxRetryableJobs cap (default 5) applies to promoted jobs - 3-attempt budget shared with infrastructure retries - Artifact download failures are non-fatal - 100MB artifact size cap, 200 TRX file limit, 50MB per-file limit Updated summary and PR comment formatting to distinguish infrastructure retries from test-pattern retries. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * docs(ci): rewrite auto-rerun CI docs with practical how-to guide Restructure the documentation from a behavior contract into a user-facing guide that explains: - How the rerun system works at a glance (flow diagram) - The four analysis passes and what each does - When it triggers (automatic vs manual) - How to add/modify test failure retry patterns in eng/test-retry-patterns.json with worked examples - Rule field reference tables for both pattern types - Matching semantics (AND/OR, substring vs regex, dedup) - Tips for writing good patterns - How to verify with dry run - Safety rails summarized in a table - Architecture and file layout - How to run the tests Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * feat(ci): add MCR rate limiting patterns to test-retry-patterns.json Add patterns to detect transient MCR (mcr.microsoft.com) rate limiting failures that cause both test and infrastructure CI failures: testFailurePatterns: - MCR 403 Forbidden (regex scoped to mcr.microsoft.com) - MCR 'The request is blocked' HTML response (regex scoped) - CONTAINER1016 (.NET SDK container publish failure) - 'pull access denied for mcr.microsoft.com' (Docker pull denial) jobFailurePatterns: - MCR 403 Forbidden (regex scoped to mcr.microsoft.com) - MCR 'The request is blocked' HTML response (regex scoped) Regex patterns use [\s\S]{0,500} to require mcr.microsoft.com within 500 chars of the error text, preventing false matches on non-MCR 403s. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix: decodeXmlEntities double-decoding and sanitize markdown in PR comments - Fix decodeXmlEntities replacement ordering: move & decode to last position to prevent double-decoding of &quot; and &apos; - Add sanitizeMarkdown helper to escape backticks/pipes in test names rendered in PR comment markdown (defense-in-depth) - Add test covering double-encoded XML entity decoding Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Address PR review feedback - Precompile regex patterns during config load instead of on every match; invalid patterns log warnings and disable the rule (comments #2-3) - Add note to doc examples clarifying they are snippets, not standalone configs (comment #1) - Dispose JsonDocument with 'using' in 3 test methods (comments #4-6) - Guard artifact extraction against zip-slip and symlink attacks by skipping symlinks and verifying resolved paths stay within trxDir (comment #7) - Cap test_pattern_matched_tests output to 50 entries and drop unused testProject field to avoid GH Actions size limits (comment #8) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.