Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merged develop into develop-userTypeFix branch #1931

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml.archive
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: akhileshns/[email protected] # This is the action
with:
heroku_api_key: ${{secrets.HEROKU_API_KEY}}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-codescan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
Expand Down
64 changes: 55 additions & 9 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,23 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository content
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'

- name: Count number of lines
run: |
chmod +x ./.github/workflows/countline.py
./.github/workflows/countline.py --lines 600 --exclude_files src/types/generatedGraphQLTypes.ts tests

- name: Restore node_modules from cache
id: cache-npm
uses: actions/cache@v3
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
Expand Down Expand Up @@ -80,14 +85,14 @@ jobs:
BASE_BRANCH: ${{ github.event.pull_request.base.ref }}
steps:
- name: Checkout Repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Checkout code
run: git fetch origin pull/${{ github.event.pull_request.number }}/head:pr-branch
working-directory: ${{ github.workspace }}

- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.11.6'

Expand Down Expand Up @@ -129,10 +134,28 @@ jobs:
MONGO_DB_URL: mongodb://localhost:27017/talawa-test-db
REDIS_HOST: localhost
REDIS_PORT: 6379
RECAPTCHA_SITE_KEY: ${{secrets.RECAPTCHA_SITE_KEY}}
RECAPTCHA_SECRET_KEY: ${{secrets.RECAPTCHA_SECRET_KEY}}
MAIL_USERNAME: ${{secrets.MAIL_USERNAME}}
MAIL_PASSWORD: ${{secrets.MAIL_PASSWORD}}
IS_SMTP: ""
SMTP_HOST: ""
SMTP_PASSWORD: ""
SMTP_USERNAME: ""
LAST_RESORT_SUPERADMIN_EMAIL: "[email protected]"
COLORIZE_LOGS: "true"
LOG_LEVEL: "info"
# ACCESS_TOKEN_SECRET: ${{ secrets.ACCESS_TOKEN_SECRET }}
# REFRESH_TOKEN_SECRET: ${{ secrets.REFRESH_TOKEN_SECRET }}

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'

- name: Generate Access Token Secret
run: echo "ACCESS_TOKEN_SECRET=$(openssl rand -hex 32)" >> $GITHUB_ENV
Expand All @@ -141,7 +164,7 @@ jobs:
run: echo "REFRESH_TOKEN_SECRET=$(openssl rand -hex 32)" >> $GITHUB_ENV

- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4

- name: Install dependencies
run: npm ci
Expand All @@ -153,12 +176,35 @@ jobs:

- name: Run the tests
run: npm run test

- name: Start the development server
run: |
npm run dev &
echo "Development server started..."

- name: Check server status
run: |
if curl -f 'http://localhost:4000' | jq -e '. == {"talawa-version":"v1","status":"healthy"}' > /dev/null; then
echo "Server is up and healthy"
else
echo "Server is down"
exit 1
fi
- name: Check Apollo Server status
run: |
if curl -f 'http://localhost:4000/graphql?query=%7B__typename%7D' \
-H 'Apollo-Require-Preflight: true' | jq -e '. == {"data":{"__typename":"Query"}}' > /dev/null; then
echo "Apollo Server is up"
else
echo "Server is down"
exit 1
fi

- name: Import Sample Data
run: npm run import:sample-data

- name: Present and upload coverage to Codecov as ${{env.CODECOV_UNIQUE_NAME}}
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
Expand All @@ -170,13 +216,13 @@ jobs:
with:
path: './coverage/lcov.info'
min_coverage: 95.0

JSDocs:
name: 'JSDocs comments and pipeline'
runs-on: ubuntu-latest
needs: Test-Application
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: 'Check whether comments exists for JSDocs'
run: |
chmod +x ./.github/workflows/check-jsdocs-comment.py
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull_changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
if: github.ref == 'refs/heads/automated-docs'
# needs: Generate-Documentation
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dmnemec/[email protected]
env:
API_TOKEN_GITHUB: ${{secrets.TALAWA_DOCS_SYNC}}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/push-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
# This is done as we will use the Talawa-Docs repository later too
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
token: ${{ secrets.TALAWA_DOCS_SYNC }}
path: api
Expand All @@ -60,7 +60,7 @@ jobs:
run: echo "REFRESH_TOKEN_SECRET=$(openssl rand -hex 32)" >> $GITHUB_ENV

- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4

