Skip to content

Commit 7b16411

Browse files
committed
Merge branch 'develop'
2 parents 904ed6e + 20a6afa commit 7b16411

File tree

120 files changed

+8711
-6122
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+8711
-6122
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
name: Bug report
33
about: Create a report to help us improve
44
title: 'bug: '
5-
labels: triage
65
assignees: ''
76

87
---

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
name: Feature request
33
about: Suggest an idea for this project
44
title: 'feat: '
5-
labels: triage
65
assignees: ''
76

87
---

.github/pull_request_template.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1+
Fixes # (issue)
2+
13
## Description
24

35
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
46

5-
Fixes # (issue)
6-
77
### Type of Change
88

99
Only keep lines below that describe this change, then delete the rest.
@@ -19,23 +19,23 @@ Only keep lines below that describe this change, then delete the rest.
1919

2020
Please provide screenshots / animations for any change that involves the UI. Please provide animations to demonstrate user interaction / behavior changes
2121

22-
## Testing on your branch
23-
24-
Please describe how to test and/or verify your changes. Provide instructions so we can reproduce. Please also provide relevant test data as necessary. These instructions will be used for QA testing below.
25-
26-
- [ ] Test A
27-
- [ ] Test B
28-
2922
## Checklist
3023

3124
- [ ] I have performed a self-review of my own code
3225
- [ ] I have reviewed the title/description of this PR which will be used as the squashed PR commit message
3326
- [ ] I have commented my code, particularly in hard-to-understand areas
3427
- [ ] I have added tests that prove my fix is effective or that my feature works
3528

29+
## How to test
30+
31+
Please describe how to test and/or verify your changes. Provide instructions so we can reproduce. Please also provide relevant test data as necessary. These instructions will be used for QA testing below.
32+
33+
- [ ] Test A
34+
- [ ] Test B
35+
3636
## qa.languageforge.org testing
3737

38-
Reviewers: add/replace your name below and check the box to sign-off/attest the feature works as expected on qa.languageforge.org
38+
Testers: Check the box and put in a date/time to sign-off/attest the feature works as expected on qa.languageforge.org
3939

40-
- [ ] Reviewer1 (YYYY-MM-DD HH:MM)
41-
- [ ] Reviewer2 (YYYY-MM-DD HH:MM)
40+
- [ ] Tester1 (YYYY-MM-DD HH:MM)
41+
- [ ] Tester2 (YYYY-MM-DD HH:MM)

.github/workflows/integrate-and-deploy.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,21 +66,21 @@ jobs:
6666
-
6767
name: Build legacy app
6868
run: |
69-
docker-compose build --build-arg ENVIRONMENT=production --build-arg BUILD_VERSION=${{ steps.image.outputs.TAG }} app
69+
docker-compose build --build-arg ENVIRONMENT=production --build-arg BUILD_VERSION=${{ steps.image.outputs.TAG_APP }} app
7070
docker-compose run --rm app cat /var/www/html/build-version.txt /var/www/html/version.php
7171
-
7272
name: Build "next" images
7373
run: make build-next
7474
-
7575
name: Unit Tests
7676
run: make unit-tests-ci
77-
-
78-
name: E2E Tests
79-
working-directory: .
80-
run: |
81-
docker-compose -f docker/docker-compose.yml up -d app-for-playwright
82-
npx playwright install
83-
npx playwright test
77+
# -
78+
# name: E2E Tests
79+
# working-directory: .
80+
# run: |
81+
# docker-compose -f docker/docker-compose.yml up -d app-for-playwright
82+
# npx playwright install chromium
83+
# npx playwright test
8484
-
8585
name: Log in to Docker Hub
8686
uses: docker/login-action@v1

.github/workflows/production.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ jobs:
1919

2020
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idsecrets
2121
secrets:
22-
kube-context: ${{ secrets.LTOPS_K8S_PRODUCTION_CONTEXT }}
22+
kube-context: ${{ secrets.K8S_PRODUCTION_CONTEXT }}
2323
image-repo-username: ${{ secrets.DOCKERHUB_USERNAME }}
2424
image-repo-password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}

