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

Enhance setup.js for Improved Docker Compatibility #2447

Closed
Show file tree
Hide file tree
Changes from 85 commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
5821d59
added docker check to workflow
VanshikaSabharwal Nov 8, 2024
1519682
Merge branch 'develop' into docker-1
VanshikaSabharwal Nov 8, 2024
81bbb3e
made recommended changes to docker check in workflow
VanshikaSabharwal Nov 8, 2024
7d04c94
made recommended changes to docker check in workflow
VanshikaSabharwal Nov 8, 2024
f8389f6
added changes to docker check inn workflow as recommended
VanshikaSabharwal Nov 8, 2024
f54dcf2
added changes
VanshikaSabharwal Nov 8, 2024
b93aed6
updated indentation in pull-request.yml file
VanshikaSabharwal Nov 8, 2024
a0ee511
updated indentation in pull-request.yml file
VanshikaSabharwal Nov 8, 2024
235d163
added Dockerfile and Docker-compose.yml file
VanshikaSabharwal Nov 10, 2024
66f4843
added Dockerfile and Docker-compose.yml file
VanshikaSabharwal Nov 10, 2024
aef2485
Merge branch 'develop' into dockerfile-1
VanshikaSabharwal Nov 10, 2024
0fa9fe5
updated .docker-ignore file
VanshikaSabharwal Nov 10, 2024
88626b7
Merge branch 'dockerfile-1' of https://github.com/VanshikaSabharwal/t…
VanshikaSabharwal Nov 10, 2024
6fd1e01
Merge branch 'develop' into docker-1
VanshikaSabharwal Nov 11, 2024
e572cf4
Merge branch 'docker-1' of https://github.com/VanshikaSabharwal/talaw…
VanshikaSabharwal Nov 11, 2024
cfdeff5
added recommended changes by code rabbit
VanshikaSabharwal Nov 11, 2024
e188853
added recommended changes by code rabbit
VanshikaSabharwal Nov 11, 2024
9a2b428
added recommended changes by code rabbit
VanshikaSabharwal Nov 11, 2024
12e5474
added recommended changes by code rabbit
VanshikaSabharwal Nov 11, 2024
17a12f7
added recommended changes by code rabbit
VanshikaSabharwal Nov 11, 2024
a44ecdb
added recommended changes by code rabbit
VanshikaSabharwal Nov 11, 2024
526a2cf
properly formatted code
VanshikaSabharwal Nov 11, 2024
82836f0
chore(deps): bump sass from 1.80.6 to 1.80.7 (#2433)
dependabot[bot] Nov 14, 2024
a97314c
chore(deps): bump eslint-plugin-import from 2.30.0 to 2.31.0 (#2434)
dependabot[bot] Nov 14, 2024
32eb6a9
chore(deps): bump @mui/x-charts from 7.22.1 to 7.22.2 (#2435)
dependabot[bot] Nov 14, 2024
ab509f6
chore(deps): bump @types/react from 18.3.3 to 18.3.12 (#2436)
dependabot[bot] Nov 14, 2024
fb913e1
Update pull-request.yml
palisadoes Nov 14, 2024
d4fca6f
trying to make docker check pass
VanshikaSabharwal Nov 15, 2024
41bb9cf
Merge branch 'develop' into docker-1
VanshikaSabharwal Nov 15, 2024
7966dda
trying to make docker check pass
VanshikaSabharwal Nov 15, 2024
ec8ec5f
Merge branch 'docker-1' of https://github.com/VanshikaSabharwal/talaw…
VanshikaSabharwal Nov 15, 2024
96d5e9a
updated INSTALLATION.md
VanshikaSabharwal Nov 15, 2024
ef08944
updated INSTALLATION.md
VanshikaSabharwal Nov 15, 2024
8236c9a
added recommended changes to INSTALLATION.md
VanshikaSabharwal Nov 15, 2024
b09c696
added recommended changes to INSTALLATION.md
VanshikaSabharwal Nov 15, 2024
c8c42a4
added recommended changes to INSTALLATION.md
VanshikaSabharwal Nov 15, 2024
d16b95e
Update dependabot.yaml
palisadoes Nov 16, 2024
aa1cb05
updated docker workflow
VanshikaSabharwal Nov 17, 2024
5e38619
Merge branch 'develop' into docker-1
VanshikaSabharwal Nov 17, 2024
435c0bd
Merge branch 'docker-1' of https://github.com/VanshikaSabharwal/talaw…
VanshikaSabharwal Nov 17, 2024
97bb5e6
updated INSTALLATION.md
VanshikaSabharwal Nov 17, 2024
0b47923
updated INSTALLATION.md
VanshikaSabharwal Nov 17, 2024
31b4bc5
updated INSTALLATION.md
VanshikaSabharwal Nov 17, 2024
c0884d1
updated setup.ts
VanshikaSabharwal Nov 17, 2024
9412b27
Merge branch 'develop-postgres' into setup
VanshikaSabharwal Nov 17, 2024
eac28f7
did recommended changes to setup.ts
VanshikaSabharwal Nov 17, 2024
f1cd66a
Merge branch 'setup' of https://github.com/VanshikaSabharwal/talawa-a…
VanshikaSabharwal Nov 17, 2024
15282bc
updated setup.ts
VanshikaSabharwal Nov 18, 2024
5830ec7
updated INSTALLATION.md
VanshikaSabharwal Nov 18, 2024
0ebafd5
Merge branch 'develop-postgres' into setup
VanshikaSabharwal Nov 19, 2024
c426e45
Merge branch 'develop-postgres' into setup
VanshikaSabharwal Nov 23, 2024
97dde86
Merge branch 'develop-postgres' into setup
VanshikaSabharwal Nov 24, 2024
f9d03de
pull-request.yml formatted
VanshikaSabharwal Nov 24, 2024
6243659
solved the problem with linting of dockerfile in pull-request.yml file
VanshikaSabharwal Nov 24, 2024
4c539cb
solved the problem with linting of dockerfile in pull-request.yml file
VanshikaSabharwal Nov 24, 2024
39115fb
solved the problem with linting of dockerfile in pull-request.yml file
VanshikaSabharwal Nov 24, 2024
3192d45
made recommended changes to pull-request.yml
VanshikaSabharwal Nov 24, 2024
5cd5a48
testing eslint fix
VanshikaSabharwal Nov 24, 2024
da0113c
testing eslint
VanshikaSabharwal Nov 24, 2024
de5cb43
testing eslint
VanshikaSabharwal Nov 24, 2024
2b4f3a0
added askForDocker file with test file
VanshikaSabharwal Nov 25, 2024
3174ea4
Merge branch 'develop-postgres' into setup
VanshikaSabharwal Nov 25, 2024
7eb38f7
Merge branch 'develop-postgres' into setup
VanshikaSabharwal Nov 26, 2024
af8cd4a
updated setup.ts file
VanshikaSabharwal Nov 28, 2024
594765d
updated askForDocker
VanshikaSabharwal Nov 28, 2024
cd99eb0
Merge branch 'develop-postgres' into setup
VanshikaSabharwal Nov 28, 2024
5c41622
updated linting error
VanshikaSabharwal Nov 29, 2024
f9b02a1
Merge branch 'develop-postgres' into setup
VanshikaSabharwal Dec 1, 2024
05dcfc8
adding
VanshikaSabharwal Dec 2, 2024
bab3153
added vitest
VanshikaSabharwal Dec 2, 2024
99bd739
testing
VanshikaSabharwal Dec 2, 2024
c298068
testing type error issue
VanshikaSabharwal Dec 2, 2024
a8ee09e
updated eslint_disable_check.py
VanshikaSabharwal Dec 2, 2024
425b45f
updated eslint_disable_check.py
VanshikaSabharwal Dec 2, 2024
dd635c4
updated eslint_disable_check.py
VanshikaSabharwal Dec 2, 2024
f27ed9e
updated pull-request.yml
VanshikaSabharwal Dec 2, 2024
9316808
updated pull-request.yml
VanshikaSabharwal Dec 2, 2024
ae3dac5
updated pull-request.yml
VanshikaSabharwal Dec 2, 2024
1f9cacc
updated pull-request.yml
VanshikaSabharwal Dec 2, 2024
e863c6b
updated .eslintrc.json
VanshikaSabharwal Dec 4, 2024
a859d25
updated .eslintrc.json
VanshikaSabharwal Dec 4, 2024
418092e
updated .eslintrc.json
VanshikaSabharwal Dec 4, 2024
65e2b3a
updated .eslintrc.json
VanshikaSabharwal Dec 4, 2024
55a8e7c
updated .eslintrc.json
VanshikaSabharwal Dec 4, 2024
3591428
updated .eslintrc.json
VanshikaSabharwal Dec 4, 2024
c860961
updated .eslintrc.json
VanshikaSabharwal Dec 4, 2024
5be01a6
added linters for dockerfile and markdown file
VanshikaSabharwal Dec 4, 2024
ff4ea49
Revert "updated .eslintrc.json"
VanshikaSabharwal Dec 4, 2024
da04be8
testing
VanshikaSabharwal Dec 4, 2024
557c203
testing changes
VanshikaSabharwal Dec 4, 2024
780ae27
testing changes
VanshikaSabharwal Dec 4, 2024
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
10 changes: 10 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Contains the PDF file of the Tag as JSON string, thus does not need to be linted

Check warning on line 1 in .eslintignore

View workflow job for this annotation

GitHub Actions / Performs linting, formatting, type-checking, checking for different source and target branch

File ignored by default.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Please revert all changes to this file.
  2. It is out of scope of the issue.
  3. The changes impede our ability to have the code quality we require as a project

src/components/CheckIn/tagTemplate.ts
package.json
package-lock.json
tsconfig.json

Dockerfile

_.yml
_.yaml

\*.md

package.json
8 changes: 1 addition & 7 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{

Check warning on line 1 in .eslintrc.json

View workflow job for this annotation

GitHub Actions / Performs linting, formatting, type-checking, checking for different source and target branch

File ignored by default.
"env": {
"browser": true,
"node": true,
Expand Down Expand Up @@ -66,13 +66,7 @@
"@typescript-eslint/array-type": "error",
"@typescript-eslint/consistent-type-assertions": "error",
"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/explicit-function-return-type": [
2,
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Please revert all changes to this file.
  2. It is out of scope of the issue.
  3. The changes impede our ability to have the code quality we require as a project

"allowExpressions": true,
"allowTypedFunctionExpressions": true
}
],
"@typescript-eslint/explicit-function-return-type": "off",
"camelcase": "off",
"@typescript-eslint/naming-convention": [
"error",
Expand Down
32 changes: 16 additions & 16 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
##############################################################################

Check warning on line 1 in .github/workflows/pull-request.yml

View workflow job for this annotation

GitHub Actions / Performs linting, formatting, type-checking, checking for different source and target branch

File ignored by default.
##############################################################################
#
# NOTE!
Expand Down Expand Up @@ -46,7 +46,7 @@
- name: Check formatting
if: steps.changed-files.outputs.only_changed != 'true'
run: npm run format:check

- name: Run formatting if check fails
if: failure()
run: npm run format
Expand All @@ -57,10 +57,10 @@

- name: Check for linting errors in modified files
if: steps.changed-files.outputs.only_changed != 'true'
env:
env:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Please revert all changes to this file.
  2. It is out of scope of the issue.
  3. The changes impede our ability to have the code quality we require as a project

CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: npx eslint ${CHANGED_FILES} && python .github/workflows/eslint_disable_check.py

VanshikaSabharwal marked this conversation as resolved.
Show resolved Hide resolved
- name: Check for TSDoc comments
run: npm run check-tsdoc # Run the TSDoc check script

Expand Down Expand Up @@ -89,7 +89,7 @@
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Get Changed Unauthorized files
id: changed-unauth-files
uses: tj-actions/changed-files@v45
Expand Down Expand Up @@ -130,10 +130,10 @@
*.password
*.secret
*.credentials

- name: List all changed unauthorized files
if: steps.changed-unauth-files.outputs.any_changed == 'true' || steps.changed-unauth-files.outputs.any_deleted == 'true'
env:
env:
VanshikaSabharwal marked this conversation as resolved.
Show resolved Hide resolved
CHANGED_UNAUTH_FILES: ${{ steps.changed-unauth-files.outputs.all_changed_files }}
run: |
for file in ${CHANGED_UNAUTH_FILES}; do
Expand All @@ -154,14 +154,14 @@
uses: tj-actions/changed-files@v45

- name: Echo number of changed files
env:
env:
CHANGED_FILES_COUNT: ${{ steps.changed-files.outputs.all_changed_files_count }}
run: |
echo "Number of files changed: $CHANGED_FILES_COUNT"

- name: Check if the number of changed files is less than 100
if: steps.changed-files.outputs.all_changed_files_count > 100
env:
env:
CHANGED_FILES_COUNT: ${{ steps.changed-files.outputs.all_changed_files_count }}
run: |
echo "Error: Too many files (greater than 100) changed in the pull request."
Expand Down Expand Up @@ -201,11 +201,11 @@

- name: Install Dependencies
run: npm install

- name: Get changed TypeScript files
id: changed-files
uses: tj-actions/changed-files@v45

- name: Run Jest Tests
if: steps.changed-files.outputs.only_changed != 'true'
env:
Expand All @@ -227,8 +227,8 @@
if ! npx lcov-result-merger 'coverage/*/lcov.info' > 'coverage/lcov.info'; then
echo "Failed to merge coverage reports"
exit 1
fi
fi

- name: TypeScript compilation for changed files
run: |
for file in ${{ steps.changed-files.outputs.all_files }}; do
Expand All @@ -249,7 +249,7 @@
- name: Test acceptable level of code coverage
uses: VeryGoodOpenSource/very_good_coverage@v3
with:
path: "./coverage/lcov.info"
path: './coverage/lcov.info'
min_coverage: 0.0

Graphql-Inspector:
Expand All @@ -267,15 +267,15 @@

- name: resolve dependency
run: npm install -g @graphql-inspector/cli

VanshikaSabharwal marked this conversation as resolved.
Show resolved Hide resolved
- name: Clone API Repository
run: |
# Retrieve the complete branch name directly from the GitHub context
FULL_BRANCH_NAME=${{ github.base_ref }}
echo "FULL_Branch_NAME: $FULL_BRANCH_NAME"

# Clone the specified repository using the extracted branch name
git clone --branch $FULL_BRANCH_NAME https://github.com/PalisadoesFoundation/talawa-api && ls -a
git clone --branch $FULL_BRANCH_NAME https://github.com/PalisadoesFoundation/talawa-api && ls -a

- name: Validate Documents
run: graphql-inspector validate './src/GraphQl/**/*.ts' './talawa-api/schema.graphql'
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:20.10.0 AS build
FROM node:20.10.0-alpine AS build

WORKDIR /usr/src/app

Expand All @@ -12,4 +12,4 @@ RUN npm run build

EXPOSE 4321

CMD ["npm", "run", "serve"]
CMD ["npm", "run", "serve"]
22 changes: 21 additions & 1 deletion INSTALLATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,32 @@ docker build -t talawa-admin .

After the build is complete, run the Docker container using this command:

For Linux/MacOS
```bash
docker run -p 4321:4321 talawa-admin
docker run -d \
--name talawa-admin \
-p 4321:4321 \
-v $(pwd)/.env:/app/.env \
talawa-admin

```bash

For Windows
docker run -d `
--name talawa-admin `
-p 4321:4321 `
-v ${PWD}\.env:/app/.env `
talawa-admin

VanshikaSabharwal marked this conversation as resolved.
Show resolved Hide resolved

The application will be accessible at `http://localhost:4321`

4. Managing the container:

To stop the container:
```bash
docker stop talawa-admin

VanshikaSabharwal marked this conversation as resolved.
Show resolved Hide resolved
# Configuration

It's important to configure Talawa-Admin. Here's how to do it.
Expand Down
3 changes: 2 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ export default {
'!**/index.{js,ts}',
'!**/*.d.ts',
'!src/test/**',
'!vitest.config.ts',],
'!vitest.config.ts',
],
// setupFiles: ['react-app-polyfill/jsdom'],
setupFiles: ['whatwg-fetch'],
setupFilesAfterEnv: ['<rootDir>/src/setupTests.ts'],
Expand Down
4 changes: 2 additions & 2 deletions scripts/githooks/check-localstorage-usage.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ if (filesWithLocalStorage.length > 0) {

console.info(
'\x1b[34m%s\x1b[0m',
'\nInfo: Consider using custom hook functions.'
'\nInfo: Consider using custom hook functions.',
);
console.info(
'Please use the getItem, setItem, and removeItem functions provided by the custom hook useLocalStorage.\n'
'Please use the getItem, setItem, and removeItem functions provided by the custom hook useLocalStorage.\n',
);

process.exit(1);
Expand Down
1 change: 0 additions & 1 deletion scripts/githooks/update-toc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const markdownFiles = fs
markdownFiles.forEach((file) => {
const command = `markdown-toc -i "${file}" --bullets "-"`;
execSync(command, { stdio: 'inherit' });

});

console.log('Table of contents updated successfully.');
Loading
Loading