diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index b574f620fc..4f5ed101a7 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -1,23 +1,31 @@ -# How to contribute? +# How to contribute + There are many ways for you to contribute to OData .NET. The easiest way is to participate in discussion of features and issues. You can also contribute by sending pull requests of features or bug fixes to us. Contribution to the [documentations](http://odata.github.io/odata.net/) is also highly welcomed. ## 1. Discussion + You can participate into discussions and ask questions about OData .NET at our [Github issues](https://github.com/OData/odata.net/issues). ## 2. Bug reports + When reporting a bug at the issue tracker, fill the template of issue. The issue related to other libraries should not be reported in OData .Net library issue tracker, but be reported to other libraries' issue tracker. ## 3. Pull request for code and document contribution + **Pull request is the only way we accept code and document contribution.** Pull request of document, features and bug fixes are both welcomed. Refer to this [link](https://help.github.com/articles/using-pull-requests/) to learn details about pull request. Before you send a pull request to us, you need to make sure you've followed the steps listed below. ### Pick an issue to work on + You should either create or pick an issue on the [issue tracker](https://github.com/OData/odata.net/issues) before you work on the pull request. After the OData .NET team has reviewed this issue and change its label to "accepting pull request", you can work on the code change. ### Prepare Tools -[Atom](https://atom.io/) with package [atom-beautify](https://atom.io/packages/atom-beautify) and [markdown-toc](https://atom.io/packages/markdown-toc) is recommended to edit the document. [MarkdownPad](http://www.markdownpad.com/) can also be used to edit the document.
Visual Studio 2013 or 2015 is recommended for code contribution. + +[Atom](https://atom.io/) with package [atom-beautify](https://atom.io/packages/atom-beautify) and [markdown-toc](https://atom.io/packages/markdown-toc) is recommended to edit the document. [MarkdownPad](http://www.markdownpad.com/) can also be used to edit the document.\ +Visual Studio 2013 or 2015 is recommended for code contribution. ### Steps to create a pull request -These are the recommended steps to create a pull request:
+ +These are the recommended steps to create a pull request: 1. Create a forked repository of [https://github.com/OData/odata.net.git](https://github.com/OData/odata.net.git) 2. Clone the forked repository into your local environment @@ -27,7 +35,7 @@ These are the recommended steps to create a pull request:
6. Commit changed code to local repository with clear message 7. Rebase the code to upstream via command _git pull --rebase upstream master_ and resolve conflicts if there is any then continue rebase via command _git pull --rebase continue_ 8. Push local commit to the forked repository -9. Create pull request from forked repository Web console via comparing with upstream. +9. Create pull request from forked repository Web console via comparing with upstream. 10. Complete a Contributor License Agreement (CLA), refer below section for more details. 11. Pull request will be reviewed by Microsoft OData team 12. Address comments and revise code if necessary @@ -38,13 +46,16 @@ These are the recommended steps to create a pull request:
17. Microsoft OData team will merge the pull request into upstream ### Test specification + Now we have introduced the modern xUnit test projects for OData.NET (in `Microsoft.OData.Lite.sln`). **We strongly recommend you to write all new tests with xUnit. And it would be very kind of you to help migrate some existing MSTest cases when you modify them.** Those xUnit projects all adopt the same new intuitive structure that helps contributors to find the corresponding tests for the given product code very easily. Here are some rules to follow when you are organizing the test code: + - **Project name correspondence** (`X -> X.Tests`). For instance, all the test code of the `Microsoft.OData.Edm` project should be placed in the `Microsoft.OData.Edm.Tests` project. Path and file name correspondence. (`X/Y/Z/A.cs -> X.Tests/Y/Z/ATests.cs`). For example, the test code of the `CsdlSemanticsEntityContainer` class (in the `Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsEntityContainer.cs` file) should be placed in the `Microsoft.OData.Edm.Tests/Csdl/Semantics/CsdlSemanticsEntityContainerTests.cs` file. - **Namespace correspondence** (`X.Tests/Y/Z -> X.Tests.Y.Z`). The namespace of the file should strictly follow the path. For example, the namespace of the `CsdlSemanticsEntityContainerTests.cs` file should be `Microsoft.OData.Edm.Tests.Csdl.Semantics`. - **Utility classes**. The file for a utility class can be placed at the same level of its user or a shared level that is visible to all its users. But the file name must **NOT** be ended with `Tests` to avoid any confusion. For example, `Microsoft.OData.Core.Tests/UriParser/TokenAssertions.cs` is a utility class used by several test classes under the folder `Microsoft.OData.Core.Tests/UriParser`. - **Integration and scenario tests**. Those tests usually involve multiple modules and have some specific scenarios. They should be placed separately in `X.Tests/IntegrationTests` and `X.Tests/ScenarioTests`. There is no hard requirement of the folder structure for those tests. But they should be organized logically and systematically as possible. Please see `Microsoft.OData.Core.Tests/ScenarioTests` for reference. ### Complete a Contribution License Agreement (CLA) + You will need to complete a Contributor License Agreement (CLA). Briefly, this agreement testifies that you are granting us permission to use the submitted change according to the terms of the project's license, and that the work being submitted is under appropriate copyright. Please submit a Contributor License Agreement (CLA) before submitting a pull request. Download the agreement ([Microsoft Contribution License Agreement.pdf](https://github.com/odata/odatacpp/wiki/files/Microsoft Contribution License Agreement.pdf)), sign, scan, and email it back to [cla@microsoft.com](mailto:cla@microsoft.com). Be sure to include your Github user name along with the agreement. Only after we have received the signed CLA, we'll review the pull request that you send. You only need to do this once for contributing to any Microsoft open source projects. diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index dd7dd285f4..7d343668db 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,16 +1,23 @@ -*Short summary (3-5 sentences) describing the issue.* + + +*Short summary (3-5 sentences) describing the issue.* ### Assemblies affected -*Which assemblies and versions are known to be affected e.g. OData .Net lib 6.15-beta.* + +*Which assemblies and versions are known to be affected e.g. OData .Net lib 6.15-beta.* ### Reproduce steps -*The simplest set of steps to reproduce the issue. If possible, reference a commit that demonstrates the issue.* + +*The simplest set of steps to reproduce the issue. If possible, reference a commit that demonstrates the issue.* ### Expected result -*What would happen if there wasn't a bug.* + +*What would happen if there wasn't a bug.* ### Actual result -*What is actually happening.* -### Additional details +*What is actually happening.* + +### Additional detail + *Optional, details of the root cause if known. Delete this section if you have no additional details to add.* diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index b2ee4e1c62..efe59d7d6f 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,12 +1,18 @@ + + ### Issues -*This pull request fixes issue #xxx.* + +*This pull request fixes issue #xxx.* ### Description + *Briefly describe the changes of this pull request.* ### Checklist (Uncheck if it is not completed) + - [ x ] Test cases added - [ x ] Build and test with one-click build and test script passed ### Additional work necessary + *If documentation update is needed, please add "Docs Needed" label to the issue and provide details about the required document change in the issue.* diff --git a/.markdownlint.json b/.markdownlint.json new file mode 100644 index 0000000000..1daa3791e0 --- /dev/null +++ b/.markdownlint.json @@ -0,0 +1,7 @@ +{ + "MD013": false, + "MD029": { + "style": "ordered" + }, + "MD034": false +} diff --git a/README.md b/README.md index 081024dc89..2d53ce1687 100644 --- a/README.md +++ b/README.md @@ -1,72 +1,82 @@ # OData .NET Libraries + ## 1. Introduction + The [OData .NET Libraries](http://odata.github.io/odata.net) (or OData .NET, for short) project includes the implementation of core functionalities of OData protocol on the .NET platform which includes URI parsing, request and response reading and writing, Entity Data Model (EDM) building, and also a .Net OData client which can be used to consume OData service. It is a fully open sourced project maintained by Microsoft OData team. The libraries are used by [WebApi](https://github.com/OData/WebApi/ "WeiApi") and [RESTier](https://github.com/odata/RESTier/ "RESTier") which are recommended to be adopted to build new OData Services. [OData](http://www.odata.org/ "OData") stands for the Open Data Protocol. It was initiated by Microsoft and is now an [ISO](https://www.oasis-open.org/news/pr/iso-iec-jtc-1-approves-oasis-odata-standard-for-open-data-exchange) approved and [OASIS](https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=odata) standard. OData enables the creation and consumption of REST APIs, which allow resources, identified using URLs and defined in a data model, to be published and edited by Web clients using simple HTTP requests. For more information about OData, please refer to the following resources: + - [OData.org](http://www.odata.org/) - [OASIS Open Data Protocol (OData) Technical Committee](https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=odata) **For how to adopt this and related libraries to build or consume OData service, please refer to the following resources:** + - [Build an OData v4 Service with RESTier Library](http://odata.github.io/RESTier/#01-01-Introduction) - [Build an OData v4 Service with OData WebApi Library](http://odata.github.io/WebApi/#01-02-getting-started) - [OData .Net Client](http://odata.github.io/odata.net/#04-01-basic-crud-operations) ## 2. Project structure + The project currently has six branches: [master](https://github.com/OData/odata.net/tree/master), [release](https://github.com/OData/odata.net/tree/release), [gh-pages](https://github.com/OData/odata.net/tree/gh-pages), [maintenance-6.x](https://github.com/OData/odata.net/tree/maintenance-6.x), [maintenance-5.x](https://github.com/OData/odata.net/tree/maintenance-5.x), and [maintenance-wcf-dataservice-v4](https://github.com/OData/odata.net/tree/maintenance-wcf-dataservice-v4). -**master branch** +**master branch:** This master branch is the developement branch for ODataV4 7.x and is now most actively iterated. It builds upon the OData 6.15 release which is now on [maintenance-6.x branch](https://github.com/OData/odata.net/tree/maintenance-6.x) and produces both [PCL (Portable Class Libraries) Profile111](https://msdn.microsoft.com/library/gg597391.aspx) and [.NET Standard 1.1](https://docs.microsoft.com/en-us/dotnet/articles/standard/library) libraries. For each profile above, it has the following libraries: -- [ODataLib](http://www.nuget.org/packages/Microsoft.OData.Core/) (namespace `Microsoft.OData.Core`):
The ODataLib contains classes to serialize, deserialize and validate OData JSON payloads. -- [EdmLib](http://www.nuget.org/packages/Microsoft.OData.Edm/) (namespace `Microsoft.OData.Edm`):
The EdmLib contains classes to represent, construct, parse, serialize and validate entity data models. -- [Microsoft.Spatial](http://www.nuget.org/packages/Microsoft.Spatial/) (namespace `Microsoft.Spatial`):
The spatial library contains classes and methods that facilitate geography and geometry spatial operations. -- [OData Client for .NET](http://www.nuget.org/packages/Microsoft.OData.Client/) (namespace `Microsoft.OData.Client`):
The client library is built on top of ODataLib and EdmLib that has LINQ-enabled client APIs for issuing OData queries and consuming OData JSON payloads. +- [ODataLib](http://www.nuget.org/packages/Microsoft.OData.Core/) (namespace `Microsoft.OData.Core`): The ODataLib contains classes to serialize, deserialize and validate OData JSON payloads. +- [EdmLib](http://www.nuget.org/packages/Microsoft.OData.Edm/) (namespace `Microsoft.OData.Edm`): The EdmLib contains classes to represent, construct, parse, serialize and validate entity data models. +- [Microsoft.Spatial](http://www.nuget.org/packages/Microsoft.Spatial/) (namespace `Microsoft.Spatial`): The spatial library contains classes and methods that facilitate geography and geometry spatial operations. +- [OData Client for .NET](http://www.nuget.org/packages/Microsoft.OData.Client/) (namespace `Microsoft.OData.Client`): The client library is built on top of ODataLib and EdmLib that has LINQ-enabled client APIs for issuing OData queries and consuming OData JSON payloads. + For these libraries, we accept bug reports and pull requests. The corresponding fixes and implementations will be included into every new release. While Visual Studio 2017 has been released, this branch currently compiles against Visual Studio 2015 due to internal migrations to Visual Studio 2017--rest assured, the desire to move to the new product is highly visible. With that said, this branch utilizes `project.json` files for its `.csproj` files, there is a change in the build process for those who are unfamiliar. Please either 1) run `nuget restore Microsoft.Test.OData.DotNetStandard.sln` in the commandline of the `odata.net/sln` directory, or 2) enable automatic package restore via Visual Studio to build them (in VS2015, go to `Tools->NuGet Package Manager->Package Manager Settings`. Enable "Allow NuGet to download missing packages".). More info regarding the command can be found [here](https://docs.microsoft.com/en-us/nuget/consume-packages/package-restore). -**release branch** +**release branch:** This branch is for ODataV4 7.x release developed on the [master branch](https://github.com/OData/odata.net/tree/master), contains most recently stable ODataV4 7.x release code base. -**gh-pages branch** +**gh-pages branch:** The gh-pages branch contains documentation source for OData v4 Lib - tutorials, guides, etc. The documention source is in Markdown format. It is hosted at [ODataLib Pages](http://odata.github.io/odata.net "ODataLib Pages"). -**maintenance-6.x branch** (maintenance mode) +**maintenance-6.x branch:** (maintenance mode) The maintenance-6.x branch includes the .NET libraries for ODataV4 6.x maintenance releases. -**maintenance-5.x branch** (maintenance mode) +**maintenance-5.x branch:** (maintenance mode) The maintenance-5.x branch includes the .NET libraries for OData V1-3 releases only. It has the similar libraries as the maintenance-6.x branch except for some differences in namespaces and two additional libraries: -- [ODataLib for OData v1-3](http://www.nuget.org/packages/Microsoft.Data.OData/) (namespace `Microsoft.Data.Core`):
It contains classes to serialize, deserialize and validate OData payloads. Enables construction of OData producers and consumers. -- [EdmLib for OData v1-3](http://www.nuget.org/packages/Microsoft.Data.Edm/) (namespace `Microsoft.Data.Edm`):
It contains classes to represent, construct, parse, serialize and validate entity data models. -- [System.Spatial for OData v1-3](http://www.nuget.org/packages/System.Spatial/) (namespace `System.Spatial`):
It contains classes and methods that facilitate geography and geometry spatial operations. -- [WCF Data Services Client for OData v1-3](http://www.nuget.org/packages/Microsoft.Data.Services.Client/) (namespace `Microsoft.Data.Services.Client`):
It contains LINQ-enabled client API for issuing OData queries and consuming OData payloads. -- [WCF Data Services Server for OData v1-3](http://www.nuget.org/packages/Microsoft.Data.Services/) (namespace `Microsoft.Data.Services`):
Fully-featured server API for responding to OData queries and consuming/producing OData payloads. -- [WCF Data Services EntityFramework Provider](http://www.nuget.org/packages/Microsoft.OData.EntityFrameworkProvider/) (namespace `Microsoft.OData.EntityFrameworkProvider`):
Server API for responding to OData queries and consuming/producing OData payloads based on entity framework version 6.0 or higher. + +- [ODataLib for OData v1-3](http://www.nuget.org/packages/Microsoft.Data.OData/) (namespace `Microsoft.Data.Core`): It contains classes to serialize, deserialize and validate OData payloads. Enables construction of OData producers and consumers. +- [EdmLib for OData v1-3](http://www.nuget.org/packages/Microsoft.Data.Edm/) (namespace `Microsoft.Data.Edm`): It contains classes to represent, construct, parse, serialize and validate entity data models. +- [System.Spatial for OData v1-3](http://www.nuget.org/packages/System.Spatial/) (namespace `System.Spatial`): It contains classes and methods that facilitate geography and geometry spatial operations. +- [WCF Data Services Client for OData v1-3](http://www.nuget.org/packages/Microsoft.Data.Services.Client/) (namespace `Microsoft.Data.Services.Client`): It contains LINQ-enabled client API for issuing OData queries and consuming OData payloads. +- [WCF Data Services Server for OData v1-3](http://www.nuget.org/packages/Microsoft.Data.Services/) (namespace `Microsoft.Data.Services`): Fully-featured server API for responding to OData queries and consuming/producing OData payloads. +- [WCF Data Services EntityFramework Provider](http://www.nuget.org/packages/Microsoft.OData.EntityFrameworkProvider/) (namespace `Microsoft.OData.EntityFrameworkProvider`): Server API for responding to OData queries and consuming/producing OData payloads based on entity framework version 6.0 or higher. These libraries are in maintenance mode. Only security bugs will be accepted. The release will be irregular depends on the bugs fixed. -**maintenance-wcf-dataservice-v4 branch** (maintenance mode) +**maintenance-wcf-dataservice-v4 branch:** (maintenance mode) -The maintenance-wcf-dataservice-v4 branch has the source code of the OData V4 parity of the WCF Data Services Server for OData v1-3. It is only for cloning and doesn't accept contributions. There is no binary release of it either. WCF DS is not recommended to be adopted now, instead [WebApi](https://github.com/OData/WebApi/ "WeiApi") or [RESTier](https://github.com/odata/RESTier/ "RESTier") is recommended to be adopted to build new OData Services. +The maintenance-wcf-dataservice-v4 branch has the source code of the OData V4 parity of the WCF Data Services Server for OData v1-3. It is only for cloning and doesn't accept contributions. There is no binary release of it either. WCF DS is not recommended to be adopted now, instead [WebApi](https://github.com/OData/WebApi/ "WebApi") or [RESTier](https://github.com/odata/RESTier/ "RESTier") is recommended to be adopted to build new OData Services. ## 3. Building, Testing, Debugging and Release + In the case of VS2013, [SQL Express 2008](https://www.microsoft.com/en-sg/download/details.aspx?id=30438) or above must be installed. In the case of VS2015, LocalDB v12.0 or above will be used which is part of VS2015 and no additional installation is needed. The Database will be automatically initialized by the test code if it doesn't exist. Note: The project T4CrossPlatformTests.WindowsStore.csproj will not be loaded unless you have installed the Windows 8.1 and Windows Phone 8.0 / 8.1 tools. ### 3.1 Building and Testing in Visual Studio + Simply open the solution files under 'sln' folder and build them in Visual Studio 2013 or 2015. Here is the usage of each solution file: + - Microsoft.OData.Lite.sln - Product source and minimal functional tests. _Recommended_ for doing general bugfix and feature development. It is built with .Net Framework Portable version 4.0. - Microsoft.OData.Full.sln - Product source and full functional tests (excluding test cases in Lite and E2E solution). Used to _fully_ test your code. - Microsoft.OData.E2E.sln - Product source and end-to-end tests. @@ -79,13 +89,11 @@ Here is the usage of each solution file: Each solution contains some test projects. Please open it, build it and run all the tests in the test explorer. For running tests within Microsoft.OData.Full.sln and Microsoft.OData.E2E.sln, you need to open Visual Studio IDE as **_Administrator_** so that the test services can be started properly. ### 3.2 One-click build and test script in command line -Open Command Line Window with "**Run as administrator**", cd to the root folder and run following command: -``` -build.cmd -``` +Open Command Line Window with "**Run as administrator**", `cd` to the root folder and run following command: `build.cmd`. The build and test will take about 15 minutes. Here are some other usages: + - `build.cmd Nightly`. Build and run all nightly test suites. - `build.cmd Rolling`. Build and run all rolling test suites (with less legacy tests thus faster). - `build.cmd SkipStrongName`. Configure strong name skip of OData libraries on your machine and build (no test run). @@ -94,30 +102,37 @@ The build and test will take about 15 minutes. Here are some other usages: Notes: If there is build error with message "build.ps1 cannot be loaded", right click "build.ps1" -> Properties -> "Unlock". ### 3.3 Debug + Please refer to the [How to debug](http://odata.github.io/WebApi/10-01-debug-webapi-source). ### 3.4 Nightly Builds + We keep uploading the daily nightly signed NuGet packages for ODataLib/EdmLib/ClientLib/SpatialLib to [our MyGet feed](https://www.myget.org/F/odlnightly). You can query the latest nightly NuGet packages using [this MAGIC OData query](https://www.myget.org/F/odlnightly/Packages?$select=Id,Version&$orderby=Version%20desc&$top=4&$format=application/json) ### 3.5 Official Release + The release of the component binaries is carried out regularly through [Nuget](http://www.nuget.org/). ## 4. Documentation + Please visit the [ODataLib pages](http://odata.github.io/odata.net). It has detailed descriptions on each feature provided by OData lib, how to use the OData .Net Client to consume OData service etc. ## 5. Community + ### 5.1 Contribution + There are many ways for you to contribute to OData .NET. The easiest way is to participate in discussion of features and issues. You can also contribute by sending pull requests of features or bug fixes to us. Contribution to the documentations is also highly welcomed. Please refer to the [CONTRIBUTING.md](https://github.com/OData/odata.net/blob/master/.github/CONTRIBUTING.md) for more details. ### 5.2 Support -- Issues
Report issues on [Github issues](https://github.com/OData/odata.net/issues). -- Questions
Ask questions on [Stack Overflow](http://stackoverflow.com/questions/ask?tags=odata). -- Feedback
Please send mails to [odatafeedback@microsoft.com](mailto:odatafeedback@microsoft.com). -- Team blog
Please visit [http://blogs.msdn.com/b/odatateam/](http://blogs.msdn.com/b/odatateam/) and [http://www.odata.org/blog/](http://www.odata.org/blog/). -### Thank You! +- Issues: Report issues on [Github issues](https://github.com/OData/odata.net/issues). +- Questions: Ask questions on [Stack Overflow](http://stackoverflow.com/questions/ask?tags=odata). +- Feedback: Please send mails to [odatafeedback@microsoft.com](mailto:odatafeedback@microsoft.com). +- Team blog: Please visit [http://blogs.msdn.com/b/odatateam/](http://blogs.msdn.com/b/odatateam/) and [http://www.odata.org/blog/](http://www.odata.org/blog/). + +### Thank you We’re using NDepend to analyze and increase code quality.