Граф коммитов

49 Коммитов

Автор SHA1 Сообщение Дата
Vincent 045dfa6712 Only lint l10n files in GitHub Actions
The CircleCI job was redundant with the GitHub Actions workflow
`reference_linter.yaml`.
2023-08-16 20:46:07 +02:00
Vincent b56993359e
Merge Next.js into `main` (#3116)
* Initialise Next.js app using create-next-app

Command run: npx create-next-app@latest

* Also tell VSCode to format TS and TSX files

* WIP: Sign in with next-auth

* Add Fluent

Unfortunately, since the ReactLocalization object contains
functions, it can't be shared between client and server (because
functions can't be serialized), so in effect every page that uses
localisation has to be a client component.

But at least we can set the correct `lang` attribute on <html> on
the server, so there's that :)

* Copy-paste public breach scan into Next.js

* Halfway migrate public breach list

Did not do: breach icons and getLocale() (for list and date
formatting).

* Enable SSR for localised strings

This allows our pages to be Server Components now.

* Download breach logos in Next.js server

* Tell search engines not to index non-prod envs

* Port existing security headers from Helmet to Next

* Add a 404 page

* Relax CSP in local development

* Set up Next-Auth for server components

It still doesn't work at the moment because the correct redirect
URL hasn't yet been set up on FxA.

* Apply Prettier to Next.js files on commit

* Enable Sass

* feat: Port existing landing page

* fix: Set hibp footer as html

* Wire up Next.js to FxA using iron-session

* feat: Port main layout for authenticated pages

* chore: Get session in layout

* Set up Prettier for VSCode users

* fix: Provide fxa user menu with data

* chore: Format Create Next App template

* Make Next-Auth work with FxA

To test, add the following two variables to your .env:

  NEXTAUTH_URL=http://localhost:6060
  NEXTAUTH_SECRET=<generate using `openssl rand -base64 32`>

You can then add <SignInButton/> to e.g. the landing page to kick
off authentication.

* Port breach-detail page to Next.js

* Add pending translations

* Access session data in React components

* Use Prettier as the formatter in VSCode

* Port Nebula & Protocol tokens into tokens file

* merge: Resolve conflicts

* fix: Move hr into li element

* feat: Handle authenticated users

* chore: Add todo note

* chore: Don’t use default exports for SignInButton and UserMenu

* chore: Move site navigation to client-side component

* Make mozlog work with Next.js

Unfortunately, this required patching the `intel` package. That
said, since that package hasn't been updated in six years, this
should be relatively safe.

The problem is that `intel` was trying to dynamically determine
which modules to load based on which files were present in its
directory. However, since Next.js moves (and presumably bundles)
Node modules into the `.next` folder, it was unable to find the
modules that `mozlog` was expecting to use.

The patch fixes this by simply explicitly importing those four
modules.

* Add back a couple of authentication logs

* add woff files and metropolis css file

* add right font path

* format scss file to include camelcase

* chore: Move components into (nextjs_migration) and remove redundant layout file

* chore: Remove redirect landing page -> dashboard

* chore: Redirect to dashboard upon signin

* add title and body copy variables

* use token variables in landing scss file instead of old variables from variables.css

* feat: Add basic dashboard page elements

* chore: Add circle chart web component

* chore: Add custom select web component

* breaches get and put calls

* cleanup

* get rid of debug logs

* Add sentry to nextJS branch (#3075)

MNTOR-1641 - enable Sentry for NextJS, for front- and back-end code

* chore: Render user breaches

* feat: Port breach resolution api

* fix: Check breach resolution filter by default

* chore: Add redirect /user/dashboard -> /user/breaches

* feat: Add breach page types

* chore: Remove breach resolution API call headers

* fix: Rename changed API response data key

* add template button component

* remove assets

* add button styling

* chore: Trigger auto signIn for pages that require authentication

* chore: Update breach types

* chore: Repurpose HIBP BreachDataTypes

* chore: Don’t capitalize first letter of chart label

* chore: Remove duplicate font size

* chore: Rename BreachResolutionApiBody -> BreachResolutionRequest

* Add a redirect from /security-tips for Next.js

This was already present in the Express-based website.

* Add the app shell for the React-based website

* chore: Re-enable gtag

* use old font code and add status pill component

* remove unnecessary package additions and style status pills

* lint

* test exposurecard data func

* MNTOR-1765 - set title, favicon, and meta tag correctly for nextjs app (#3082)

* Port unsubscribe-monthly page to Next.js

* add toggle to exposurecard accordion

* add icons to exposure type

* Ease transition from `getMessage`

This adds a `getStringLookup` API to ease the transition from old
Fluent functions (which depend on the user's locale being stored in
AsyncLocalStorage). It will behave the same as the old getMessage()
when called as-is, but when passed an instance of ReactLocalization
(which we have access to in Next.js routes), it will retrieve the
localised string from that.

* Add preliminary Subscriber table type definition

* Process new user sign-in

This does a couple of things:
- It updates the code that sends the breach check email on
  first sign-in to pass an instance of ReactLocalization.
- It splits session data and JWT properties to separate data
  provided to use by FxA from data we store in our own database.
- It checks if the user that signs in is already known in our
  database, and if not, it adds them. It does so using mostly the
  same code as in /src/controllers/auth.js's `confirmed` function.

* dockerflow endpoints

* remove introduction.mdx for now, refine button states

* apply some changes

* Move new components out of migration dir

* Delete .bash_profile

* Delete storybook.log

* Delete main.js

* Delete preview.js

* remove use of inter for now

* feat: add email api

* feat: remove email api

* verify email

* update comms options

* light refactoring

* take shared function out to util

* send verification email

* add another property to EmailRow

* add some types

* rename route

* fix review comment

* Fix MNTOR-1634: Stub /settings page (auth)

* Remove commented code, add CSS, match HTML markup from previous iterations

* Remove/comment out logic dependent on session info

* Wire up settings page and new APIs

* Work around radio button unchecking on page load

* Adding a catch all 404

Not ideal but the best solution at the moment

Co-authored-by: Vincent <Vinnl@users.noreply.github.com>

* version route

* remove log

* Port admin pages to Next.js

The Notification email doesn't work yet, because it's not clear yet
how to trigger the Cloud Function.

* Add Storybook build output folder to gitignore

* Set up Netlify

* Group Storybook ignores together

* add node env

Co-authored-by: Vincent <Vinnl@users.noreply.github.com>

* fix test

* fix npm test

* fix css lint

* fix lint js

* exclude sentry.*

* Set up the actual linting we'll use

* Prettier-ignore appropriate files, format the rest

* Fix/ignore ESLint and TypeScript errors

* Make tests work with getStringLookup

* Remove now-unused dependencies and build scripts

* Update CI scripts for Next.js

* Add missing Next.js dependencies to the lockfile

These were added when running `next build`.

* Tag Next.js migration TODOs

* Make "add email" dialog work on dashboard

* Load client-side scripts as modules

This is the same the old website did, and avoids e.g. different
`init` functions overriding each other.

* Fix loading of FxA avatar

* Use <BreachLogo> component

* Allow Next.js's inline scripts/styles in prod

For `style-src`, the current website already enables
'unsafe-inline'. For script-src, it looks like we currently cannot
avoid that: https://github.com/vercel/next.js/discussions/51039

* Debug Playwright (#3118)

---------

Co-authored-by: Florian Zia <zia.florian@gmail.com>
Co-authored-by: Kaitlyn <kandres@mozilla.com>
Co-authored-by: Joey Zhou <jozhou@mozilla.com>
Co-authored-by: Robert Helmer <rhelmer@mozilla.com>
Co-authored-by: maxxcrawford <maxx.crawford@gmail.com>
2023-06-12 13:35:35 -07:00
Joey Zhou 51951b77c8 fix yml 2023-05-05 15:18:46 -07:00
Joey Zhou 71d0305b49 fix circle ci config 2023-05-05 15:14:21 -07:00
Joey Zhou c9590e649b circle ci yaml 2023-05-02 14:51:53 -07:00
Amri Toufali 01cec87e38
fix static deploy: disable logo/CDN sync script 2023-04-27 10:25:00 -07:00
Amri Toufali 212fe07e15
disable legacy unit tests on CircleCI 2023-04-24 23:14:14 -07:00
Vincent 8d264907d7 Check type annotations in CI 2023-04-04 10:58:03 +02:00
Joey Zhou a7e91ed77e heroku fix 2023-01-04 13:40:32 -08:00
Amri Toufali 07bc245276
upgrade node from 16.17 to 18.12 2022-12-05 23:55:34 -08:00
Joey Zhou bc80a4ebe6 no more failure msg 2022-11-15 10:46:10 -08:00
Joey Zhou 7047f1b673 always force clean deploy for heroku
when main is merged
2022-11-15 10:44:21 -08:00
John Whitlock 2d925a1402
Update to node 16.17.x 2022-09-22 16:01:22 -05:00
John Whitlock c4fd5af37c
CircleCI: Add tests for PostgreSQL versions
Run unit tests against specific PostgreSQL versions, using current
CircleCI instructions for a PostgreSQL service container.
2022-09-08 13:51:28 -05:00
John Whitlock c409d74f48
Merge pull request #2622 from mozilla/fix-sentry-update-config
Fix CircleCI "deploy/Build Docker Image" step
2022-08-26 14:38:47 -05:00
John Whitlock 161a8fa7a4
Allow CircleCI deploy fail without failing build
Allow the CircleCI deploy to fail on the `git push` step but still show
the job passing. A developer will need to check the job output to see if
the deploy was successful, or check Heroku.
2022-08-25 12:28:48 -05:00
John Whitlock 65bea71143
Fix deploy/Build Docker Image
Add a missing continuation slash from changing the command from a single
to a multi-line command.
2022-08-25 11:28:05 -05:00
John Whitlock cf31ec6442
Better names for Heroku deploys 2022-08-24 11:50:33 -05:00
John Whitlock 8bf9509ff1
Add SENTRY_RELEASE to Docker image
Add the CIRCLE_TAG to the docker image as the SENTRY_RELEASE. If the
CircleCI build is for a tag, this will be set and Sentry issues will be
tagged by release.
2022-08-24 11:49:28 -05:00
John Whitlock a7093fddfc
Deploy from CircleCI to Heroku 2022-08-19 17:15:01 -05:00
Amri Toufali ba9a145e1f
update node to 16 and npm to 8 2022-06-21 22:02:30 -07:00
Amri Toufali 80b0b9f69a
remove integration tests 2022-06-21 22:00:16 -07:00
Amri Toufali 776f59cd72
fix CircleCI env-dist vars 2022-06-01 20:58:40 -07:00
Amri Toufali c29bfe3bc7
remove deprecated audit pkg and update npm scripts 2022-05-31 20:46:33 -07:00
Amri Toufali f1d6c0be6f add `main-kanary` to deploy pipeline 2022-01-05 14:07:20 -08:00
Amri Toufali 355c6c3b77 fix CircleCI tag deploy 2021-10-18 20:21:31 -07:00
Amri Toufali 72f8f49c9c fix CircleCI `deploy_static` job 2021-10-18 12:00:04 -07:00
Amri Toufali 211d818a0a
refactor and restore dockerhub deploy flow (#2348) 2021-10-18 09:10:23 -07:00
Amri Toufali 3d24595060
Migrate Travis to CircleCI (#2310)
* add lints to circleci

* delete travis config

* add circleci orbs

* update images

* update dockerfile to allow dev build

* refactor unit-tests using machine host instead of docker

* set postgres user pass to enable docker connection

* remove .env-dist quotes in values (broken syntax)

* fix broken coveralls test

* update readme

* use `npm ci` instead of redundant `npm install`

* switch integration test network mode to `host`

* specify .env path for integration test

* update lockfile

* remove docker login and obsolete jobs
2021-10-15 11:58:00 -07:00
Amri Toufali a700dc3e27 sync NPM and CircleCI versions of Node to 14.17 2021-08-31 13:35:37 -07:00
Amri Toufali 23d2f8596e
upgrade to Node 14 (#2244)
* add quotes to docker-compose port range vars

* upgrade to Node 14

* update CircleCI config to use Node 14

* upgrade dockerfiles to node 14

* update travis config for Node 14

* update npm package-lock

* upgrade node-postgres to resolve Knex error
- https://github.com/knex/knex/issues/3836

* bump Node to 14.17.5 for latest security release
- https://nodejs.org/en/blog/vulnerability/aug-2021-security-releases/

* pin Node to latest in v14
2021-08-13 13:41:31 -05:00
Micheletto 7c9dac244a
Changes Circle Configuration to use `main` branch. 2021-01-19 11:21:08 -05:00
Luke Crouch 35926ce87b fix #1962: sign into docker hub during build step 2020-10-13 09:06:01 -05:00
jrbenny35 4557a72df9 Change docker log capture for integration_tests job. 2020-07-13 10:54:55 -05:00
jrbenny35 e4863f7291 Fix command. 2020-07-09 14:43:36 -05:00
jrbenny35 ec386753c7 Change integration_test job to run even if commands fail. 2020-07-09 14:32:15 -05:00
Benjamin Forehand Jr c5c6826d46
Add log storing to circleci integration tests builds. (#1777) 2020-07-09 12:31:28 -05:00
renovate[bot] 0e9c26cc6f
Update circleci/python Docker tag to v3.8 (#1702)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-05-24 21:54:16 -07:00
renovate[bot] cf0826004c
Update docker Docker tag to v18.06.3 (#1704)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-05-24 21:53:32 -07:00
Benjamin Forehand Jr b606a6ffa5
Add retries back to integration tests. (#1635)
* Add retries back to integration tests.

* Try fixing error shots.
2020-04-08 11:20:24 -05:00
Benjamin Forehand Jr b19eff6d4a
Initial commit adding integration tests. (#1557)
* Initial commit adding integration tests.

* Fix test name.

* Adding package-lock.

* Some updates.

* More updates.

* Extend page comparison max to 9.99%

* Removed node assert statement.

* Updated baseline images and tests.

* Added docs, fixed docker configuration file.

* Updates.

* Update docker compose.

* Fix json error.

* Add comment to Dockerfile.

* Comment to trigger CI.

* Moved dependencies to allow for docker image build.

* Add restore command.

* Fix restore command.

* Change docker image.

* Add checkout command.

* Add java.

* Add node version install.

* Trying machine executor.

* Fix typo.:

* Remove old docker command.

* EVERYTHING IN ONE SHELL.

* Trying nvm.

* Fix typo.

* Fix node version...

* Fix typo.

* More node stuff.

* Updates to docker compose.

* Add chown to circleci config.

* Fix docker login error.

* Change exec command user.

* Add screenshots for debugging.

* Try fixing js command.

* Try fixing js command again.

* Change screenshot path

* Add mkdir for error shots.

* Trying something for postgres.

* Updates.

* Fix lint error.

* Try fixing errorshots.

* Updates before rebase.

* Updated baseline for new homepage.

* Remove baseline image save.

* Trying a change for errorshots.

* Update test.
2020-04-03 14:48:07 -05:00
Jeremiah Orem 6255849e8f
circleci: deploy_static should run checkout 2020-02-14 12:59:06 -08:00
Jeremiah Orem c22294f022
CircleCI config to sync logos to CDN (#1551)
* CircleCI config to sync logos to CDN

* export AWS_SECRET_ACCESS_KEY and AWS_ACCESS_KEY_ID

* update logo maxage to 1 day
2020-02-14 12:57:26 -08:00
Luke Crouch 9430dca17f remove linting from circle; handled by travis 2018-08-30 15:34:02 -05:00
Luke Crouch 2dbbee6438 upgrade npm on CI so they can audit 2018-08-30 15:21:30 -05:00
Luke Crouch 372a44ecfe for #246: fix docker deploy job (only affects master) 2018-08-30 13:53:29 -05:00
Luke Crouch ecf6122af4 start .circleci/config.yml for circle 2.0 2018-08-30 11:45:31 -05:00
groovecoder 0e252c135e fix circle 2018-05-31 16:29:25 -05:00
groovecoder c5e1b4cf62 move circle.yml file 2018-05-31 13:18:07 -05:00