Skip to content

Latest commit

 

History

History
122 lines (89 loc) · 5.24 KB

CONTRIBUTING.md

File metadata and controls

122 lines (89 loc) · 5.24 KB

Contributing to schemachange

Reporting issues

When reporting issues please include as much detail as possible about your operating environment, schemachange version and python version. Whenever possible, please also include a brief, self-contained code example that demonstrates the problem.

We have included issue templates for reporting bugs, requesting features and seeking clarifications. Choose the appropriate issue template to contribute to the repository.

Contributing code

Thank you for your interest in contributing code to schemachange!

Guide to contributing to schemachange

IMPORTANT : You will need to follow the provisioning and schemachange setup instructions to ensure you can run GitHub actions against your Snowflake account before placing a PR with main schemachange repository so that your PR can be merged into schemachange master branch.

  1. If you are a first-time contributor

    # Replace <you-github-username> with your Github User Name otherwise
    # you will not be able to clone from the fork you created earlier.
    git clone https://github.com/<your-github-username>/schemachange.git
    • Change the directory
    cd schemachange
    • Add upstream repository:
    git remote add upstream https://github.com/Snowflake-Labs/schemachange
    • Now, git remote -v will show two remote repositories named:
      • upstream, which refers to the schemachange repository
      • origin, which refers to your personal fork
    • Pull the latest changes from upstream, including tags:
    git checkout main
    git pull upstream main --tags
  2. Create and Activate a Virtual Environment

    1. From the repo directory, create a virtual environment

      python -m venv .venv
    2. Activate your virtual environment. The following table is a replication of this table:

      Platform Shell Command
      POSIX bash/zsh $ source <venv>/bin/activate
      POSIX fish $ source <venv>/bin/activate.fish
      POSIX csh/tcsh $ source <venv>/bin/activate.csh
      POSIX PowerShell $ <venv>/bin/Activate.ps1
      Windows cmd.exe C:\> <venv>\Scripts\activate.bat
      Windows PowerShell PS C:\> <venv>\Scripts\Activate.ps1
    3. With your virtual environment activated, upgrade pip

      python -m pip install --upgrade pip
    4. Install the repo as an "editable" package with development dependencies

      pip install -e .[dev]
  3. Develop your contribution

    • Create a branch for the features you want to work on. Since the branch name will appear in the merge message, use a sensible name such as 'update-build-library-dependencies':

      git checkout -b update-build-library-dependencies
    • Commit locally as you progress ( git add and git commit ). Use a properly formatted commit message. Be sure to document any changed behavior in the CHANGELOG.md file to help us collate the changes for a specific release.

  4. Test your contribution locally

    python -m pytest

    PS: Please add test cases to the features you are developing so that over time, we can capture any lapse in functionality changes.

  5. Push your contribution to GitHub

    Push your changes back to your fork on GitHub

    git push origin update-build-library-dependencies
  6. Raise a Pull Request to merge your contribution into the a Schemachange Release

    • Go to GitHub. The new branch will show up with a green Pull Request button. Make sure the title and message are clear, concise and self-explanatory. Then click the button to submit it.