.github/workflows/pull-request.yml

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,33 @@ jobs:
4747
run: |
4848
npm ci
4949
docker-compose build app
50-
-
51-
name: Playwright E2E Tests
50+
- name: Get installed Playwright version
51+
id: playwright-version
52+
# https://github.com/microsoft/playwright/issues/7249#issuecomment-1201476980
53+
run: echo -n "::set-output name=version::$(npm ls @playwright/test --json | jq --raw-output '.dependencies["@playwright/test"].version')"
54+
55+
# https://github.com/microsoft/playwright/issues/7249#issuecomment-1154603556
56+
- name: Cache playwright browsers
57+
uses: actions/cache@v3
58+
id: playwright-cache
59+
with:
60+
path: '~/.cache/ms-playwright'
61+
# Make each playwright version use its own cache in case it uses different browser versions
62+
# Cache entries are deleted if not accessed for 7 days
63+
# https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#usage-limits-and-eviction-policy
64+
key: 'playwright-${{ steps.playwright-version.outputs.version }}'
65+
66+
- name: Playwright E2E Tests
5267
working-directory: .
5368
# see https://playwright.dev/docs/ci#github-actions
54-
run: |
55-
docker-compose -f docker/docker-compose.yml up -d app-for-playwright
56-
npx playwright install
57-
npx playwright test
69+
run: npm run make playwright-tests
70+
71+
- name: Upload test results
72+
if: always()
73+
uses: actions/upload-artifact@v2
74+
with:
75+
name: test-results
76+
path: test-results
5877

5978
# protractor-tests:
6079
# runs-on: ubuntu-latest

.github/workflows/set-backlog-fields.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ jobs:
6161
}
6262
}
6363
}' -f org=$ORGANIZATION > project_data.json
64-
64+
6565
echo 'PROJECT_ID='$(jq '.data.organization.projectNext.id' project_data.json) >> $GITHUB_ENV
6666
echo 'FIELD_ID='$(jq '.data.organization.projectNext.fields.nodes[] | select(.name== "ProductOwner") | .id' project_data.json) >> $GITHUB_ENV
67-
echo 'TRIAGE_ID='$(jq '.data.organization.projectNext.fields.nodes[] | select(.name== "ProductOwner") | .settings | fromjson.options[] | select(.name=="Triage") | .id' project_data.json) >> $GITHUB_ENV
68-
67+
echo 'INCOMING_ID='$(jq '.data.organization.projectNext.fields.nodes[] | select(.name== "ProductOwner") | .settings | fromjson.options[] | select(.name=="Incoming") | .id' project_data.json) >> $GITHUB_ENV
68+
6969
- name: Add issue to project
7070
if: env.IN_PROJECT == 0
7171
env:
@@ -105,5 +105,5 @@ jobs:
105105
id
106106
}
107107
}
108-
}' -f project=$PROJECT_ID -f item=$ITEM_ID -f field=$FIELD_ID -f field_value=${{ env.TRIAGE_ID }}
109-
108+
}' -f project=$PROJECT_ID -f item=$ITEM_ID -f field=$FIELD_ID -f field_value=${{ env.INCOMING_ID }}
109+

.github/workflows/staging.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ jobs:
1717

1818
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idsecrets
1919
secrets:
20-
kube-context: ${{ secrets.LTOPS_K8S_STAGING_CONTEXT }}
20+
kube-context: ${{ secrets.K8S_STAGING_CONTEXT }}
2121
image-repo-username: ${{ secrets.DOCKERHUB_USERNAME }}
2222
image-repo-password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}

