Skip to content

Commit 8697b9d

Browse files
committed
Merge branch 'develop'
2 parents d1b84e1 + 5db9a73 commit 8697b9d

File tree

88 files changed

+2813
-2221
lines changed

Some content is hidden

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

88 files changed

+2813
-2221
lines changed

.github/pull_request_template.md

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,12 @@
1-
Fixes # (issue)
1+
### Fixes #_issue_
22

33
## Description
44

5-
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.
6-
7-
### Type of Change
8-
9-
Only keep lines below that describe this change, then delete the rest.
10-
11-
- Bug fix (non-breaking change which fixes an issue)
12-
- New feature (non-breaking change which adds functionality)
13-
- Breaking change (fix or feature that would cause existing functionality to not work as expected)
14-
- This change requires a documentation update
15-
- migration required (a model change requiring a mongodb script or migration script)
16-
- UI change
5+
_A summary of the change including motivation and context._
176

187
## Screenshots
198

20-
Please provide screenshots / animations for any change that involves the UI. Please provide animations to demonstrate user interaction / behavior changes
9+
_Demonstrate any UI / behavioral changes with screenshots or animations._
2110

2211
## Checklist
2312

@@ -28,13 +17,10 @@ Please provide screenshots / animations for any change that involves the UI. Ple
2817
- [ ] I have added tests that prove my fix is effective or that my feature works
2918
- [ ] I have enabled auto-merge (optional)
3019

31-
## How to test
20+
## QA testing
3221

33-
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.
22+
Testers, use the following instructions on [qa.languageforge.org](https://qa.languageforge.org). Post your findings as a comment and include any meaningful screenshots, etc.
3423

35-
- Test A
36-
- Test B
37-
38-
## qa.languageforge.org testing
24+
_Describe how to verify your changes and provide any necessary test data._
3925

40-
Testers should add his/her findings to end of the PR in a comment and include screenshots, files, etc that are beneficial.
26+
- Test A

.github/workflows/build-and-publish-base-php.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,17 @@ jobs:
1515
steps:
1616
- uses: actions/checkout@v3
1717

18-
- name: Build and tag base image
19-
run: docker build -t ${{ env.IMAGE }} -f docker/base-php/Dockerfile .
18+
- uses: docker/setup-qemu-action@v2
19+
20+
- uses: docker/setup-buildx-action@v2
21+
with:
22+
platforms: linux/amd64,linux/arm64
2023

2124
- name: Log in to Docker Hub
2225
uses: docker/login-action@v2
2326
with:
2427
username: ${{ secrets.DOCKERHUB_USERNAME }}
2528
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}
2629

27-
- name: Publish image
28-
run: |
29-
docker push ${{ env.IMAGE }}
30+
- name: Build, tag and push image
31+
run: docker buildx build --push --platform linux/amd64,linux/arm64 -t ${{ env.IMAGE }} -f docker/base-php/Dockerfile .

.github/workflows/e2e-tests.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Run E2E tests
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
e2e-tests:
8+
name: ${{matrix.browser}} (${{ matrix.shard }}/${{ matrix.shards }})
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
browser: [chromium, firefox]
13+
shard: [1, 2, 3, 4, 5, 6]
14+
shards: [6]
15+
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
-
20+
uses: actions/checkout@v3
21+
-
22+
name: Playwright E2E Tests
23+
run: make e2e-tests-ci browser=${{ matrix.browser }} shard="${{ matrix.shard }}/${{ matrix.shards }}"
24+
-
25+
name: Upload Playwright test results
26+
if: always()
27+
uses: actions/upload-artifact@v3
28+
with:
29+
name: test-results-${{ matrix.browser }}-${{ matrix.shard }}
30+
path: test/e2e/test-results
31+
if-no-files-found: error
32+
33+
e2e-tests-result:
34+
if: always()
35+
runs-on: ubuntu-latest
36+
needs: e2e-tests
37+
steps:
38+
- name: Check aggregated E2E result
39+
if: ${{ needs.e2e-tests.result != 'success' }}
40+
run: |
41+
echo "Some E2E tests failed"
42+
exit 1

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

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -74,17 +74,6 @@ jobs:
7474
-
7575
name: Unit Tests
7676
run: make unit-tests-ci
77-
-
78-
name: Playwright E2E Tests
79-
run: make e2e-tests-ci
80-
-
81-
name: Upload Playwright test results
82-
if: always()
83-
uses: actions/upload-artifact@v3
84-
with:
85-
name: test-results
86-
path: test/e2e/test-results
87-
if-no-files-found: error
8877
-
8978
name: Log in to Docker Hub
9079
uses: docker/login-action@v2
@@ -109,10 +98,13 @@ jobs:
10998
IMAGE_NEXT_APP: ${{ steps.image.outputs.NAMESPACE }}:${{ steps.image.outputs.TAG_NEXT_APP }}
11099
IMAGE_LFMERGE: ${{ steps.image.outputs.LFMERGE_NAMESPACE }}:${{ steps.image.outputs.TAG_LFMERGE }}
111100

