# Contribute Code or Provide Feedback

If you would like to become an active contributor to this project please follow the instructions provided in [Microsoft Azure Projects Contribution Guidelines](https://azure.github.io/guidelines/).

## Project Steup
The Azure Storage development team uses Visual Studio Code so instructions will be tailored to that preference. However, any preferred IDE or other toolset should be usable.

### Install
* Node v0.10, v0.12 or v4
* [Visual Studio Code](https://code.visualstudio.com/)

### Development Environment Setup
To get the source code of the SDK via **git** just type:

```bash
git clone https://github.com/Azure/azure-storage-node.git
cd ./azure-storage-node
```

Then, run NPM to install all the NPM dependencies:

```bash
npm install
```

## Tests

### Running
Unit tests don't require real credentials and don't require any environment varaibles to be set. By default the unit tests are run with Nock recording data.

If you would like to run the unit test against a live storage account, you will need to setup environment variables which will be used. These test will use these credentials to run live tests against Azure with the provided credentials. Note that you will be charged for storage usage. You need verify the clean up script did its job at the end of a test run.

Unit tests can then be run from root directory using:

```bash
npm test
```

To run unit tests against a live storage account, please set environment variable to turn off Nock by:

```bash
export NOCK_OFF=true
```

and set up the following environment variables for storage account credentials by:

```bash
export AZURE_STORAGE_CONNECTION_STRING="valid storage connection string"
```
or 
```bash
export AZURE_STORAGE_ACCOUNT="valid storage account name"
export AZURE_STORAGE_ACCESS_KEY="valid storage account key"
```

### Testing Features
As you develop a feature, you'll need to write tests to ensure quality. Your changes should be covered by both unit tests. You should also run existing tests related to your change to address any unexpected breaks.

## Pull Requests

### Guidelines
The following are the minimum requirements for any pull request that must be met before contributions can be accepted.
* Make sure you've signed the [CLA](https://cla.azure.com/) before you start working on any change.
* Discuss any proposed contribution with the team via a GitHub issue **before** starting development.
* Code must be professional quality
  * No style issues
  * You should strive to mimic the style with which we have written the library
  * Clean, well-commented, well-designed code
  * Try to limit the number of commits for a feature to 1-2. If you end up having too many we may ask you to squash your changes into fewer commits.
* [ChangeLog.md](ChangeLog.md) needs to be updated describing the new change
* Thoroughly test your feature

### Branching Policy
Changes should be based on the **dev** branch, not master as master is considered publicly released code. Each breaking change should be recorded in [BreakingChanges.md](BreakingChanges.md).

### Adding Features for All Platforms
We strive to release each new feature for each of our environments at the same time. Therefore, we ask that all contributions be written for Node v0.10 and later.

### Review Process
We expect all guidelines to be met before accepting a pull request. As such, we will work with you to address issues we find by leaving comments in your code. Please understand that it may take a few iterations before the code is accepted as we maintain high standards on code quality. Once we feel comfortable with a contribution, we will validate the change and accept the pull request.

Thank you for any contributions! Please let the team know if you have any questions or concerns about our contribution policy.