# Move into the api folder before installing the dependencies
- name: Install dependencies
Expand Down Expand Up @@ -103,7 +103,7 @@ jobs:
# We will clone the Talawa Docs in the folder called docs so that we can copy the generated
# schema.json into the same later
- name: Checkout the Talawa-Docs repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: PalisadoesFoundation/talawa-docs
token: ${{ secrets.TALAWA_DOCS_SYNC }}
Expand Down
18 changes: 10 additions & 8 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
# This is done as we will use the Talawa-Docs repository later too
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Generate Access Token Secret
run: echo "ACCESS_TOKEN_SECRET=$(openssl rand -hex 32)" >> $GITHUB_ENV
Expand All @@ -70,7 +70,7 @@ jobs:
run: echo "REFRESH_TOKEN_SECRET=$(openssl rand -hex 32)" >> $GITHUB_ENV

- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4

- name: Install dependencies
run: npm ci
Expand All @@ -86,22 +86,24 @@ jobs:

# Upload Coverage
- name: Present and upload coverage to Codecov as ${{env.CODECOV_UNIQUE_NAME}}
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
fail_ci_if_error: false
name: '${{env.CODECOV_UNIQUE_NAME}}'


Generate-Documentation:
name: Generate Documentation
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/develop'
needs: Push-Workflow
steps:
- name: Checkout repository
uses: actions/checkout@v3

uses: actions/checkout@v4
# with:
# persist-credentials: false
- name: Generate Documentation of HTML pages
run: |
npm install --global typedoc
Expand Down Expand Up @@ -142,7 +144,7 @@ jobs:
git push -f https://[email protected]/PalisadoesFoundation/talawa-api.git HEAD:automated-docs
echo -e "🚀${Green} Hurrah! doc updated${NoColor}"
env:
ACCESS_TOKEN: ${{ secrets.GH_TOKEN }}
ACCESS_TOKEN: ${{secrets.GH_TOKEN}}

- name: Create Documentation Artifact
uses: actions/upload-artifact@v2
Expand Down Expand Up @@ -210,11 +212,11 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Restore node_modules from cache
id: cache-npm
uses: actions/cache@v3
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
Expand Down
10 changes: 5 additions & 5 deletions INSTALLATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ You will need to have copies of your code on your local system. Here's how to do

## Install node.js

Best way to install and manage `node.js` is making use of node version managers. Two most popular node version managers right now are [fnm](https://github.com/Schniz/fnm) and [nvm](https://github.com/nvm-sh/nvm). We'd recommend `fnm` because it's written in `rust` and is much faster than `nvm`. Install whichever one you want and follow their guide to set up `node.js` on your system ensure the installation of Node.js version 20 LTS.
Best way to install and manage `node.js` is making use of node version managers. Two most popular node version managers right now are [fnm](https://github.com/Schniz/fnm) and [nvm](https://github.com/nvm-sh/nvm). We'd recommend `fnm` because it's written in `rust` and is much faster than `nvm`. Install whichever one you want and follow their guide to set up `node.js` on your system ensure the installation of Node.js version 20 LTS.

_**NOTE**_

Expand Down Expand Up @@ -211,10 +211,10 @@ Talawa-api makes use of `Redis` for caching frequently accessed data items in th
```bash
redis-cli
```
- **Step 6**:
- **Step 6**:
- Use these parameters when running the setup script if you have configured the server on your local machine:
- Redis Host: `localhost`
- Redis Port: `6379` (default Redis port)
- Redis Host: `localhost`
- Redis Port: `6379` (default Redis port)

2. `For Windows Users using WSL`:

Expand Down Expand Up @@ -248,7 +248,7 @@ If you'd rather not deal with the hassle of setting up WSL on your computer, the
redis-cli
```

- **Step 7**:
- **Step 7**:
- Use these parameters when running the setup script if you have configured the server on your local machine:
- Redis Host: `localhost`
- Redis Port: `6379` (default Redis port)
Expand Down
7 changes: 7 additions & 0 deletions codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ const config: CodegenConfig = {
AppUserProfile: "../models/AppUserProfile#InterfaceAppUserProfile",
AgendaCategory: "../models/AgendaCategory#InterfaceAgendaCategory",

Advertisement: "../models/Advertisement#InterfaceAdvertisement",

CheckIn: "../models/CheckIn#InterfaceCheckIn",

MessageChat: "../models/MessageChat#InterfaceMessageChat",
Expand All @@ -53,6 +55,11 @@ const config: CodegenConfig = {
EventVolunteer: "../models/EventVolunteer#InterfaceEventVolunteer",

Feedback: "../models/Feedback#InterfaceFeedback",
Fund: "../models/Fund#InterfaceFund",
FundraisingCampaign:
"../models/FundraisingCampaign#InterfaceFundraisingCampaign",
FundraisingCampaignPledge:
"../models/FundraisingCampaignPledge#InterfaceFundraisingCampaignPledges",

// File: '../models/File#InterfaceFile',

Expand Down
Loading
Loading