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

100 Коммитов

Автор SHA1 Сообщение Дата
Jonathan Almeida 340aa11487
task(scripts): Add cirrus service in a dev environment
Co-authored-by: dschom <dschomburg@mozilla.com>
2024-05-30 22:16:08 -04:00
Barry Chen 2a5a357189
chore(build): let chokidar poll 2024-05-10 10:00:39 -05:00
Barry Chen 1f6c4e6eb1
Revert "Update build.sh" 2024-05-08 13:47:56 -07:00
Wil Clouser 10ae9abdc5
Update build.sh 2024-05-08 09:14:33 -07:00
Vijay Budhram 0e00017b0d
fix(cache): Remove memcache service and references to it
feat(sync): Return estimated sync devices in recovery key exist route
2024-04-30 15:08:47 -04:00
Ben Bangert c28b061257
chore: update Node to LTS 20, TypeScript, tsconfig
Because:

* We want to update to Node 20 LTS.
* We want to target the JS output of Node 20.
* We want to use the latest TypeScript 5.4

This commit:

* Updates the Node version to 20 LTS.
* Updates the TypeScript version and related TS libs
  to 5.4.
* Updates tsconfig for the new Node 20 target.
2024-03-14 11:54:20 -07:00
dschom aaa625ce15
task(admin-panel): Hookup account delete
Because:
- We want to delete accounts from the admin panel

This Commit:
- Adds cloud task emulator pm2 service
- Creates cloud-task nx lib for interacting with cloud tasks
- Creates PageDeleteAccount in admin panel
- Adds ability to delete accounts to admin server's account resolver
- Fixes broken admin panel configuration
- Fixes broken admin server configuration
2024-03-13 11:26:09 -07:00
Dan Schomburg 3f02bd5952
Revert "chore: update node to LTS 20" 2024-03-13 10:00:47 -07:00
Ben Bangert a022106a34
chore: update node to LTS 20
Because:

* We want to use the latest LTS version of node.

This commit:

* Updates the .nvmrc/Dockerfile and package.json
  files to use node 20.
2024-03-12 18:25:24 -07:00
Jon Buckley 92b0827f7f
Merge pull request #15844 from mozilla/upgrade-to-mysql-8-0-31
chore(mysql): Upgrade to MySQL 8.0.31
2024-03-05 14:21:41 -05:00
Vijay Budhram b8eab28c4a
fix(customs): Update customs axios maxSockets and timeoutMs 2024-02-07 15:19:06 -05:00
Jon Buckley 99c80e7837
chore(mysql): Follow latest patch release of MySQL 8.0 2024-01-08 15:17:22 -08:00
Barry Chen c6d3ce8741
fix(build): use different tmp file name
Because:
 - at least one of the build processes creates a 'tmp' directory in the
   project root directory, which would cause the mono build script to
   fail
   - this is not an issue in CI since its starting state is clean but
     locally if the monorepo's been built before this becomes an issue

This commit:
 - renames the temporary file name slightly
2023-10-19 16:17:15 -05:00
Ben Bangert 6ed76a6caf
chore: update node to 18.18.2
Because:

* We want to use the latest security release of Node.

This commit:

* Updates Node.js to 18.18.2
2023-10-16 16:46:26 -07:00
Dan Schomburg c57524f332
task(CI): Disable nx cache in docker build 2023-09-27 12:09:21 -07:00
dschom 372c14aaaa
task(all): Ignore all .env files 2023-09-25 16:29:45 -07:00
Barry Chen 3a61a72cac
Use bullseye as base image (instead of bookworm the current default) 2023-09-06 14:26:05 -05:00
dschom e114e823d9
task(ci): Include max old space node option in build.sh
Because:
- The CI job `Create FxA Image` ran out of memory

