Skip to content
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

Chore/1824 format all the files with prettier #691

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 7 additions & 18 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ orbs:
defaults: &defaults
working_directory: ~/repo


jobs:
test:
<<: *defaults
Expand Down Expand Up @@ -44,7 +43,6 @@ jobs:
paths:
- node_modules


smoke:
<<: *defaults
machine:
Expand All @@ -70,14 +68,13 @@ jobs:
COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker-compose build --no-cache lists apply
docker ps


- run:
name: build scheduler images
command: |
docker-compose build scheduler-batch && docker-compose build scheduler-annual-review-worker

- run:
name: run lists
name: run lists
command: |
docker-compose up -d lists apply
docker ps
Expand Down Expand Up @@ -107,13 +104,10 @@ jobs:
name: Run smoke tests
command: npm run smoke-tests


# store videos so they are accessible via circleci UI. You must turn on video recording via cypress.config.ts first (video: true).
# - store_artifacts:
# path: ~/repo/cypress/videos
# destination: videos


# store videos so they are accessible via circleci UI. You must turn on video recording via cypress.config.ts first (video: true).
# - store_artifacts:
# path: ~/repo/cypress/videos
# destination: videos

publish:
<<: *defaults
Expand Down Expand Up @@ -365,7 +359,6 @@ workflows:
- VPN
- AWS


- publish:
name: publish-lists-apply
app: lists-apply
Expand All @@ -379,7 +372,6 @@ workflows:
- VPN
- AWS


- publish:
name: publish-lists-postgres
app: lists-postgres
Expand All @@ -388,13 +380,12 @@ workflows:
only: /v[0-9]+(\.[0-9]+)*/
branches:
only:
# - deploy-test
# - deploy-test
- deploy-db
context:
- VPN
- AWS


- publish:
name: publish-lists-scheduler-batch
app: lists-scheduler-batch
Expand All @@ -408,7 +399,6 @@ workflows:
- VPN
- AWS


- publish:
name: publish-lists-scheduler-worker
app: lists-scheduler-worker
Expand All @@ -422,7 +412,6 @@ workflows:
- VPN
- AWS


- deploy:
name: deploy-test
namespace: test-lists
Expand All @@ -434,7 +423,7 @@ workflows:
- publish-lists-apply
- publish-lists-scheduler-batch
- publish-lists-scheduler-worker
# - publish-lists-postgres
# - publish-lists-postgres
filters:
branches:
only:
Expand Down
6 changes: 5 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ module.exports = {
{
files: ["*.ts", "*.tsx"],
parserOptions: {
project: ["tsconfig.json"],
project: ["./tsconfig.json"],
},
},
],
parserOptions: {
project: ["./tsconfig.json"],
},
rules: {
"prettier/prettier": 1,
"no-console": ["error"],
Expand Down Expand Up @@ -41,5 +44,6 @@ module.exports = {
"src/form-runner/form-runner-app/",
"src/**/*.spec.ts",
"src/**/*.test.ts",
"cypress/support/step_definitions/**/*.js",
],
};
58 changes: 29 additions & 29 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ name: "CodeQL"

on:
push:
branches: [ master ]
branches: [master]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
branches: [master]
schedule:
- cron: '28 18 * * 1'
- cron: "28 18 * * 1"

jobs:
analyze:
Expand All @@ -28,40 +28,40 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
language: ["javascript"]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release
#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
45 changes: 22 additions & 23 deletions .github/workflows/ossar-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ name: OSSAR

on:
push:
branches: [ master ]
branches: [master]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
branches: [master]
schedule:
- cron: '41 0 * * 1'
- cron: "41 0 * * 1"

jobs:
OSSAR-Scan:
Expand All @@ -19,26 +19,25 @@ jobs:
runs-on: windows-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Ensure a compatible version of dotnet is installed.
# The [Microsoft Security Code Analysis CLI](https://aka.ms/mscadocs) is built with dotnet v3.1.201.
# A version greater than or equal to v3.1.201 of dotnet must be installed on the agent in order to run this action.
# GitHub hosted runners already have a compatible version of dotnet installed and this step may be skipped.
# For self-hosted runners, ensure dotnet version 3.1.201 or later is installed by including this action:
# - name: Install .NET
# uses: actions/setup-dotnet@v1
# with:
# dotnet-version: '3.1.x'
- name: Checkout repository
uses: actions/checkout@v2