.vscode/extensions.json

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
{
2-
// See http://go.microsoft.com/fwlink/?LinkId=827846
3-
// for the documentation about the extensions.json format
4-
"recommendations": [
5-
"amodio.tsl-problem-matcher",
6-
"msjsdiag.debugger-for-chrome",
7-
"ms-vscode-remote.remote-containers",
8-
"editorconfig.editorconfig",
9-
"dbaeumer.vscode-eslint",
10-
"xdebug.php-pack",
11-
"svelte.svelte-vscode",
12-
"bradlc.vscode-tailwindcss"
13-
]
2+
// See http://go.microsoft.com/fwlink/?LinkId=827846
3+
// for the documentation about the extensions.json format
4+
"recommendations": [
5+
"amodio.tsl-problem-matcher",
6+
"msjsdiag.debugger-for-chrome",
7+
"ms-vscode-remote.remote-containers",
8+
"editorconfig.editorconfig",
9+
"dbaeumer.vscode-eslint",
10+
"xdebug.php-pack",
11+
"svelte.svelte-vscode",
12+
"bradlc.vscode-tailwindcss",
13+
"ms-playwright.playwright"
14+
]
1415
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ We're glad you're here! Read our [Contributing Guide](CONTRIBUTING.md) for how
2323

2424
## Developers ##
2525

26-
Please see our [Developer Guide](docs/DEVELOPER.md) for developer best practices and environment setup
26+
Please see our [Developer Guide](docs/DEVELOPER.md) for developer best practices and environment setup.
2727

2828
For production deployment and release instructions, there is a separate [Production Deployment and Release Guide](docs/RELEASE.md).

docker/Makefile

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ playwright-tests:
2323
# wait until the app-for-playwright service is serving up HTTP before continuing
2424
until curl localhost:3238 > /dev/null 2>&1; do sleep 1; done
2525

26-
cd .. && npx playwright install && npx playwright test
26+
cd .. && npx playwright install chromium && npx playwright test $(params)
2727

2828
.PHONY: e2e-tests
2929
e2e-tests:
@@ -74,11 +74,9 @@ clean:
7474
docker compose down
7575
docker system prune -f
7676

77-
.PHONY: clean-volumes
78-
clean-volumes:
79-
docker compose down -v
80-
docker system prune -f --volumes
81-
8277
.PHONY: clean-powerwash
83-
clean-powerwash: clean-volumes
84-
docker compose down --rmi all
78+
clean-powerwash: clean
79+
docker system prune -f --volumes
80+
docker rmi -f `docker images -q "lf-*"`
81+
docker image rm sillsdev/web-languageforge:base-php
82+
docker builder prune -f

docker/base-php/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ FROM php:7.3.28-apache
44
# p7zip-full - used by LF application for unzipping lexicon uploads
55
# unzip - used by LF application for unzipping lexicon uploads
66
# curl - used by LF application
7-
RUN apt-get update && apt-get -y install p7zip-full unzip curl tini && rm -rf /var/lib/apt/lists/*
7+
# ffmpeg - used by LF audio upload method
8+
RUN apt-get update && apt-get -y install p7zip-full unzip curl tini ffmpeg && rm -rf /var/lib/apt/lists/*
89

910
# see https://github.com/mlocati/docker-php-extension-installer
1011
# PHP extensions required by the LF application

docker/db/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dump

docker/db/Makefile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
clean:
2+
docker compose down
3+
4+
db:
5+
docker compose up -d db
6+
7+
dump: db
8+
docker compose exec db mongodump
9+
docker compose cp db:/dump ./dump
10+
11+
restore: db
12+
docker compose cp ./dump db:/dump
13+
docker compose exec db mongorestore
14+

docker/db/README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Creating and utilizing any test data
2+
3+
## Create a dump
4+
5+
1. start the app
6+
1. create all the data you want through the app
7+
1. `make dump clean` to create a `dump` folder in this directory
8+
1. `tar -cf <name-representative-of-data>.tar dump`, e.g., `tar -cf activity.tar dump`, and decide whether to commit this or not for others to use.
9+
10+
## Load a dump
11+
12+
1. `tar -xf <name-representative-of-data>.tar` and rename to `dump`
13+
1. `make restore clean` to load the `dump` directory
14+
15+
# Common mongo commands
16+
17+
> https://www.mongodb.com/docs/v4.4/mongo
18+
19+
`mongo` within `db` container
20+
21+
> https://www.mongodb.com/docs/manual/reference/mongo-shell/#command-helpers
22+
23+
`show dbs`
24+
25+
`use scriptureforge`
26+
27+
`show collections`
28+
29+
`exit`
30+
31+
> https://www.mongodb.com/docs/manual/reference/mongo-shell/#queries
32+
33+
`db.users.find()`
34+
35+
# Test data
36+
37+
## Activity
38+
39+
| username | email | password | project |
40+
| -------- | ------------------- | ------------- | ----------- |
41+
| admin | [email protected] | password | all |
42+
| johndoe | [email protected] | languageforge | project-1 |
43+
| janedoe | [email protected] | languageforge | project-2 |

docker/db/activity.tar

75 KB
Binary file not shown.

docker/deployment/app-deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ spec:
101101
memory: 110Mi
102102
cpu: 0.1
103103
limits:
104-
memory: 200Mi
104+
memory: 500Mi
105105
volumeMounts:
106106
- mountPath: /var/www/html/assets
107107
name: assets

docker/deployment/next-app-deployment.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,11 @@ spec:
4242
# https://kubernetes.io/docs/concepts/configuration/manage-resources-containers
4343
resources:
4444
requests:
45-
memory: 16Mi
45+
memory: 100Mi
4646
cpu: 0.1
4747
limits:
48-
memory: 20Mi
48+
memory: 500Mi
4949
env:
5050
- name: API_HOST
5151
value: http://app
52+

docker/deployment/next-proxy-deployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ spec:
6969
imagePullPolicy: Always
7070
resources:
7171
requests:
72-
memory: 12Mi
72+
memory: 25Mi
7373
cpu: 0.1
7474
limits:
75-
memory: 20Mi
75+
memory: 75Mi
7676
env:
7777
- name: LEGACY_APP
7878
value: app:80

docker/docker-compose.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,6 @@ services:
337337
dockerfile: docker/test-php/Dockerfile
338338
image: test-php
339339
container_name: test-php
340-
platform: linux/amd64
341340
depends_on:
342341
- db
343342
- mail

docker/lfmerge/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
FROM ghcr.io/sillsdev/lfmerge:2.0.123
1+
FROM ghcr.io/sillsdev/lfmerge:2.0.131
22
# Do not add anything to this Dockerfile, it should stay empty

docker/next-app/Caddyfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77
:80 {
88
@next_app_paths {
99
path /_app/*
10+
# ref for existing: /src/index.php
1011
path /app/changepassword
1112
path /password*
13+
path /projects*
1214
}
1315
route @next_app_paths {
1416
rewrite /app/changepassword /password/change

docker/next-app/Dockerfile.next-app

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ FROM node:alpine AS builder
33

44
WORKDIR /app
55

6-
COPY jsconfig.json package-lock.json package.json postcss.config.cjs svelte.config.js tailwind.config.cjs /app/
6+
COPY tsconfig.json package-lock.json package.json postcss.config.cjs svelte.config.js vite.config.js tailwind.config.cjs /app/
77
COPY src /app/src
88
COPY static /app/static
99

docker/next-app/dev/Caddyfile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,16 @@
66

77
:80 {
88
@next_app_paths {
9-
path *svelte* # when running next-app in dev mode, this is needed.
10-
path *node_modules* # when running next-app in dev mode, this is needed.
11-
path *vite* # when running next-app in dev mode, this is needed.
12-
path /src/lib* # when running next-app in dev mode, this is needed.
13-
path /_app/*
9+
# when running next-app in dev mode, these are needed.
10+
path /.svelte-kit/*
11+
path *node_modules*
12+
path /@vite/*
13+
path /src/*
14+
15+
# ref for existing: /src/index.php
1416
path /app/changepassword
1517
path /password*
18+
path /projects*
1619
}
1720
route @next_app_paths {
1821
rewrite /app/changepassword /password/change

0 commit comments

Comments
 (0)