-
Notifications
You must be signed in to change notification settings - Fork 0
Promote test to main #59
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
Merged
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
1f1db0e
Bump supertest to v7.1.1
ty2k e86018b
Add dotenv, knex, and pg dependencies
ty2k ce27f3b
Use dotenv for .env files
ty2k 2cca7ea
Add DATABASE_URL to .env.example
ty2k d637698
Add knexfile with development and production database connections
ty2k 8708a82
Use knexfile in db/index
ty2k 0b7147f
Count rows in graphemes table in API route as test of database connec…
ty2k c819465
Add database connection for test environment
ty2k 3d0f218
Warn if DATABASE_URL is undefined for CI runs
ty2k a4a80ab
Add try/catch around graphemes count in /api route
ty2k d8e2ff2
Merge pull request #54 from bcgov/feature/graphemes-api-db-connection
ty2k 17bc3b0
Build Postgres connection string from multiple environment variables
ty2k ac5bfba
Merge pull request #55 from bcgov/feature/graphemes-api-db-connection
ty2k 85b790d
Add dev OpenShift deployment YAML
ty2k 5b14d3f
Add zod to graphemes-api dependencies
ty2k bd337df
Add Language model
ty2k 06fe73b
Add /api/v1/languages endpoint
ty2k 3129d63
Fix GET /api/v1/languages/:id to match db schema
ty2k 93169cf
Merge pull request #56 from bcgov/feature/graphemes-api-db-connection
ty2k d960195
Add splitCommaSeparatedString() utility function
ty2k df64db9
Use common splitCommaSeparatedString() in LanguageSchema
ty2k 4d4b594
Return early in splitCommaSeparatedString() if trimmed input is falsy
ty2k 12254ad
Add single string test case
ty2k 78b1cfd
Merge pull request #57 from bcgov/feature/filter-empty-strings
ty2k 69217a9
Merge pull request #58 from bcgov/dev
ty2k 8251ff7
Fix DB_PASS variable name in dev deployment
ty2k 84acc79
Merge pull request #60 from bcgov/ci/db-pass-variable-name
ty2k 5f1c05a
Add splitCommaSeparatedString() test for whitespace only input
ty2k 792ad28
Merge pull request #61 from bcgov/ci/test-for-whitespace-only
ty2k fa4e5eb
Use structured log instead of string literal for case where language …
ty2k e62c8e8
Use %o parameter for error object in log
ty2k cbe806a
Merge pull request #62 from bcgov/bug/avoid-string-literal-with-user-…
ty2k e0b4092
Merge pull request #63 from bcgov/dev
ty2k 2c53ab9
Add express-rate-limit dependency to grapheme-api
ty2k 504f887
Add rate limiting middleware function
ty2k a59caf1
Fix comment
ty2k ebccf0f
Use environment variables for rate limit values
ty2k c86c306
Add rate limit configuration environment variables
ty2k 3df29de
Merge pull request #64 from bcgov/feature/api-rate-limiting
ty2k 650d402
Merge pull request #65 from bcgov/dev
ty2k File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,11 @@ | ||
| # Postgres database connection | ||
| DB_HOST= | ||
| DB_NAME= | ||
| DB_PASS= | ||
| DB_PORT= | ||
| DB_USER= | ||
|
|
||
| # Express API server configuration | ||
| PORT= | ||
| RATE_LIMIT_MAX= | ||
| RATE_LIMIT_WINDOW_MS= |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| --- | ||
| kind: Deployment | ||
| apiVersion: apps/v1 | ||
| metadata: | ||
| name: graphemes-api | ||
| namespace: f343b4-dev | ||
| labels: | ||
| app: graphemes-api | ||
| app.kubernetes.io/component: graphemes-api | ||
| app.kubernetes.io/instance: graphemes-api | ||
| app.kubernetes.io/name: graphemes-api | ||
| app.kubernetes.io/part-of: graphemes-api | ||
| app.openshift.io/runtime: nodejs | ||
| app.openshift.io/runtime-namespace: f343b4-tools | ||
| app.openshift.io/runtime-version: dev | ||
| annotations: | ||
| alpha.image.policy.openshift.io/resolve-names: "*" | ||
| app.openshift.io/route-disabled: "false" | ||
| deployment.kubernetes.io/revision: "1" | ||
| image.openshift.io/triggers: '[{"from":{"kind":"ImageStreamTag","name":"graphemes-api:dev","namespace":"f343b4-tools"},"fieldPath":"spec.template.spec.containers[?(@.name==\"graphemes-api\")].image","paused":"false"}]' | ||
| openshift.io/generated-by: OpenShiftWebConsole | ||
| spec: | ||
| replicas: 2 | ||
| selector: | ||
| matchLabels: | ||
| app: graphemes-api | ||
| template: | ||
| metadata: | ||
| creationTimestamp: null | ||
| labels: | ||
| app: graphemes-api | ||
| deployment: graphemes-api | ||
| annotations: | ||
| openshift.io/generated-by: OpenShiftWebConsole | ||
| spec: | ||
| containers: | ||
| - name: graphemes-api | ||
| image: "image-registry.openshift-image-registry.svc:5000/f343b4-tools/graphemes-api:dev" | ||
| ports: | ||
| - containerPort: 3000 | ||
| protocol: TCP | ||
| env: | ||
| - name: DB_HOST | ||
| valueFrom: | ||
| secretKeyRef: | ||
| name: crunchy-postgres-pguser-graphemes-api-user | ||
| key: pgbouncer-host | ||
| - name: DB_PORT | ||
| valueFrom: | ||
| secretKeyRef: | ||
| name: crunchy-postgres-pguser-graphemes-api-user | ||
| key: pgbouncer-port | ||
| - name: DB_USER | ||
| valueFrom: | ||
| secretKeyRef: | ||
| name: crunchy-postgres-pguser-graphemes-api-user | ||
| key: user | ||
| - name: DB_PASS | ||
| valueFrom: | ||
| secretKeyRef: | ||
| name: crunchy-postgres-pguser-graphemes-api-user | ||
| key: password | ||
| - name: DB_NAME | ||
| # This is a literal value because `crunchy-postgres` | ||
| # is the default database name in the PostgresCluster. | ||
| # This database name does not appear in the Secret. | ||
| value: grapheme_v2 | ||
| resources: {} | ||
| terminationMessagePath: /dev/termination-log | ||
| terminationMessagePolicy: File | ||
| imagePullPolicy: IfNotPresent | ||
| restartPolicy: Always | ||
| terminationGracePeriodSeconds: 30 | ||
| dnsPolicy: ClusterFirst | ||
| securityContext: {} | ||
| schedulerName: default-scheduler | ||
| strategy: | ||
| type: RollingUpdate | ||
| rollingUpdate: | ||
| maxUnavailable: 25% | ||
| maxSurge: 25% | ||
| revisionHistoryLimit: 10 | ||
| progressDeadlineSeconds: 600 | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Hardcoding the database name in the manifest can lead to drift and exposes configuration details. Consider sourcing
DB_NAMEfrom a secret or ConfigMap to centralize environment configuration.