101+
e2e-tests:
102+
uses: ./.github/workflows/e2e-tests.yml
103+
112104
deploy:
113105
runs-on: [self-hosted, languageforge]
114106

115-
needs: integrate
107+
needs: [integrate, e2e-tests]
116108

117109
steps:
118110
-

.github/workflows/pull-request.yml

Lines changed: 2 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -54,45 +54,8 @@ jobs:
5454
github_token: ${{ github.token }}
5555
junit_files: PhpUnitTests.xml
5656

57-
build-app-run-e2e-tests:
58-
runs-on: ubuntu-latest
59-
60-
steps:
61-
-
62-
uses: actions/checkout@v3
63-
-
64-
uses: actions/setup-node@v3
65-
with:
66-
node-version: '16.14.0'
67-
cache: 'npm'
68-
-
69-
name: Get installed Playwright version
70-
id: playwright-version
71-
run: echo -n "version=$(npm ls @playwright/test --json | jq --raw-output '.version')" >> $GITHUB_OUTPUT
72-
-
73-
name: Cache playwright browsers
74-
uses: actions/cache@v3
75-
id: playwright-cache
76-
with:
77-
path: '~/.cache/ms-playwright'
78-
# Make each playwright version use its own cache in case it uses different browser versions
79-
# Cache entries are deleted if not accessed for 7 days
80-
# https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#usage-limits-and-eviction-policy
81-
key: 'playwright-${{ steps.playwright-version.outputs.version }}'
82-
83-
-
84-
name: Playwright E2E Tests
85-
# see https://playwright.dev/docs/ci#github-actions
86-
run: make e2e-tests-ci
87-
88-
-
89-
name: Upload Playwright test results
90-
if: always()
91-
uses: actions/upload-artifact@v3
92-
with:
93-
name: test-results
94-
path: test/e2e/test-results
95-
if-no-files-found: error
57+
e2e-tests:
58+
uses: ./.github/workflows/e2e-tests.yml
9659

9760
check-code-formatting:
9861
runs-on: ubuntu-latest

.prettierignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ next-app/**/.env.*
3838

3939
## Extras
4040
# Libraries and generated code
41-
src/js/lib/
4241
src/Site/views/languageforge/theme/default/page/home/assets/
4342
*.generated-data.*
4443

Makefile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ ui-builder:
1616
e2e-tests-ci:
1717
npm ci
1818
$(MAKE) e2e-app
19-
npx playwright install chromium
20-
npx playwright test -c ./test/e2e/playwright.config.ts
19+
npx playwright install ${browser} --with-deps
20+
npx playwright test -c ./test/e2e/playwright.config.ts --project=${browser} --shard=${shard}
2121

2222
.PHONY: e2e-tests
2323
e2e-tests: ui-builder
2424
npm install
2525
$(MAKE) e2e-app
26-
npx playwright install chromium
26+
npx playwright install chromium firefox
2727
npx playwright test -c ./test/e2e/playwright.config.ts $(params)
2828

2929
.PHONY: e2e-app
@@ -67,6 +67,11 @@ build-next:
6767
build-base-php:
6868
docker build -t sillsdev/web-languageforge:base-php -f docker/base-php/Dockerfile .
6969