This Commit:
- Applies the the `--max-old-space-size=7168` node option, which should prevent the OOM.
2023-08-30 14:20:43 -07:00
dschom 992115594b
task(ci): Fix netcat install after updating docker base image to node:18.17-slim 2023-08-30 13:39:01 -07:00
dschom d96797ae6a
task(CI): Improve nx caching for CI pipelines
Because:
- Not all CI operations where taking advantage of NX caches

This Commit:
- Adjusts nx.json config to ensure correct caching behavior
- Adjusts nx.json config to ensure proper target chains. ie build is dependent on pre-build
- Uses nx to directly run integration tests
- Uses nx to directly run unit tests
- Phases out dependency on generated .list files
- Ensures 'start up' for services for functional tests is done with nx and uses nx caches.
- Creates nx tags to facilitate test commands
- Fixes linter errors encountered
- Updates docker images to nx for builds
- Updates nx ignore files
2023-08-29 11:19:54 -07:00
Ben Bangert 54f0c2e7a2
chore: update to TS to 5.2.2 and Node to 18.17.1
Because:

* We want to use the latest typescript features.

This commit:

* Updates to TypeScript 5.2.2.
* Updates to Node 18.17.1 as OOM would occur frequently with 18.14.
* Updates CI to use a large instance with increased memory for Node.
2023-08-28 14:47:29 -07:00
Dan Schomburg db24f8485d
bug(ci): Broken ci image build
Because
- Deploy ci image was failing

This Commit:
- Adds a missing ';'
2023-08-11 19:18:04 -07:00
Dan Schomburg 59caa3d8f3
Merge branch 'main' into fix-broken-ci-image-build 2023-07-20 15:17:02 -07:00
dschom 2d5d7396c0
fix(ci): Fix broken ci images due to missing allowlist folder
Because:
- Our CI image build was failing

This Commit:
- Makes an exception for the project/configs/gql/allowlist folder in the dockerignore file
2023-07-20 11:55:33 -07:00
Reino Muhl 8a4ed3350a
feat(infra): wait for db patches on startup
Because:

* On stack startup, services start before mysql patches have completed,
  causing profile-server to fail on startup.

This commit:

* Adds script to check if patcher script has started and is still
  running.

Closes #
2023-07-20 12:08:34 -04:00
dschom b02676e358
fix(ci): Fix broken ci images due to missing allowlist folder
Because:
- Our CI image build was failing

This Commit:
- Makes an exception for the configs/gql/allowlist folder in the dockerignore file
2023-07-19 09:04:35 -07:00
dschom df7897920d
task(gql-api): Allowlist graphql queries
Because:
- We want to lock down our gql queries as part of good security practices.

This Commit:
- Creates task that extracts existing gql queries from our code
- Applies middleware that checks a allowlist of extracted queries.
- Creates a 403 if the query is not in the allowlist
- Makes all gql parsable by extraction utility. The extraction utility doesn't support string placeholders. e.g. gql` Account { ${ACCOUNT_FIELDS} }`
- Moves all the gql in the admin server into .ts files. Again for consistency and extraction utility support.
- Cleans up some config references at startup
- Adds nx config for extraction & copy tasks
2023-07-18 05:54:28 -07:00
dschom e51fb8adc2
bug(CI): Current version not being set properly in docker build.
Because:
- Deployed services all had a version set to v0.0.0

This Commit:
- Determines version specified in `packages/version.json`
- Provides this version to `build.sh` ensuring it is set in packages
2023-05-25 10:53:22 -07:00
Julian Poyourow 565ebb89c9
chore(build): initial nx implementation
Because:

* We want to introduce nx to the repository

This commit:

* Adds nx with working builds

Closes: FXA-7341

Co-authored-by: dschom <dschomburg@mozilla.com>
2023-05-23 08:37:47 -07:00
dschom b4cfc9c325
chore(CI): Switch to multi stage docker build and clean up
Because:
- We want to clean up our docker build
- We no longer used our service specific images

This Commit:
- Switches to multi stage docker build
  - Removes unused building of individual services
  - Removes used script that sets environment variables.
  - Removes `workspaces focus` call that resulted in redundant installs
  - Removes trap on build logs.
  - Uses circleci DLC to get cache hits for fxa-utils and fxa-build-utils
