Skip to content

Commit

Permalink
Merge branch and remove conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
nitishkumar333 committed Jan 29, 2024
2 parents 927208a + 751bcbe commit 26d46af
Show file tree
Hide file tree
Showing 54 changed files with 2,952 additions and 8,083 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ REACT_APP_BACKEND_WEBSOCKET_URL=ws://localhost:4000/graphql

# If you want to logs Compiletime and Runtime error , warning and info write YES or if u want to
# keep the console clean leave it blank
ALLOW_LOGS=
ALLOW_LOGS=
4 changes: 2 additions & 2 deletions .github/workflows/pull-requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
uses: actions/checkout@v3

- name: Install Dependencies
run: npm install --legacy-peer-deps
run: npm install

- name: Count number of lines
run: |
Expand Down Expand Up @@ -82,7 +82,7 @@ jobs:
uses: actions/checkout@v3

- name: Install Dependencies
run: npm install --legacy-peer-deps
run: npm install

- name: Get changed TypeScript files
id: changed-files
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
name: List the state of node modules
run: npm install --legacy-peer-deps
run: npm install
- run: npm run test -- --watchAll=false --coverage
- name: Present and upload coverage to Codecov as ${{env.CODECOV_UNIQUE_NAME}}
uses: codecov/codecov-action@v3
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
${{ runner.os }}-
- name: Install dependencies
run: npm install --legacy-peer-deps
run: npm install

- name: Install TypeScript Globally and add GraphQL tag
run: yarn global add typescript
Expand Down
2 changes: 1 addition & 1 deletion .husky/post-merge
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

git diff HEAD^ HEAD --exit-code -- ./package.json || npm install --legacy-peer-deps
git diff HEAD^ HEAD --exit-code -- ./package.json || npm install
80 changes: 42 additions & 38 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ When multiple developers are working on issues there is bound to be a conflict o
- In the cases where you feel your potential issues could be an extension or in conflict with other PRs it is important to ask the author of the PR in the slack channel or in their PRs or issues themselves why he/she did not write code for something that would require minimal effort on their part.
- Based on basic courtesy, it is good practice to let the person who created a function apply and test that function when needed.
- Last but not the least, communication is important make sure to talk to other contributors, in these cases, in slack channel or in a issue/PR thread.
- As a last resort the Admins would be responsible for deciding how to resolve this conflict.

- As a last resort the Admins would be responsible for deciding how to resolve this conflict.

### Contributing Code

Expand All @@ -85,41 +84,43 @@ The process of proposing a change to Talawa Admin can be summarized as:
1. Make the Palisadoes Foundation's repo your `git upstream` for your local repo.
1. Make the desired changes to the Talawa Admin project.
1. Run the app and test your changes.
1. If you've added code, then test suites must be added.
1. **_General_:**
1. 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.
1. 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 --legacy-peer-deps
npm install
npm run test --watchAll=false --coverage
```
2. Debug tests in browser
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 --legacy-peer-deps
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](./public/images/jest-preview.webp)
3. **_Test Code Coverage_:**
1. _General Information_
1. The current code coverage of the repo is: [![codecov](https://codecov.io/gh/PalisadoesFoundation/talawa-admin/branch/develop/graph/badge.svg?token=II0R0RREES)](https://codecov.io/gh/PalisadoesFoundation/talawa-admin)
2. You can determine the percentage test coverage of your code by running these two commands in sequence:
```
npm install --legacy-peer-deps
npm install
npm run test --watchAll=false --coverage
genhtml coverage/lcov.info -o coverage
```
Expand All @@ -129,40 +130,43 @@ The process of proposing a change to Talawa Admin can be summarized as:
6. The currently acceptable coverage rate can be found in the [GitHub Pull Request file](.github/workflows/pull-requests.yml). 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
```
```
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
```
```
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](/public/images/codecov/authorise-codecov-github.jpg)
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](/public/images/codecov/homescrenn%20(1).jpg)
5. Use the value of this token to create a secret named CODE_COV for your forked repo.
[![Code-cov-token.jpg](/public/images/codecov/Code-cov-token.jpg)]()
[![addd-your-key.jpg](/public/images/codecov/addd-your-key.jpg)]()
6. You will see your code coverage reports with every push to your repo after following these steps
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](/public/images/codecov/authorise-codecov-github.jpg)
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](</public/images/codecov/homescrenn%20(1).jpg>)
5. Use the value of this token to create a secret named CODE_COV for your forked repo.
[![Code-cov-token.jpg](/public/images/codecov/Code-cov-token.jpg)]()
[![addd-your-key.jpg](/public/images/codecov/addd-your-key.jpg)]()
6. You will see your code coverage reports with every push to your repo after following these steps
[![results.jpg](/public/images/codecov/results.jpg)]()
2. 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).
3. After adding the changes you need to commit them using `git commit -m '<commit message>'`(look at the commit guidelines below for commit messages).
4. 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.)
5. Now create a pull request to the Talawa-admin repository from your forked repo. Open an issue regarding the same and link your PR to it.
6. Ensure the test suite passes, either locally or on CI once a PR has been created.
7. Review and address comments on your pull request if requested.
1. 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).
1. After adding the changes you need to commit them using `git commit -m '<commit message>'`(look at the commit guidelines below for commit messages).
1. 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.)
1. Now create a pull request to the Talawa-admin repository from your forked repo. Open an issue regarding the same and link your PR to it.
1. Ensure the test suite passes, either locally or on CI once a PR has been created.
1. Review and address comments on your pull request if requested.
## Internships
If you are participating in any of the various internship programs we are members of, then please read the [introduction guides on our documentation website](https://docs.talawa.io/docs/).
## Community
There are many ways to communicate with the community.
1. The Palisadoes Foundation has a Slack channel where members can assist with support and clarification. Visit the [Talawa GitHub repository home page](https://github.com/PalisadoesFoundation/talawa) for the link to join our slack channel.
Expand Down
7 changes: 3 additions & 4 deletions INSTALLATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ For more details please refer to the installation guidelines provided in the [of
Run the following command to install the packages and dependencies required by `talawa-admin`:

```
npm install
npm install
```

# Configuration
Expand Down Expand Up @@ -156,6 +156,7 @@ Copy/paste this `reCAPTCHA site key` to the variable named `REACT_APP_RECAPTCHA_
```
REACT_APP_RECAPTCHA_SITE_KEY="this_is_the_recaptcha_key"
```

## Setting up Compiletime and Runtime logs

Set the `ALLOW_LOGS` to "YES" if you want warnings , info and error messages in your console or leave it blank if you dont need them or want to keep the console clean
Expand Down Expand Up @@ -233,7 +234,6 @@ npm run lint:fix

We are using the package `Husky` to run git hooks that run according to different git workflows.


#### pre-commit hook

We run a pre-commit hook which automatically runs code quality checks each time you make a commit and also fixes some of the issues. This way you don't have to run them manually each time.
Expand All @@ -242,10 +242,9 @@ If you don't want these pre-commit checks running on each commit, you can manual

git commit -m "commit message" --no-verify


#### post-merge hook

We are also running a post-merge(post-pull) hook which will automatically run "npm install --legacy-peer-deps" only if there is any change made to pakage.json file so that the developer has all the required dependencies when pulling files from remote.
We are also running a post-merge(post-pull) hook which will automatically run "npm install" only if there is any change made to pakage.json file so that the developer has all the required dependencies when pulling files from remote.

If you don't want this hook to run, you can manually opt out of this using the `no verify` flag while using the merge command(git pull):

Expand Down
Loading

0 comments on commit 26d46af

Please sign in to comment.