Skip to content
Draft
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
19 changes: 19 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,25 @@ commands:
type: string
default: run-many
steps:
- run:
name: Ensure Python venv has pip (for glean lint)
command: |
set -euxo pipefail

echo "Python version:"
python3 --version

rm -rf .venv

python3 -m venv .venv
. .venv/bin/activate

python -m ensurepip --upgrade || true
python -m pip install --upgrade pip setuptools wheel

echo "pip version:"
python -m pip --version

- run:
name: Linting
command: npx nx << parameters.nx_run >> --parallel=1 -t lint
Expand Down
6 changes: 4 additions & 2 deletions _dev/docker/ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
# workspace will be restored into the project folder.
FROM cimg/node:22.15.1 AS test-runner
RUN sudo apt-get update && sudo apt-get install -y \
python3-venv
python3-venv \
python3-pip
WORKDIR /home/circleci
COPY --chown=circleci:circleci project project
WORKDIR /home/circleci/project
Expand Down Expand Up @@ -39,7 +40,8 @@ RUN npx playwright install --with-deps firefox chromium webkit;
# workspace will be restored into the project folder.
FROM cimg/node:22.15.1-browsers AS functional-test-runner
RUN sudo apt-get update && sudo apt-get install -y \
python3-venv
python3-venv \
python3-pip
WORKDIR /home/circleci
COPY --chown=circleci:circleci --from=playwright-install /home/circleci/.cache/ms-playwright .cache/ms-playwright/
COPY --chown=circleci:circleci project project
Expand Down
6 changes: 6 additions & 0 deletions apps/payments/api/.env
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,9 @@ GLEAN_CONFIG__APPLICATION_ID=
GLEAN_CONFIG__VERSION=0.0.0
GLEAN_CONFIG__CHANNEL='development'
GLEAN_CONFIG__LOGGER_APP_NAME='fxa-payments-next'

# Glean Client Config
GLEAN_CLIENT_CONFIG__ENABLED=true
GLEAN_CLIENT_CONFIG__APPLICATION_ID=
GLEAN_CLIENT_CONFIG__VERSION=0.0.0
GLEAN_CLIENT_CONFIG__CHANNEL='development'
6 changes: 6 additions & 0 deletions apps/payments/next/.env
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,12 @@ GLEAN_CONFIG__APPLICATION_ID=
GLEAN_CONFIG__CHANNEL='development'
GLEAN_CONFIG__LOGGER_APP_NAME='fxa-payments-next'

# Glean Client Config
GLEAN_CLIENT_CONFIG__ENABLED=true
GLEAN_CLIENT_CONFIG__APPLICATION_ID=
# GLEAN_CLIENT_CONFIG__VERSION= # Set in next.config.js
GLEAN_CLIENT_CONFIG__CHANNEL='development'

# CSP Config
CSP__ACCOUNTS_STATIC_CDN=https://cdn.accounts.firefox.com
CSP__PAYPAL_API='https://www.sandbox.paypal.com'
Expand Down
7 changes: 4 additions & 3 deletions apps/payments/next/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const nextConfig = {
env: {
version,
GLEAN_CONFIG__VERSION: version,
GLEAN_CLIENT_CONFIG__VERSION: version,
},
distDir: 'build',
experimental: {
Expand Down Expand Up @@ -96,11 +97,11 @@ const nextConfig = {
headers: [
{
key: 'Strict-Transport-Security',
value: 'max-age=63072000; includeSubDomains; preload'
}
value: 'max-age=63072000; includeSubDomains; preload',
},
],
},
]
];
},
};

Expand Down
11 changes: 9 additions & 2 deletions apps/payments/next/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"projectType": "application",
"targets": {
"build": {
"dependsOn": ["l10n-bundle", "glean-generate"]
"dependsOn": ["l10n-bundle", "glean-generate", "glean-generate-frontend"]
},
"dev": {
"options": {
Expand Down Expand Up @@ -39,7 +39,7 @@
},
"start": {
"command": "pm2 start apps/payments/next/pm2.config.js && yarn check:url localhost:3035/__heartbeat__",
"dependsOn": ["l10n-bundle", "glean-generate"]
"dependsOn": ["l10n-bundle", "glean-generate", "glean-generate-frontend"]
},
"stop": {
"command": "pm2 stop apps/payments/next/pm2.config.js"
Expand Down Expand Up @@ -71,6 +71,13 @@
},
"glean-lint": {
"command": "yarn glean glinter libs/shared/metrics/glean/src/registry/subplat-backend-metrics.yaml"
},
"glean-generate-frontend": {
"dependsOn": ["glean-lint-frontend"],
"command": "yarn glean translate libs/shared/metrics/glean/src/registry/subplat-frontend-metrics.yaml -f typescript -o libs/payments/metrics/src/lib/glean/__generated__"
},
"glean-lint-frontend": {
"command": "yarn glean glinter libs/shared/metrics/glean/src/registry/subplat-frontend-metrics.yaml"
}
},
"tags": ["app", "payments", "type:sp3"]
Expand Down
1 change: 1 addition & 0 deletions libs/payments/metrics/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const config: Config = {
},
moduleFileExtensions: ['ts', 'js', 'html'],
coverageDirectory: '../../../coverage/libs/payments/metrics',
setupFilesAfterEnv: ['<rootDir>/test/jest.setup.ts'],
reporters: [
'default',
[
Expand Down
11 changes: 9 additions & 2 deletions libs/payments/metrics/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
"assets": ["libs/payments/metrics/*.md"],
"declaration": true
},
"dependsOn": ["glean-generate"]
"dependsOn": ["glean-generate", "glean-generate-frontend"]
},
"compile": {
"command": "tsc -p libs/payments/metrics/tsconfig.json --noEmit",
"dependsOn": ["glean-generate"]
"dependsOn": ["glean-generate", "glean-generate-frontend"]
},
"glean-generate": {
"dependsOn": ["glean-lint"],
Expand All @@ -28,6 +28,13 @@
"glean-lint": {
"command": "yarn glean glinter libs/shared/metrics/glean/src/registry/subplat-backend-metrics.yaml"
},
"glean-generate-frontend": {
"dependsOn": ["glean-lint-frontend"],
"command": "yarn glean translate libs/shared/metrics/glean/src/registry/subplat-frontend-metrics.yaml -f typescript -o libs/payments/metrics/src/lib/glean/__generated__"
},
"glean-lint-frontend": {
"command": "yarn glean glinter libs/shared/metrics/glean/src/registry/subplat-frontend-metrics.yaml"
},
"test-unit": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
Expand Down
2 changes: 2 additions & 0 deletions libs/payments/metrics/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

export * from './lib/glean/glean.types';
export * from './lib/glean/glean.manager';
export * from './lib/glean/glean.service';
export * from './lib/glean/glean.config';
export * from './lib/glean/glean.factory';
export * from './lib/glean/glean.test-provider';
export * from './lib/glean/glean-client.manager';
Loading
Loading