- Removes scripts that build service specific images
- Cleans up naming conventions to reflect that only one image is being built
2023-05-11 17:13:06 -07:00
Dan Schomburg 11d541f263
Merge pull request #15255 from mozilla/FXA-7359
task(CI): Patch package.json version fields to reflect the git tag
2023-05-05 14:31:34 -07:00
dschom 7f79c431d0
task(CI): Patch package.json version fields to reflect the git tag
Because:
- We want the package.json version to match the git tag being deployed.
- We don't want to commit a change on the package.json file to accomplish this.

This Commit:
- If there is a git tag, the code will send it into the docker build as a VERSION build arg.
- This build arg is then used to update the version field in all package.json files.
2023-05-05 12:13:46 -07:00
Barry Chen ec34079b91
feat(metrics): add glean.js to content-server
Because:
 - we want to use Glean for our metrics

This commit:
 - integrates glean.js into content-server
 - adds a couple placeholder registration Glean metrics events
2023-05-05 12:45:33 -05:00
dschom dcccce4abc
bug(CI): Add curl to docker images 2023-03-29 15:24:04 -07:00
dschom 91007213ac
task(ci): Add jq to docker
Because:
- jq util was missing from docker images based on node:18

This Commit:
- Installs jq
2023-03-29 12:14:08 -07:00
Barry Chen 218b49e88b
Revert "chore(lint): move eslint-plugin-fxa into the monorepo" 2023-03-28 12:47:03 -07:00
Barry Chen fbb5f0f5bc
chore(lint): move eslint-plugin-fxa into the monorepo
Because:
 - we don't want to maintain the fxa eslint plugin in another repo

This commit:
 - move the plugin into the monorepo

Co-authored-by: Peter deHaan <peter@deseloper.com>
2023-03-22 16:12:11 -05:00
Barry Chen ba550558a0
chore(repo): delete pushbox service integration
Because:
 - the pushbox service has been decommissioned

This commit:
 - removes the pushbox service integration config and code from the
   auth-erver
2023-03-21 13:53:44 -05:00
Barry Chen bb29851b17
fix(CI): call script directly to clone l10n repo 2023-03-21 10:06:51 -05:00
Barry Chen 1f7e26e709
fix(CI): clone l10n repo
Because:
 - we need to clone l10n repo so that packages can be built

This commit:
 - explicitly call `l10n:clone` in the Dockerfile for CI images
2023-03-20 15:49:19 -05:00
Barry Chen da11e63832
chore(deps): upgrade to node.js 18
Because:
 - we want to use the latest node LTS major version

This commit:
 - upgrades FxA to use node 18, with two workarounds
   - Webpack uses a hash algorithm that's no longer supported by default
     in node 17+, causing build failures; --openssl-legacy-provider is
     used as the workaround
   - dns.lookup in node 17+ by default returns the results in the same
     order as they are from the resolver, which could lead to
     'localhost' resolving to ::1; --dns-result-order=ipv4first is used
     as the workaround
2023-03-20 13:28:10 -05:00
dschom c79c6260a4
bug(CI): Fix nightly CI build
Because:
- Nightly CI build was failing because fxa-shared now references the test folder during build.

This Commit:
- Removes tests directories from the docker ignore list.
2023-02-17 15:53:07 -08:00
dschom 8d3e42963f
task(CI): Improvements to caching and startup behaviors
Because:
- Something was off for base-install in jobs using the ci-base-browser-latest images. Yarn cache hits were not happening as anticipated. Also, in the event the yarn install could be skipped, the postinstall script was taking longer than expected.
- An occasional race condition where the deploy-fxa-ci-browser-image could be built off a stale base image was detected.
- Since ci-base-latest and ci-base-browsers-latests weren’t pushed at the same time, occasionally different builds would be used in a pipeline. Although this never directly led to problems, it did seem like the potential was there.
- The ci-* docker images were larger than desired..
- While investigating optimizations, it became apparent job spin up times could be further reduced by using CircleCI workspaces.
– Nightly builds are useful, and we would occasionally encounter a regression on main that wasn’t present in PRs due to differences in resulting state after a merge.
- SRE needs a better way to trigger smoke tests in parallel.

