Skip to content

Commit

Permalink
[RND-653] Refactor Config file to not require mongodb URI (#326)
Browse files Browse the repository at this point in the history
  • Loading branch information
andonyns authored Nov 21, 2023
1 parent 0c08a8f commit f9dcbff
Show file tree
Hide file tree
Showing 16 changed files with 141 additions and 85 deletions.
38 changes: 19 additions & 19 deletions .github/workflows/on-pullrequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ jobs:
uses: ed-fi-alliance-oss/ed-fi-actions/.github/workflows/repository-scanner.yml@main

upgrade:
# Upgrade packages on PR only to avoid a double update when pushed to main
name: Upgrade packages
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
defaults:
run:
Expand All @@ -45,27 +43,29 @@ jobs:
with:
fetch-depth: 0w

- name: Get changes
id: changes
- name: Get version changes
id: versions
run: |
suggested=v$(cat lerna.json | jq -r .version)
current=$(git describe --tags $(git rev-list --tags --max-count=1))
echo "Versions: Lerna: $suggested. Current: $current"
echo "changes=$([[ "$suggested" != "$current" ]] && echo true)" >>$GITHUB_OUTPUT
if [ ${{ github.event_name }} == 'pull_request' ]; then
suggested=v$(cat lerna.json | jq -r .version)
current=$(git describe --tags $(git rev-list --tags --max-count=1))
echo "Versions: Lerna: $suggested. Current: $current"
echo "update-required=$([[ "$suggested" == "$current" ]] && echo true)" >>$GITHUB_OUTPUT
fi
- name: Update versions
if: ${{ ! steps.changes.outputs.changes }}
if: steps.versions.outputs.update-required
run: npx [email protected] version prerelease --exact --no-git-tag-version --yes

- name: Set Version
if: ${{ ! steps.changes.outputs.changes }}
if: steps.versions.outputs.update-required
id: set-version
run: |
version=v$(cat lerna.json | jq -r .version)
echo "version=$version" >> "$GITHUB_OUTPUT"
- uses: planetscale/ghcommit-action@4131649dbf2fdf1eb34421702972a5af7b0a8731 #v0.1.18
if: ${{ ! steps.changes.outputs.changes }}
if: steps.versions.outputs.update-required
with:
commit_message: "${{steps.set-version.outputs.version}}"
repo: ${{ github.repository }}
Expand Down Expand Up @@ -159,7 +159,7 @@ jobs:
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}

- name: Install dependencies
if: ${{ steps.modules-cache.outputs.cache-hit != 'true' }}
if: steps.modules-cache.outputs.cache-hit != 'true'
run: npm install

- name: Linter
Expand Down Expand Up @@ -189,7 +189,7 @@ jobs:
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}

- name: Install dependencies
if: ${{ steps.modules-cache.outputs.cache-hit != 'true' }}
if: steps.modules-cache.outputs.cache-hit != 'true'
run: npm install

- name: Build
Expand Down Expand Up @@ -223,7 +223,7 @@ jobs:
cache-dependency-path: "**/package-lock.json"

- name: Load MongoDB binary cache
if: ${{ matrix.tests.type != 'Unit' }}
if: matrix.tests.type != 'Unit'
id: cache-mongodb-binaries
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 #v3.3.2
with:
Expand All @@ -238,7 +238,7 @@ jobs:
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}

- name: Install dependencies
if: ${{ steps.modules-cache.outputs.cache-hit != 'true' }}
if: steps.modules-cache.outputs.cache-hit != 'true'
run: npm install

- name: Jest cache
Expand All @@ -249,7 +249,7 @@ jobs:
key: ${{ runner.os }}-jest-${{ hashFiles('**/package-lock.json') }}

- name: Configure postgres
if: ${{ matrix.tests.type != 'Unit' }}
if: matrix.tests.type != 'Unit'
run: |
sudo systemctl start postgresql.service
sudo -u postgres psql -U postgres -c "alter user postgres with password '${{env.POSTGRES_PASSWORD}}';"
Expand Down Expand Up @@ -287,7 +287,7 @@ jobs:

end-to-end:
name: End to End tests for ${{ matrix.store.db }} as store and ${{matrix.query_handler.provider}} as query handler
needs: [lint]
needs: lint
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -326,7 +326,7 @@ jobs:
echo OAUTH_SIGNING_KEY="$( openssl rand -base64 256 | tr -d '\n' )" >> .env-e2e
working-directory: Meadowlark-js/tests/e2e/setup/

- name: End to End tests for ${{matrix.store.db}} as store, ${{matrix.store.plugin}} as authorization and ${{matrix.query_handler.provider}} as query handler
- name: End to End tests for ${{matrix.store.db}} as store, ${{matrix.query_handler.provider}} as query handler
run: npm run test:e2e:build -- --ci
env:
AUTHORIZATION_STORE_PLUGIN: ${{ matrix.store.plugin }}
Expand All @@ -335,7 +335,7 @@ jobs:
LISTENER1_PLUGIN: ${{ matrix.query_handler.plugin }}

