Skip to content
This repository was archived by the owner on Oct 22, 2026. It is now read-only.

Latest commit

 

History

History
112 lines (82 loc) · 6.49 KB

CONTRIBUTING.md

File metadata and controls

112 lines (82 loc) · 6.49 KB

Contributing

Thank you for your interest in contributing to the repository. Regardless of the size of the contribution you make, all contributions are welcome and are appreciated.

If you are new to contributing to open source, please read the Open Source Guides on How to Contribute to Open Source.

Table of Contents

General

Please read the Palisadoes Contributing Guidelines.

Contributing Code

Code contributions come in the form of pull requests. These are done by forking the repo and making changes locally.

Make sure you have read the Documentation for Setting up the Project

The process of proposing a change to the repository can be summarized as:

  1. Fork the repository and branch off develop.

  2. Your newly forked repository can be cloned locally using git clone <YOUR FORKED REPO URL>.

  3. Make the Palisadoes Foundation's repo your git upstream for your local repo.

  4. Make the desired changes to the repository.

  5. Run the app and test your changes.

  6. If you've added code, then test suites must be added.

    1. General:

      1. We need to get to 100% test coverage for the app. We periodically increase the desired test coverage for our pull requests to meet this goal.
      2. Pull requests that don't meet the minimum test coverage levels will not be accepted. This may mean that you will have to create tests for code you did not write. You can decide which part of the code base needs additional tests if this happens to you.
    2. Testing:

      1. Test using this set of commands:

        npm install
        npm run test --watchAll=false --coverage
        
      2. Debug tests in browser

        You can see the output of failing tests in broswer by running jest-preview package before running your tests

        npm install
        npm run jest-preview
        npm run test --watchAll=false --coverage
        

        You don't need to re-run the npm run jest-preview command each time, simply run the npm run test command if the Jest Preview server is already running in the background, it'll automatically detect any failing tests and show the preview at http://localhost:3336 as shown in this screenshot -

        Debugging Test Demo

    3. Test Code Coverage:

      1. General Information

        1. The current code coverage of the repo is: codecov
        2. You can determine the percentage test coverage of your code by running these two commands in sequence:
          npm install
          npm run test --watchAll=false --coverage
          genhtml coverage/lcov.info -o coverage
          
        3. The output of the npm run test command will give you a tablular coverage report per file
        4. The overall coverage rate will be visible on the penultimate line of the genhtml command's output.
        5. The genhtml command is part of the Linux lcov package. Similar packages can be found for Windows and MacOS.
        6. The currently acceptable coverage rate can be found in the GitHub Pull Request file. Search for the value below the line containing min_coverage.
      2. Testing Individual Files

        1. You can test an individual file by running this command:
          npm run test --watchAll=false /path/to/test/file
          
        2. You can get the test coverage report for that file by running this command. The report will list all tests in the suite. Those tests that are not run will have zero values. You will need to look for the output line relevant to your test file.
          npm run test --watchAll=false --coverage /path/to/test/file
          
      3. Creating your code coverage account

        1. You can also see your code coverage online for your fork of the repo. This is provided by codecov.io

          1. Go to this link: https://app.codecov.io/gh/XXXX/YYYY where XXXX is your GitHub account username and YYYY is the name of the repository

          2. Login to codecov.io using your GitHub account, and add your repo and branches to the codecov.io dashboard. Debugging Test Demo

          3. Remember to add the Repository Upload Token for your forked repo. This can be found under Settings of your codecov.io account.

          4. Click on Setup Repo option Debugging Test Demo

          5. Use the value of this token to create a secret named CODE_COV for your forked repo. Code-cov-token.jpg addd-your-key.jpg

          6. You will see your code coverage reports with every push to your repo after following these steps results.jpg

  7. After making changes you can add them to git locally using git add <file_name>(to add changes only in a particular file) or git add . (to add all changes).

  8. Before making a commit, run all hooks manually to catch and fix issues early using: pre-commit run --all-files. Some hooks (like formatters) may auto-fix code. If so, re-add the fixed files using: git add ..

  9. After adding the changes you need to commit them using git commit -m '<commit message>'(look at the commit guidelines below for commit messages).

  10. Once you have successfully commited your changes, you need to push the changes to the forked repo on github using: git push origin <branch_name>.(Here branch name must be name of the branch you want to push the changes to.)

  11. Now create a pull request to the repository from your forked repo. Open an issue regarding the same and link your PR to it.

  12. Ensure the test suite passes, either locally or on CI once a PR has been created.

  13. Review and address comments on your pull request if requested.