This commit:
- Reworks the docker file.
	- Puts everything into one multi stage build, which results in better layer caching.
	- Creates new tag names ci-builder, ci-test-runner, & ci-functional-test-runner
       - Makes sure these images are as small as possible
	- Updates references to these new images in the executors
- Ensures that the ci images are built on the same machine and pushed at the same time. This addresses the potential race condition described in the because section above.
- Short circuits the docker build for ci images if there are no npm package changes detected. Since the base images are really just a way to decrease build time by caching package dependencies in a docker image that compresses better than the circle ci cache, we don’t actually need to build the image unless a package change has occurred.
- Leverages CircleCI workspaces. The build now primes the workspace and it is then restored in the subsequent jobs. This ends up saving time, because we skip the build / install step, and it allows us to use much smaller docker images for any job running post build.
- Adds a script to extract the current state of the yarn cache from a docker image, so the yarn cache can be kept fresh. This was an oversight in the initial pass.
- For functional tests, the operation that starts the pm2 stack and the actual jobs have been separated into different steps. This gives us better timing metrics, and also lets us see which step fails most often. Starting the stack actually takes up a considerable amount of time, and shouldn’t be confused with the time it takes to execute tests.
- For functional tests (both playwright and content), a memory optimization was made by not including fxa-shared or fxa-react in the ‘run start’ operation. Both of these workspaces are now built in the ‘build’ stage, so there is no reason to include them when spinning up the stack. This actually resulted in a noticeable reduction in memory usage. This is probably due to the fact that these pm2 tasks were running a watch operation, which is more memory intensive than just running a build.
- Ensures that the entire git history isn't copied into the base image, which results in a smaller image. (Our git history is surprisingly large!) This is done by setting a depth of 1 when cloning and depth of 2 when fetching. These changes also address FXA-6676, because the clone and fetch operations have been modified.
- Adds a nightly workflow, so that we can run a full test suite to guard against regression resulting from a merge into main. See FXA-6626 for more information. We can also use this nightly flow to postpone any CI tasks that run on main, but aren’t urgent.
- Retains the ability to manually trigger tasks that were shifted to the nightly workflow. These tasks include deploying storybook or deploying packages.
- Adds the ability to trigger smoke test workflows with pipeline parameters. It’s possible this will simplify executing smoke tests in parallel for SRE.
- Fixes the issue of slow base-install script performance when the yarn install operation could be skipped. The issue was that when we invoke postinstall directly, fxa-shared would be built. This is already taken care of in the build step, so doing so in the base install was an unneeded redundancy.
- Adds a few other minor improvements fixes such as avoiding a couple redundant build / lint operations, making the build script a bit more robust, and cleaning up the config file a bit.
2023-01-30 13:14:13 -08:00
dschom a620922422
task(CI): build, unit test, and integration test jobs
Because:
- We wanted to run a few preliminary checks before proceeding to more
  expensive CI jobs. Checks include:
    - Compiling typescript in commonly referenced workspace packages
    - Linting code that has changed
    - Executing Unit Tests for code that has changed
- We wanted to partition test operations into unit tests, and
   integration tests. Unit tests can be run relatively quickly and
   require no additional infrastructure. Integration tests require
   additional infrastructure and generally have longer execution
   times. Now that jobs are blocked from running until preliminary
   checks pass, one of which is unit tests, it is important to draw a
   distinction between these two types of tests.
- We want to avoid unnecessary yarn installs and typescript
  compilations, which are time consuming.
- We want to make sure that test results are published and failing tests
   can be easily viewed in the CI.

This Commit:

- Creates a build-and-validate job in the CI that builds, lints, and
  unit tests code prior to running any other jobs.
- Creates unit-test job in CI config
- Creates integration-test job in CI config
- Removes redundant calls to compile workspace packages. These
  are now built up front, cached, and restored as needed for future
  runs.
- Extends the create-lists script functionality to generate commands
  that can be executed with the parallel command.
- Removes unnecessary yarn install operations. Invoking yarn workspace
   focus results in a yarn install. In the case of running tests this is largely
   unnecessary, because we already do a yarn install in the base-install
   step.
- Make sure test results are exported as junit xml so the CI can report
  back on tests that were failing. This was done for a couple workspace
  packages, but many were lacking the capability. All test:unit and
  test:integration npm scripts now export this data.
- Fixes the following issues encountered along the way:
        - Adds logs to monitor heap usage of jest tests. Some
          jest tests are still using a lot of memory.
        - Moves a few slow / long running tests from unit test to
          integration tests.
        - Ensures that jest.transform for ts-jest is always instructed
           to have the config option isolateModules is set to true. This
           definitely decreases memory overhead and resolves some
           of the OOM errors we were hitting. It was configured in
           some places but not everywhere.
        - Exports test results files for all tests
        - Exports all test artifacts
        - Uses gnu parallel to run tests in parallel. Turns out yarn
          workspaces foreach would give a false positive when an OOM
          was encountered. Fortunately, the parallel command offered an
          acceptable work around, and even offers some nice features
          like the load argument, which allows to control test execution a
          bit more efficiently.
2023-01-10 12:52:01 -08:00
dschom 74d474389c
bug(CI): Fixes the playwright install in the base image used for functional tests.
Because:
- Playwright tests weren't running

This Commit:
- Switches from to an npx install to setup the playwright browsers
2022-12-20 12:18:25 -08:00
dschom acf3c82590
task(ci): Use docker base image
Because:
- We want to speed up pipeline startup.

This Commit:
- Optimizes docker base image builds for the smallest images possible.
- Enables hard links for yarn cache
- Enables global yarn cache
- Avoids needlessly installing playwright browsers.
- Avoids needlessly running yarn install.
- Uses mozilla/fxa-circleci:ci-base-latest image for running test pipelines
- Uses mozilla/fxa-circleci:ci-base-browsers image for running functional tests pipelines
- Creates configurable executors that can be reused across pipelines
- Upgrades to yarn 3.3.0
- Enabled direct check out of PR code to test, which is faster than circle ci’s checkout command.
- Upgrades functional test to X-Large. This was already the case for playwright tests, but is now extended to content server tests too. This decision was made due to running lots of pipelines and realizing flakiness was largely due to CPU or memory hitting 100% for long periods of time.
- Turns off tracing, since it saves a bit of runtime.
2022-12-15 15:48:16 -08:00
dschom de864fc93e
task(ci): Create docker image for CI
Because:
- We are in the process of experimenting with CI pipeline optimizations

This Commit:
- Creates a new docker image that can be used in other CI jobs.
- This base image comes pre-populated with node_modules, dist folders, and l10n repos.
2022-11-22 18:38:30 -08:00
Dan Schomburg 70a784eb9e
Merge pull request #14405 from mozilla/fix-otel-docker-network-error
task(shared): Fix docker network error with otel
2022-11-04 17:53:44 -07:00
dschom 1ab4ba501b
task(shared): Fix docker network error with otel
Because:
- When starting tracing with open telemetry the network name would sometimes collide and result in error.

This Commit:
- Sets an 'fxa' network name
- Applies this network to services
- Allows services to communicate by their names
2022-11-04 16:22:11 -07:00
Julian Poyourow 76ef507b26
chore(auth-server): enable typescript-eslint
Because:

* We aren't currently linting TS files in auth-server

This commit:

* Enables and fixes linting issues in auth-server

Closes FXA-6136
2022-11-04 10:43:26 -07:00