# Ensure a compatible version of dotnet is installed.
# The [Microsoft Security Code Analysis CLI](https://aka.ms/mscadocs) is built with dotnet v3.1.201.
# A version greater than or equal to v3.1.201 of dotnet must be installed on the agent in order to run this action.
# GitHub hosted runners already have a compatible version of dotnet installed and this step may be skipped.
# For self-hosted runners, ensure dotnet version 3.1.201 or later is installed by including this action:
# - name: Install .NET
# uses: actions/setup-dotnet@v1
# with:
# dotnet-version: '3.1.x'
# Run open source static analysis tools
- name: Run OSSAR
uses: github/ossar-action@v1
id: ossar
- name: Run OSSAR
uses: github/ossar-action@v1
id: ossar

# Upload results to the Security tab
- name: Upload OSSAR results
uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: ${{ steps.ossar.outputs.sarifFile }}
# Upload results to the Security tab
- name: Upload OSSAR results
uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: ${{ steps.ossar.outputs.sarifFile }}
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Ignore all NJK files:
**/*.njk
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ The lists server depends on [XGovFormBuilder/digital-form-builder](https://githu
to deploy form journeys for data ingestion. The base docker images for the form runner have already been built.

**To add new forms:**

1. Add or replace a form configuration in `docker/apply/forms-json/`
2. The form runner will create a new route matching the file name.
i.e. adding `lawyers.json` would make a form available at `lists-apply:3001/lawyers`

i.e. adding `lawyers.json` would make a form available at `lists-apply:3001/lawyers`

To start the form runner

```sh
$ docker compose -f docker-compose.ci.yml up apply
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ async function createListPublishedItem() {
type: "PUBLISHED",
time: publishedDate,
jsonData: {},
}
},
],
},
},
Expand Down Expand Up @@ -125,7 +125,7 @@ async function createListUnpublishedItem() {
type: "PUBLISHED",
time: publishedDate,
jsonData: {},
}
},
],
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ When("a list item has been edited by the provider {int} days ago", (days) => {
status: "EDITED",
jsonData: {
emailAddress: "test@test.com",
contactName: "Buster"
contactName: "Buster",
},
list: {
connect: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Then("the list item should be deleted", () => {
operation: "listItem.findFirst",
variables: {
where: {
reference: "AUTO_DELETE"
reference: "AUTO_DELETE",
},
},
}).then((listItem) => {
Expand All @@ -13,12 +13,12 @@ Then("the list item should be deleted", () => {
operation: "audit.findMany",
variables: {
where: {
auditEvent: "DELETED"
auditEvent: "DELETED",
},
orderBy: { id: 'desc' }
orderBy: { id: "desc" },
},
}).then((auditEvents) => {
cy.log(auditEvents)
cy.log(auditEvents);
const { notes } = auditEvents[0].jsonData;
const expectedValue = ["automated", "deleted due to non-response to annual review for over a year"];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Then("the list item should not be deleted", () => {
operation: "listItem.findFirst",
variables: {
where: {
reference: "AUTO_DELETE"
reference: "AUTO_DELETE",
},
},
}).then((listItem) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable */
const TOTAL_NO_UNPUBLISH_WEEKS = 5
const TOTAL_NO_UNPUBLISH_WEEKS = 5;
Then("the reminder email for {string} weeks is sent to eligible providers", async (noOfWeeks) => {
cy.task("db", {
operation: "list.findFirst",
Expand All @@ -18,7 +18,9 @@ Then("the reminder email for {string} weeks is sent to eligible providers", asyn
{
jsonData: {
path: ["notes"],
equals: [`sent reminder for week ${noOfWeeks}. (${TOTAL_NO_UNPUBLISH_WEEKS - noOfWeeks} until unpublish date)`],
equals: [
`sent reminder for week ${noOfWeeks}. (${TOTAL_NO_UNPUBLISH_WEEKS - noOfWeeks} until unpublish date)`,
],
},
},
{
Expand All @@ -32,6 +34,6 @@ Then("the reminder email for {string} weeks is sent to eligible providers", asyn
},
}).then((result) => {
cy.expect(result.length).to.be.gt(0);
})
})
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Given("the list is in annual review", () => {
reference: "ANNUAL_REVIEW_REF",
},
},
nextAnnualReviewStartDate: new Date()
nextAnnualReviewStartDate: new Date(),
},
},
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
When("I click the link {string} for {string}", (link, country) => {
cy.findByText(country).parent().findByText(link).click()
cy.findByText(country).parent().findByText(link).click();
});
Loading
Loading