70+
.PHONY: composer-dev
71+
composer-dev:
72+
docker compose build composer-dev
73+
docker compose run composer-dev
74+
7075
.PHONY: clean
7176
clean:
7277
docker compose down

docker-compose.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ services:
3030
- ENVIRONMENT=development
3131
image: lf-app
3232
container_name: lf-app
33-
platform: linux/amd64
3433
depends_on:
3534
- db
3635
- mail
@@ -243,7 +242,6 @@ services:
243242
- ENVIRONMENT=development
244243
image: lf-e2e-app
245244
container_name: e2e-app
246-
platform: linux/amd64
247245
depends_on:
248246
- db
249247
- mail
@@ -288,19 +286,26 @@ services:
288286
- MONGODB_CONN=mongodb://db:27017
289287
- MAIL_HOST=mail
290288
- LANGUAGE_DEPOT_API_TOKEN=bogus-development-token
291-
# Note: Uncomment to enable XDebug in Unit Tests. The default mode is "off".
292-
# These lines are commented out as this XDebug setup causes CI failures.
293-
# XDebug is intended for local development only. Uncomment the following 3 lines:
294-
# - XDEBUG_MODE=develop,debug
295-
# extra_hosts:
296-
# - "host.docker.internal:host-gateway"
289+
- XDEBUG_MODE=develop,debug
290+
# used by XDebug
291+
extra_hosts:
292+
- "host.docker.internal:host-gateway"
297293
command: sh -c "/wait && /run.sh"
298294
volumes:
299295
# for developer convenience
300296
- ./test:/var/www/test
301297
- ./src/Api:/var/www/src/Api
302298
- ./src/Site:/var/www/src/Site
303299

300+
composer-dev:
301+
build:
302+
dockerfile: docker/composer-dev/Dockerfile
303+
image: lf-composer-dev
304+
container_name: lf-composer-dev
305+
volumes:
306+
- ./src/composer.json:/work/composer.json
307+
- ./src/composer.lock:/work/composer.lock
308+
304309
volumes:
305310
lf-caddy-config:
306311
lf-caddy-data:

docker/base-php/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ RUN apt-get update && apt-get -y install p7zip-full unzip curl tini ffmpeg && rm
1010
# see https://github.com/mlocati/docker-php-extension-installer
1111
# PHP extensions required by the LF application
1212
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
13-
RUN install-php-extensions gd mongodb intl
13+
RUN install-php-extensions mongodb intl
1414

1515
# php customizations
1616
COPY docker/base-php/customizations.php.ini $PHP_INI_DIR/conf.d/

