Skip to content

Commit 792e6ee

Browse files
authored
Revert "Sample Data Loading and Test in GitHub Action (#3223)" (#3271)
This reverts commit 4ff9d91.
1 parent 7e6ef15 commit 792e6ee

File tree

17 files changed

+697
-1153
lines changed

17 files changed

+697
-1153
lines changed

.github/workflows/pull-request.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,3 +302,21 @@ jobs:
302302
run: |
303303
source venv/bin/activate
304304
python .github/workflows/scripts/check_docstrings.py --directories .github
305+
306+
307+
# Import-Sample-Data:
308+
# name: Import Sample Data
309+
# runs-on: ubuntu-latest
310+
# steps:
311+
# - name: Checkout this repository
312+
# uses: actions/[email protected]
313+
# - name: Create .env file for talawa api testing environment
314+
# run: cp ./envFiles/.env.ci ./.env
315+
# - name: Build talawa api non production environment docker image
316+
# run: docker compose build
317+
# - name: Run import:sample-data
318+
# uses: addnab/docker-run-action@v3
319+
# with:
320+
# image: talawa_api
321+
# options: --env-file ./envFiles/.env.ci
322+
# run: pnpm run import:sample-data

docker/api.Containerfile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@ USER talawa
3737
RUN curl -fsSL https://fnm.vercel.app/install | bash -s -- --skip-shell \
3838
# Appends the fnm configuration to `/home/talawa/.bashrc` file.
3939
&& echo eval \"\$\(fnm env --corepack-enabled --resolve-engines --use-on-cd --version-file-strategy=recursive\)\" >> /home/talawa/.bashrc
40-
# Set the PATH for all shells
41-
ENV NODE_VERSION=23.7.0
42-
ENV PATH="/home/talawa/.local/share/fnm/node-versions/v${NODE_VERSION}/installation/bin:/home/talawa/.local/share/fnm/node-versions/v${NODE_VERSION}/installation/lib/node_modules/corepack/shims:${PATH}"
4340
ENV PATH=/home/talawa/.local/share/fnm:${PATH}
4441
WORKDIR /home/talawa/api
4542

docs/docs/docs/developer-resources/testing.md

Lines changed: 1 addition & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@ This section covers important tests to validate the operation of the API.
1010
### Sample Database Login Credentials
1111

1212
If the API:
13-
1413
1. is running with an unmodified `.env` file copied from `envFiles/.env.devcontainer` and;
1514
2. the API sample database is loaded;
16-
then you can use these login credentials to access the API via various clients.
15+
then you can use these login credentials to access the API via various clients.
1716

1817
| Email | Password | User Type | Joined Organization |
1918
| -----------------------------------| -------- | ---------------| -------------------- |
@@ -187,57 +186,6 @@ CloudBeaver is a lightweight web application designed for comprehensive data man
187186
6. You should now see the `PostgreSql@postgres-test` connection in the list of available connections. Click on the connection to open the database.
188187
7. Navigate to `PostgreSql@postgres-test > Databases > talawa > Schemas > public > Tables` to view the available tables.
189188

190-
## Resetting Database (Interactive)
191-
192-
**NOTE:** This applies only to Talawa API developers.
193-
194-
Sometimes you may want to start all over again from scratch. These steps ensure all tables emptied and the default administrator account automatically restored.
195-
196-
### Using the CLI (Dev Containers)
197-
198-
This applies to users running Talawa API in dev containers.
199-
200-
1. Once the server is running, open a new terminal session.
201-
202-
2. Open a bash session inside the running container:
203-
204-
```bash
205-
docker exec -it talawa-api-1 /bin/bash
206-
```
207-
208-
3. **WARNING:** This command will **DELETE** all data from each table in your database, administrator roles will be restored. Use with extreme caution.
209-
210-
```bash
211-
pnpm run reset:db
212-
```
213-
214-
4. This command will add sample data to make it easier for developers to get an understanding of the application.
215-
216-
```bash
217-
pnpm run add:sample_data
218-
```
219-
220-
5. Then exit
221-
222-
```bash
223-
exit
224-
```
225-
226-
### Using VS Code Dev Container
227-
228-
This applies to users running Talawa API in dev containers and VSCode.
229-
230-
1. **WARNING:** This command will **DELETE** all data from each table in your database, administrator roles will be restored. Use with extreme caution.
231-
```bash
232-
pnpm run reset:db
233-
```
234-
2. This command will add sample data to make it easier for developers to get an understanding of the application.
235-
```bash
236-
pnpm run add:sample_data
237-
```
238-
239-
Now you can resume your development work.
240-
241189
## Object Storage Management
242190

243191
MinIO is a free, open-source object storage server that's compatible with Amazon S3. It's designed for large-scale data storage and can run on-premises or in the cloud.

docs/docs/docs/getting-started/installation.md

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -387,31 +387,24 @@ You can run the app after closing the terminal or restating the vscode using the
387387

388388
We have created sample data to make it easier for end users to get an understanding of the application.
389389

390-
### Using the CLI (Dev Containers)
390+
### Importing Sample Data
391391

392392
This applies to users running Talawa API in dev containers.
393393

394394
1. Once the server is running, open a new terminal session.
395-
396-
2. Run the following command to import sample data into the database:
397-
395+
2. Open a bash session inside the running container:
398396
```bash
399-
docker exec talawa-api-1 /bin/bash -c 'pnpm run add:sample_data && exit'
397+
docker exec -it talawa-api-1 /bin/bash
400398
```
401-
402-
Refer to the next section for login information.
403-
404-
### Using VS Code Dev Container
405-
406-
This applies to users running Talawa API in dev containers and VSCode.
407-
408-
1. Open a terminal inside the container.
409-
410-
2. Run the following command to import sample data into the database:
411-
399+
3. Inside the container, run the following command to import sample data into the database:
412400
```bash
413-
pnpm run add:sample_data
401+
pnpm run import:sample-data
414402
```
403+
4. Then exit
404+
```bash
405+
exit
406+
```
407+
Refer to the next section for login information.
415408

416409
### Sample Data Users
417410

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,20 @@
1717
"close-with-grace": "^2.2.0",
1818
"drizzle-orm": "^0.39.1",
1919
"drizzle-zod": "0.6.1",
20+
"dotenv": "^16.0.3",
2021
"env-schema": "^6.0.1",
2122
"fastify": "^5.2.1",
2223
"fastify-plugin": "^5.0.1",
2324
"graphql": "^16.10.0",
2425
"graphql-scalars": "^1.24.0",
2526
"graphql-upload-minimal": "^1.6.1",
27+
"inquirer": "^12.4.1",
2628
"mercurius": "^16.0.1",
2729
"mercurius-upload": "^8.0.0",
2830
"minio": "^8.0.4",
2931
"postgres": "^3.4.5",
3032
"ulidx": "^2.4.1",
33+
"uuid": "^11.0.5",
3134
"uuidv7": "^1.0.2",
3235
"zod": "^3.24.1"
3336
},
@@ -85,8 +88,7 @@
8588
"generate_drizzle_migrations": "drizzle-kit generate",
8689
"generate_graphql_sdl_file": "tsx ./scripts/generateGraphQLSDLFile.ts",
8790
"generate_gql_tada": "gql.tada generate-output && gql.tada turbo --fail-on-warn",
88-
"reset:db": "tsx ./scripts/dbManagement/resetDB.ts",
89-
"add:sample_data": "tsx ./scripts/dbManagement/addSampleData.ts",
91+
"import:sample-data": "tsx ./src/utilities/loadSampleData.ts",
9092
"push_drizzle_schema": "drizzle-kit push",
9193
"push_drizzle_test_schema": "drizzle-kit push --config=./test/drizzle.config.ts",
9294
"run_tests": "vitest --coverage",

0 commit comments

Comments
 (0)