- name: Docker logs
if: ${{ failure() }}
if: failure()
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name: docker-logs
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@edfi/meadowlark-elasticsearch-backend",
"main": "dist/index.js",
"version": "0.4.0-pre.2",
"version": "0.4.0-pre.3",
"description": "Meadowlark backend plugin for elasticsearch",
"license": "Apache-2.0",
"publishConfig": {
Expand All @@ -19,8 +19,8 @@
"build:copy-non-ts": "copyfiles -u 1 -e \"**/*.ts\" \"src/**/*\" dist --verbose"
},
"dependencies": {
"@edfi/meadowlark-core": "0.4.0-pre.2",
"@edfi/meadowlark-utilities": "0.4.0-pre.2",
"@edfi/meadowlark-core": "0.4.0-pre.3",
"@edfi/meadowlark-utilities": "0.4.0-pre.3",
"@elastic/elasticsearch": "^8.10.0",
"@elastic/transport": "^8.3.4"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@edfi/meadowlark-mongodb-backend",
"main": "dist/index.js",
"version": "0.4.0-pre.2",
"version": "0.4.0-pre.3",
"description": "Meadowlark backend plugin for MongoDB",
"license": "Apache-2.0",
"publishConfig": {
Expand All @@ -19,9 +19,9 @@
"build:copy-non-ts": "copyfiles -u 1 -e \"**/*.ts\" \"src/**/*\" dist --verbose"
},
"dependencies": {
"@edfi/meadowlark-authz-server": "0.4.0-pre.2",
"@edfi/meadowlark-core": "0.4.0-pre.2",
"@edfi/meadowlark-utilities": "0.4.0-pre.2",
"@edfi/meadowlark-authz-server": "0.4.0-pre.3",
"@edfi/meadowlark-core": "0.4.0-pre.3",
"@edfi/meadowlark-utilities": "0.4.0-pre.3",
"async-retry": "^1.3.3",
"mongodb": "^5.9.0",
"ramda": "0.29.1"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@edfi/meadowlark-opensearch-backend",
"main": "dist/index.js",
"version": "0.4.0-pre.2",
"version": "0.4.0-pre.3",
"description": "Meadowlark backend plugin for OpenSearch",
"license": "Apache-2.0",
"publishConfig": {
Expand All @@ -19,8 +19,8 @@
"build:copy-non-ts": "copyfiles -u 1 -e \"**/*.ts\" \"src/**/*\" dist --verbose"
},
"dependencies": {
"@edfi/meadowlark-core": "0.4.0-pre.2",
"@edfi/meadowlark-utilities": "0.4.0-pre.2",
"@edfi/meadowlark-core": "0.4.0-pre.3",
"@edfi/meadowlark-utilities": "0.4.0-pre.3",
"@opensearch-project/opensearch": "^2.4.0"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
restart: always
environment:
# If username and password not provided through and env file
# default to postres/abcdefgh1!
# default to postgres/abcdefgh1!
- POSTGRES_USER=${POSTGRES_USER:-postgres}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-abcdefgh1!}
ports:
Expand All @@ -17,3 +17,7 @@ services:
volumes:
meadowlark-pgsql:
driver: local

networks:
meadowlark-net:
external: true
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@edfi/meadowlark-postgresql-backend",
"main": "dist/index.js",
"version": "0.4.0-pre.2",
"version": "0.4.0-pre.3",
"description": "Meadowlark backend plugin for PostgreSQL",
"license": "Apache-2.0",
"publishConfig": {
Expand All @@ -19,9 +19,9 @@
"build:copy-non-ts": "copyfiles -u 1 -e \"**/*.ts\" \"src/**/*\" dist --verbose"
},
"dependencies": {
"@edfi/meadowlark-authz-server": "0.4.0-pre.2",
"@edfi/meadowlark-core": "0.4.0-pre.2",
"@edfi/meadowlark-utilities": "0.4.0-pre.2",
"@edfi/meadowlark-authz-server": "0.4.0-pre.3",
"@edfi/meadowlark-core": "0.4.0-pre.3",
"@edfi/meadowlark-utilities": "0.4.0-pre.3",
"pg": "^8.11.3",
"pg-format": "^1.0.4",
"ramda": "0.29.1"
Expand Down
2 changes: 1 addition & 1 deletion Meadowlark-js/lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"packages": [
"packages/*"
],
"version": "0.4.0-pre.2",
"version": "0.4.0-pre.3",
"npmClient": "npm",
"useWorkspaces": true
}
50 changes: 25 additions & 25 deletions Meadowlark-js/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Meadowlark-js/packages/meadowlark-authz-server/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@edfi/meadowlark-authz-server",
"main": "dist/index.js",
"version": "0.4.0-pre.2",
"version": "0.4.0-pre.3",
"description": "Meadowlark authorization server",
"license": "Apache-2.0",
"publishConfig": {
Expand All @@ -14,7 +14,7 @@
],
"dependencies": {
"@apideck/better-ajv-errors": "^0.3.6",
"@edfi/meadowlark-utilities": "0.4.0-pre.2",
"@edfi/meadowlark-utilities": "0.4.0-pre.3",
"ajv": "^8.12.0",
"dotenv": "^16.3.1",
"fast-memoize": "^2.5.2",
Expand Down
4 changes: 2 additions & 2 deletions Meadowlark-js/packages/meadowlark-core/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@edfi/meadowlark-core",
"main": "dist/index.js",
"version": "0.4.0-pre.2",
"version": "0.4.0-pre.3",
"description": "Meadowlark core functionality",
"license": "Apache-2.0",
"publishConfig": {
Expand All @@ -14,7 +14,7 @@
],
"dependencies": {
"@apideck/better-ajv-errors": "^0.3.6",
"@edfi/meadowlark-utilities": "0.4.0-pre.2",
"@edfi/meadowlark-utilities": "0.4.0-pre.3",
"@isaacs/ttlcache": "^1.4.1",
"ajv": "^8.12.0",
"ajv-formats": "^2.1.1",
Expand Down
Loading

0 comments on commit f9dcbff

Please sign in to comment.