docker/composer-dev/Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM sillsdev/web-languageforge:base-php
2+
3+
4+
WORKDIR /work
5+
ENV COMPOSER_ALLOW_SUPERUSER=1
6+
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/* \
7+
&& install-php-extensions @composer
8+
COPY src/composer.json src/composer.lock /work/
9+
10+
CMD ["bash"]

docker/db/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
> https://www.mongodb.com/docs/v4.4/mongo
1818
19-
`mongo` within `db` container
19+
`mongosh` within `db` container
2020

2121
> https://www.mongodb.com/docs/manual/reference/mongo-shell/#command-helpers
2222

docker/test-php/Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/* \
99
COPY src/composer.json src/composer.lock /var/www/html/
1010
RUN composer install
1111

12-
# uncomment if you want xdebug in your local image
13-
#RUN install-php-extensions xdebug
14-
#COPY docker/app/docker-php-ext-xdebug.ini /usr/local/etc/php/conf.d
12+
RUN install-php-extensions xdebug
13+
COPY docker/app/docker-php-ext-xdebug.ini /usr/local/etc/php/conf.d
1514

1615
RUN mv $PHP_INI_DIR/php.ini-development $PHP_INI_DIR/php.ini
1716
COPY --from=sillsdev/web-languageforge:wait-latest /wait /wait

docker/ui-builder/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ COPY webpack.config.js webpack-dev.config.js webpack-prd.config.js tsconfig.json
1313
# copy in src local files
1414
COPY src/angular-app ./src/angular-app
1515
COPY src/appManifest ./src/appManifest
16-
COPY src/js ./src/js
1716
COPY src/json ./src/json
1817
COPY src/sass ./src/sass
1918
COPY src/Site/views ./src/Site/views

docs/DEVELOPER.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -151,14 +151,6 @@ A [tutorial on YouTube is available showing how to use XDebug and VSCode](https:
151151

152152
To debug the PHP tests, follow these steps:
153153

154-
- uncomment the 3 lines in the docker-compose.yml file related to XDebug under the service section `test-php`:
155-
156-
```
157-
- XDEBUG_MODE=develop,debug
158-
extra_hosts:
159-
- "host.docker.internal:host-gateway
160-
```
161-
162154
- In VS Code, set a breakpoint on a line of code in one of the PHP tests (in the `test/php` folder)
163155
- Click on the `Run and Debug` area of VS Code, then click the green play icon next to `XDebug` in the configuration dropdown.
164156

docs/RELEASE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Since database upgrades are so infrequent, require extra care and a brief outage
6161
1. `make scale-down` and ensure all containers are stopped. It's also a good idea to watch the logs for the `db` container ensuring the shutdown was "clean".
6262
1. `make deploy-db` and ensure configs are applied to the deployment
6363
1. `make scale-up` and ensure all containers start back up. It's also a good idea to watch the logs for the `db` container ensuring the startup was "clean" and the new version is actually running.
64-
1. Verify that the running MongoDB version is in fact the version you expect. Connecting to QA or PROD mongo instance using the `mongo` client should confirm this (the server version is printed when you connect). You can also check the image name of the deployment you are inspecting.
64+
1. Verify that the running MongoDB version is in fact the version you expect. Connecting to QA or PROD mongo instance using the `mongosh` client should confirm this (the server version is printed when you connect). You can also check the image name of the deployment you are inspecting.
6565
1. Run the `db.adminCommand( { getParameter: 1, featureCompatibilityVersion: 1 } )` command to verify that feature version is set to the previous db version
6666
1. Ensure a recent backup of the mongo databases was successful and is available in case a restore/revert is necessary.
6767
1. To perform the actual upgrade run `db.adminCommand( { setFeatureCompatibilityVersion: "5.0" } )` Change the version to the desired new version number. This operation may take some time to complete as it may trigger an internal data migration on existing collections.

next-app/README-Tech.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,11 @@ Of course choosing tailwindcss comes with a number of criticisms but we believe
7171
7272
1. The codebase can be kept free of class clutter by simply utlizing `@apply` in the `<style>` section of our `.svelte` files but when doing this a couple of things need to be taken into consideration:
7373
74-
> modifiers are not supported in `@apply` without additional `preprocess` and `postcss` configuration and increased specificity can sometimes cause problems when class overrides are needed on an element directly.
74+
> modifiers are not supported in `@apply` without additional `preprocess` and `postcss` configuration and increased specificity can sometimes cause problems when class overrides are needed on an element directly. See [Warn: Unused CSS selector](https://github.com/saadeghi/daisyui/discussions/1490) for some elaboration. We do still use the `@apply` in a component but not scoped, simply for an organizational benefit, see `/next-app/src/lib/forms/Form.svelte`
7575
7676
2. We will inevitably have situations where parent components or views will want to pass styles down to children. This is very common and requires writing global classes anyway. Using something like tailwindcss or bootstrap takes all of that work off of our plate. Unused CSS will still get purged by the compiler so the app doesn't take on unnecessary bloat.
7777
3. daisyUI is built upon tailwindcss anyway so we benefit from using it in both situations.
7878
79-
[ ] Confirm no additional configuration is required to purge unused CSS.
80-
8179
#### daisyUI
8280
8381
With such a small team, we were always going to need a well thought-out UI library to keep us from having to make a bunch of design decisions along the way. While there are a handful of Svelte-based libraries, none of them met the criteria necessary to help make our team as efficient as possible. There were many mature UI systems already in place built upon tailwindcss and daisyUI represents one of the best of the ones we looked at in it's goal of further simplifying the use of tailwindcss. Additionally, daisyUI has already integrated many best practices and opinions in its design decisions.

0 commit comments

Comments
 (0)