Skip to content

Commit 0b3b4e8

Browse files
GitHub Repository doc updates + NuGet.config uniformity (#188)
1 parent 727b925 commit 0b3b4e8

File tree

10 files changed

+257
-59
lines changed

10 files changed

+257
-59
lines changed

CODE_OF_CONDUCT.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Code of Conduct
2+
3+
This project has adopted the code of conduct defined by the Contributor Covenant
4+
to clarify expected behavior in our community.
5+
For more information, see the [.NET Foundation Code of Conduct](https://dotnetfoundation.org/code-of-conduct).

CONTRIBUTING.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Contributing to Microsoft.Data.SqlClient
2+
3+
General contribution guidance is included in this document. Additional guidance is defined in the documents linked below.
4+
5+
- [Copyright](copyright.md) describes the licensing practices for the project.
6+
- [Contribution Workflow](contributing-workflow.md) describes the workflow that the team uses for considering and accepting changes.
7+
8+
## Up for Grabs
9+
10+
The team marks the most straightforward issues as "up for grabs". This set of issues is the place to start if you are interested in contributing but new to the codebase.
11+
12+
- [dotnet/sqlclient - "up for grabs"](https://github.com/dotnet/sqlclient/labels/Up-for-Grabs)
13+
14+
## Contribution "Bar"
15+
16+
Project maintainers will merge changes that improve the product significantly and broadly and that align with the [Microsoft.Data.SqlClient roadmap](https://github.com/dotnet/sqlclient/blob/master/roadmap.md).
17+
18+
Contributions must also satisfy the other published guidelines defined in this document.
19+
20+
## DOs and DON'Ts
21+
22+
Please do:
23+
- **DO** report each issue as a new issue (but check first if it's already been reported)
24+
- **DO** respect Issue Templates and provide detailed information. It will make the process to reproduce the issue and provide a fix faster.
25+
- **DO** provide a minimal repro app demonstrating the problem in isolation will greatly speed up the process of identifying and fixing problems.
26+
- **DO** follow our [coding style](coding-style.md) (C# code-specific) when working on a Pull Request.
27+
- **DO** give priority to the current style of the project or file you're changing even if it diverges from the general guidelines.
28+
- **DO** consider cross-platform compatibility and supportability for all supported SQL and Azure Servers and client configurations.
29+
- **DO** include tests when adding new features. When fixing bugs, start with adding a test that highlights how the current behavior is broken.
30+
- **DO** consider concurrency when writing tests. Our pipelines run builds and tests in parallel using the same client and server configurations (in an isolated mode). E.g. Consider using dynamic table/database object names instead of hardcoded values (Use existing tests for reference).
31+
- **DO** keep the discussions focused. When a new or related topic comes up it's often better to create new issue than to side track the discussion.
32+
- **DO** blog and tweet (or whatever) about your contributions, frequently!
33+
34+
Please do not:
35+
36+
- **DON'T** make PRs for style changes.
37+
- **DON'T** leave any artifacts on server in tests or leave open resources. Cleaning up all objects is highly appreciated to maintain test server health.
38+
- **DON'T** skip tests or run them conditionally unless necessary. If conditions are not met, test coverage will not be 100%. Use only pre-defined conditions that are already being run in pipelines.
39+
- **DON'T** surprise us with big pull requests. Instead, file an issue and start a discussion so we can agree on a direction before you invest a large amount of time.
40+
- **DON'T** commit code that you didn't write. If you find code that you think is a good fit to add, file an issue and start a discussion before proceeding.
41+
- **DON'T** submit PRs that alter licensing related files or headers. If you believe there's a problem with them, file an issue and we'll be happy to discuss it.
42+
43+
## Using Labels
44+
45+
We encourage adding appropriate labels to issues and pull requests to allow filtering and analysis effectively. The below variables are required for new Pull Requests if applicable:
46+
47+
| Label | Description |
48+
| ----- | ----------- |
49+
| [Public API](https://github.com/dotnet/SqlClient/labels/Public%20API) | Use this variable if a new Public API is added to the Pull Request.
50+
| [Breaking Change](https://github.com/dotnet/SqlClient/labels/Breaking%20Change) | Use this variable if the Pull Request breaks an existing API. |
51+
| [Backport to CoreFx](https://github.com/dotnet/SqlClient/labels/Backport%20to%20CoreFx) | Use this variable if the Issue/Pull Request needs to be backported to System.Data.SqlClient in [dotnet/corefx](https://github.com/dotnet/corefx) |
52+
| [Managed SNI](https://github.com/dotnet/SqlClient/labels/Managed%20SNI) | Use this label if the issue/PR relates to issues in Managed SNI |
53+
| [Tests](https://github.com/dotnet/SqlClient/labels/Tests) | Use this label for pull requests that add only tests to the repository. |
54+
55+
## Reporting security issues and security bugs
56+
57+
Security issues and bugs should be reported privately, via email, to the Microsoft Security Response Center (MSRC) [[email protected]](mailto:[email protected]). You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Further information, including the MSRC PGP key, can be found in the [Security TechCenter](https://technet.microsoft.com/en-us/security/ff852094.aspx).
58+
59+
## File Headers
60+
61+
The following file header is used for Microsoft.Data.SqlClient. Please use it for new files.
62+
63+
```csharp
64+
// Licensed to the .NET Foundation under one or more agreements.
65+
// The .NET Foundation licenses this file to you under the MIT license.
66+
// See the LICENSE file in the project root for more information.
67+
```
68+
69+
## Contributor License Agreement
70+
71+
You must sign a [.NET Foundation Contribution License Agreement (CLA)](https://cla.dotnetfoundation.org) before your PR will be merged. This is a one-time requirement for projects in the .NET Foundation. You can read more about [Contribution License Agreements (CLA)](http://en.wikipedia.org/wiki/Contributor_License_Agreement) on Wikipedia.
72+
73+
The agreement: [net-foundation-contribution-license-agreement.pdf](https://github.com/dotnet/home/blob/master/guidance/net-foundation-contribution-license-agreement.pdf)
74+
75+
You don't have to do this up-front. You can simply clone, fork, and submit your pull-request as usual. When your pull-request is created, it is classified by a CLA bot. If the change is trivial (for example, you just fixed a typo), then the PR is labelled with `cla-not-required`. Otherwise it's classified as `cla-required`. Once you signed a CLA, the current and all future pull-requests will be labelled as `cla-signed`.
76+
77+
## Code Of Conduct
78+
79+
This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community.
80+
For more information, see the [.NET Foundation Code of Conduct](https://dotnetfoundation.org/code-of-conduct).

COPYRIGHT.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Copyright
2+
3+
## Source License
4+
5+
- The [MIT License](LICENSE) is used by this repository for [source code](https://github.com/dotnet/sqlclient/).
6+
7+
## Binary License
8+
9+
- **Microsoft.Data.SqlClient** binary distributions (nuget packages) are licensed as MIT (identical to the [Microsoft.Data.SqlClient source license](https://github.com/dotnet/sqlclient/blob/master/LICENSE)).

README.md

Lines changed: 11 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -26,46 +26,22 @@ For the .NET Framework driver on Windows, a package reference to [Microsoft.Data
2626

2727
For the .NET Core driver on Windows, a package reference to [runtime.native.System.Data.SqlClient.sni](https://www.nuget.org/packages/runtime.native.System.Data.SqlClient.sni/) loads `arm64`, `x64` and `x86` platform specific `SNI.dll` libraries into the client's build directories.
2828

29-
## Building the Driver
30-
31-
All necessary details and commands for building the driver and running tests are available in the [BUILDGUIDE](BUILDGUIDE.md).
29+
## Helpful Links
30+
31+
| Topic | Link to File |
32+
| :---- | :------------- |
33+
| Coding Style | [coding-style.md](coding-style.md) |
34+
| Guidelines for building the driver | [BUILDGUIDE.md](BUILDGUIDE.md) |
35+
| Guidelines for Contributors | [CONTRIBUTING.md](CONTRIBUTING.md) |
36+
| Changelog for all driver releases | [CHANGELOG.md](CHANGELOG.md) |
37+
| Code of Conduct | [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) |
38+
| Copyright Information | [COPYRIGHT.md](COPYRIGHT.md) |
39+
| | |
3240

3341
## Release Notes
3442

3543
All preview and stable driver release notes are available under [release-notes](release-notes).
3644

37-
## Guidelines for Creating Pull Requests
38-
39-
We love contributions from the community. To help improve the quality of our code, we encourage you to follow these guidelines:
40-
41-
- Code changes must adhere to the [C# Programming Guide](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/index).
42-
- Driver code changes must be done considering cross-platform compatibility and supportability for all supported SQL and Azure Servers and client configurations.
43-
- Tests must be added if non-existent to assure near to 100% code coverage for all future changes.
44-
- Tests should be well structured and written well to be able to run in parallel using the same client and server configurations (in an isolated mode). E.g. Consider using dynamic table/database object names instead of hardcoded values (Use existing tests for reference).
45-
- Tests should not leave any artifacts on the target server. Cleaning up all objects is highly appreciated to maintain test server health.
46-
- Avoid skipping tests if possible or running them conditionally. If conditions are not met, test coverage will not be 100%.
47-
48-
Thank you!
49-
50-
## Guidelines for Reporting Issues
51-
52-
We appreciate you taking the time to test the driver, provide feedback and report any issues. It would be extremely helpful if you:
53-
54-
- Report each issue as a new issue (but check first if it's already been reported)
55-
- Try to be detailed in your report. Useful information for good bug reports include:
56-
* What you are seeing and what the expected behavior is
57-
* The version of the driver in use.
58-
* Environment details: e.g. .NET Framework / .NET Core version, client operating system
59-
* Table schema (for some issues the data types make a big difference!)
60-
* Any other relevant information you want to share
61-
- Providing a minimal repro app demonstrating the problem in isolation will greatly speed up the process of identifying and fixing problems.
62-
63-
Thank you!
64-
65-
## Reporting security issues and security bugs
66-
67-
Security issues and bugs should be reported privately, via email, to the Microsoft Security Response Center (MSRC) [[email protected]](mailto:[email protected]). You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Further information, including the MSRC PGP key, can be found in the [Security TechCenter](https://technet.microsoft.com/en-us/security/ff852094.aspx).
68-
6945
## Still have questions?
7046

7147
Check out our [FAQ](https://github.com/dotnet/SqlClient/wiki/Frequently-Asked-Questions). Still not answered? Create an [issue](https://github.com/dotnet/SqlClient/issues/new/choose) to ask a question.

build.proj

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<Import Project="$(ToolsDir)targets\GenerateNugetPackage.targets" />
55

66
<PropertyGroup>
7+
<RestoreConfigFile>src\NuGet.config</RestoreConfigFile>
78
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
89
<Platform Condition="'$(Platform)' == ''">AnyCPU</Platform>
910
<!-- Flag to control if NetFx driver should be built or not -->
@@ -33,10 +34,6 @@
3334
<ManualTests Include="**/ManualTests/SQL/UdtTest/UDTs/Utf8String/Utf8String.csproj" />
3435
<ManualTests Include="**/tools/CoreFx.Private.TestUtilities/CoreFx.Private.TestUtilities.csproj" />
3536
<ManualTests Include="**/ManualTests/Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" />
36-
37-
<NugetPackageSources Include="https://api.nuget.org/v3/index.json" />
38-
<NugetPackageSources Include="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json" />
39-
<NugetPackageSources Include="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
4037
</ItemGroup>
4138

4239
<!-- Top Level Build targets -->

coding-style.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# C# Coding Style
2+
3+
We follow a similar coding style as [dotnet/corefx](https://github.com/dotnet/corefx).
4+
5+
For non code files (xml, etc), our current best guidance is consistency. When editing files, keep new code and changes consistent with the style in the files. For new files, it should conform to the style for that component. If there is a completely new component, anything that is reasonably broadly accepted is fine.
6+
7+
The general rule we follow is "_use Visual Studio defaults_".
8+
9+
1. We use [Allman style](http://en.wikipedia.org/wiki/Indent_style#Allman_style) braces, where each brace begins on a new line. A single line statement block can go without braces but the block must be properly indented on its own line and must not be nested in other statement blocks that use braces. One exception is that a `using` statement is permitted to be nested within another `using` statement by starting on the following line at the same indentation level, even if the nested `using` contains a controlled block.
10+
2. We use four spaces of indentation (no tabs).
11+
3. We use `_camelCase` for internal and private fields and use `readonly` where possible. Prefix internal and private instance fields with `_`, static fields with `s_` and thread static fields with `t_`. When used on static fields, `readonly` should come after `static` (e.g. `static readonly` not `readonly static`). Public fields should be used sparingly and should use PascalCasing with no prefix when used.
12+
4. We avoid `this.` unless absolutely necessary.
13+
5. We always specify the visibility, even if it's the default (e.g. `private string _foo` not `string _foo`). Visibility should be the first modifier (e.g. `public abstract` not `abstract public`).
14+
6. Namespace imports should be specified at the top of the file, *outside* of `namespace` declarations, and should be sorted alphabetically, with the exception of `System.*` namespaces, which are to be placed on top of all others.
15+
7. Avoid more than one empty line at any time. For example, do not have two blank lines between members of a type.
16+
8. Avoid spurious free spaces. For example avoid `if (someVar == 0)...`, where the dots mark the spurious free spaces. Consider enabling "View White Space (Ctrl+E, S)" if using Visual Studio to aid detection.
17+
9. If a file happens to differ in style from these guidelines (e.g. private members are named `m_member` rather than `_member`), the existing style in that file takes precedence.
18+
10. We only use `var` when it's obvious what the variable type is (e.g. `var stream = new FileStream(...)` not `var stream = OpenStandardInput()`).
19+
11. We use language keywords instead of BCL types (e.g. `int, string, float` instead of `Int32, String, Single`, etc) for both type references as well as method calls (e.g. `int.Parse` instead of `Int32.Parse`).
20+
12. We use PascalCasing to name all our constant local variables and fields. The only exception is for interop code where the constant value should exactly match the name and value of the code you are calling via interop.
21+
13. We use ```nameof(...)``` instead of ```"..."``` whenever possible and relevant.
22+
14. Fields should be specified at the top within type declarations.
23+
15. When including non-ASCII characters in the source code use Unicode escape sequences (\uXXXX) instead of literal characters. Literal non-ASCII characters occasionally get garbled by a tool or editor.
24+
16. When using labels (for goto), indent the label one less than the current indentation.
25+
26+
An [EditorConfig](https://editorconfig.org "EditorConfig homepage") file (`.editorconfig`) has been provided at the root of the sqlclient repository, enabling C# auto-formatting.

0 commit comments

Comments
 (0)