Add System.Security.Cryptography Copilot instructions#131006
Open
PranavSenthilnathan wants to merge 4 commits into
Open
Add System.Security.Cryptography Copilot instructions#131006PranavSenthilnathan wants to merge 4 commits into
PranavSenthilnathan wants to merge 4 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 42bda83a-f457-4dcc-a426-e12aa6e4d47e
|
Azure Pipelines: Successfully started running 1 pipeline(s). 15 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @bartonjs, @vcsjones, @dotnet/area-system-security |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new folder-scoped GitHub Copilot instruction file for src/libraries/System.Security.Cryptography/** to guide generated contributions toward established crypto coding and testing patterns.
Changes:
- Introduces System.Security.Cryptography-specific guidance covering code style, correctness checks for
Try*APIs, and sensitive-data handling. - Adds security recommendations around constant-time comparisons and buffer clearing/returning.
- Adds test-skipping guidance intended to reduce noisy skips (but needs adjustment to match existing patterns/semantics).
|
|
||
| ## Tests | ||
|
|
||
| - Avoid throwing `SkipTestException`, which creates noisy test output. Prefer `[ConditionalFact]` or `[ConditionalTheory]` with a condition; when that is not possible, return early from the test. |
Member
Author
There was a problem hiding this comment.
Hopefully these comments go away with the new instructions.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 42bda83a-f457-4dcc-a426-e12aa6e4d47e
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 42bda83a-f457-4dcc-a426-e12aa6e4d47e
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 42bda83a-f457-4dcc-a426-e12aa6e4d47e
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
.github/instructions/system-security-cryptography.instructions.md:24
- Returning early from an xUnit test reports the test as passed, not skipped, so this guidance can hide missing coverage. Also, System.Security.Cryptography tests already use
SkipTestExceptionwidely (e.g.,CryptoConfigTests.cs:158andSkipTestException.ThrowUnless(...)inECDsaCngImportExportTests.cs:56), so advising against it unconditionally doesn’t match established practice. Suggest: prefer[ConditionalFact]/[ConditionalTheory]when possible, otherwise useSkipTestExceptionso the test is reported as skipped.
- Avoid throwing `SkipTestException`, which creates noisy test output. Prefer `[ConditionalFact]` or `[ConditionalTheory]` with a condition; when that is not possible, return early from the test.
bartonjs
approved these changes
Jul 18, 2026
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.
Adds path-specific GitHub Copilot guidance for
System.Security.Cryptography, covering established code style, correctness, sensitive-data handling, constant-time comparisons, and test skipping conventions.Documentation-only change; no build or tests were run.
Note
This pull request description was generated by GitHub Copilot.