Skip to content

Commit da111c7

Browse files
Merge remote-tracking branch 'origin/main' into beta-releases
2 parents 6e91c25 + 420dd66 commit da111c7

File tree

167 files changed

+4089
-1059
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

167 files changed

+4089
-1059
lines changed

.evergreen/buildvariants-and-tasks.in.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ buildvariants:
252252
run_on: ubuntu2204-large
253253
tasks:
254254
- name: publish
255+
- name: publish-web
255256
- name: publish-dev-release-info
256257

257258
- name: static-analysis
@@ -410,6 +411,22 @@ tasks:
410411
- func: get-all-artifacts
411412
- func: publish
412413

414+
- name: publish-web
415+
# Publish both on PRs and on main (if it gets too noisy and won't be used
416+
# much we can probably disable for PRs)
417+
tags: ['run-on-pr']
418+
depends_on:
419+
- name: '.required-for-publish'
420+
variant: '*'
421+
commands:
422+
- func: prepare
423+
- func: install
424+
- func: bootstrap
425+
vars:
426+
scope: "@mongodb-js/compass-web"
427+
- func: upload-web
428+
- func: publish-web
429+
413430
- name: publish-dev-release-info
414431
tags: []
415432
depends_on:

.evergreen/buildvariants-and-tasks.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ buildvariants:
229229
- name: test-packaged-app-macos-15-x64
230230
display_name: Test Packaged App MacOS x64 15
231231
run_on: macos-15-amd64-gui
232-
patchable: true
232+
patchable: false
233233
depends_on:
234234
- name: package-compass
235235
variant: package-macos-x64
@@ -242,6 +242,7 @@ buildvariants:
242242
run_on: ubuntu2204-large
243243
tasks:
244244
- name: publish
245+
- name: publish-web
245246
- name: publish-dev-release-info
246247
- name: static-analysis
247248
display_name: Create Static Analysis Report
@@ -415,6 +416,20 @@ tasks:
415416
scope: mongodb-compass
416417
- func: get-all-artifacts
417418
- func: publish
419+
- name: publish-web
420+
tags:
421+
- run-on-pr
422+
depends_on:
423+
- name: .required-for-publish
424+
variant: '*'
425+
commands:
426+
- func: prepare
427+
- func: install
428+
- func: bootstrap
429+
vars:
430+
scope: '@mongodb-js/compass-web'
431+
- func: upload-web
432+
- func: publish-web
418433
- name: publish-dev-release-info
419434
tags: []
420435
depends_on:

.evergreen/functions.yml

Lines changed: 56 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# The variables are with the functions because they are only used by the
2-
# functions and also because you can't use variables across includes.
1+
# The variables and paratemers are with the functions because they are only used
2+
# by the functions and also because you can't use variables across includes.
33
variables:
44
- &save-artifact-params-private
55
aws_key: ${aws_key}
@@ -40,14 +40,17 @@ variables:
4040
EVERGREEN_VERSION_ID: ${version_id}
4141
EVERGREEN_WORKDIR: ${workdir}
4242
EVERGREEN_CREATED_AT: ${created_at}
43-
NODE_JS_VERSION: '22.15.1'
43+
NODE_JS_VERSION: '22.21.1'
4444
NPM_VERSION: '10.2.4'
4545
# secrets
4646
HADRON_METRICS_INTERCOM_APP_ID: ${metrics_intercom_app_id}
4747
HADRON_METRICS_SEGMENT_API_KEY: ${metrics_segment_api_key}
4848
GITHUB_TOKEN: ${devtoolsbot_github_token}
4949
DOWNLOAD_CENTER_AWS_ACCESS_KEY_ID: ${aws_key_evergreen_integrations}
5050
DOWNLOAD_CENTER_AWS_SECRET_ACCESS_KEY: ${aws_secret_evergreen_integrations}
51+
DOWNLOAD_CENTER_NEW_AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID}
52+
DOWNLOAD_CENTER_NEW_AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY}
53+
DOWNLOAD_CENTER_NEW_AWS_SESSION_TOKEN: ${AWS_SESSION_TOKEN}
5154
EVERGREEN_BUCKET_NAME: mciuploads
5255
EVERGREEN_BUCKET_KEY_PREFIX: ${project}/${revision}_${revision_order_id}
5356
MONGODB_RUNNER_LOG_DIR: ${workdir}/src/.testserver/
@@ -74,6 +77,13 @@ variables:
7477
E2E_TESTS_ATLAS_CS_WITHOUT_SEARCH: ${e2e_tests_atlas_cs_without_search}
7578
E2E_TESTS_ATLAS_CS_WITH_SEARCH: ${e2e_tests_atlas_cs_with_search}
7679

80+
parameters:
81+
- key: compass_web_publish_environment
82+
value: dev
83+
description: Atlas Cloud environment that compass-web will be deployed for during a CI run
84+
- key: compass_web_release_commit
85+
description: Exact commit that will be deployed as a latest release for provided compass_web_publish_environment
86+
7787
# This is here with the variables because anchors aren't supported across includes
7888
post:
7989
- command: archive.targz_pack
@@ -504,23 +514,62 @@ functions:
504514
publish:
505515
- command: ec2.assume_role
506516
params:
507-
role_arn: 'arn:aws:iam::119629040606:role/s3-access.cdn-origin-compass'
517+
role_arn: ${downloads_bucket_role_arn}
508518
- command: shell.exec
509519
params:
510520
working_dir: src
511521
shell: bash
512522
env:
513523
<<: *compass-env
514-
DOWNLOAD_CENTER_NEW_AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID}
515-
DOWNLOAD_CENTER_NEW_AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY}
516-
DOWNLOAD_CENTER_NEW_AWS_SESSION_TOKEN: ${AWS_SESSION_TOKEN}
517524
script: |
518525
set -e
519526
# Load environment variables
520527
eval $(.evergreen/print-compass-env.sh)
521528
echo "Uploading release assets to S3 and GitHub if needed..."
522529
npm run --workspace mongodb-compass upload
523530
531+
upload-web:
532+
- command: ec2.assume_role
533+
params:
534+
role_arn: ${downloads_bucket_role_arn}
535+
- command: shell.exec
536+
params:
537+
working_dir: src
538+
shell: bash
539+
env:
540+
<<: *compass-env
541+
script: |
542+
set -e
543+
# Load environment variables
544+
eval $(.evergreen/print-compass-env.sh)
545+
echo "Compiling compass-web"
546+
npm run --workspace @mongodb-js/compass-web compile
547+
echo "Uploading release assets to S3"
548+
npm run --workspace @mongodb-js/compass-web upload
549+
550+
publish-web:
551+
- command: ec2.assume_role
552+
params:
553+
role_arn: ${downloads_bucket_role_arn}
554+
- command: shell.exec
555+
params:
556+
working_dir: src
557+
shell: bash
558+
env:
559+
<<: *compass-env
560+
COMPASS_WEB_PUBLISH_ENVIRONMENT: '${compass_web_publish_environment}'
561+
COMPASS_WEB_RELEASE_COMMIT: '${compass_web_release_commit}'
562+
script: |
563+
set -e
564+
# Load environment variables
565+
eval $(.evergreen/print-compass-env.sh)
566+
# Deploy to dev on every commit to main, do nothing for release branches
567+
if [[ "$EVERGREEN_PROJECT" == '10gen-compass-main' && "$EVERGREEN_IS_PATCH" != "true" ]]; then
568+
npm run --workspace @mongodb-js/compass-web publish
569+
else
570+
echo "Skipping publish: wrong project ($EVERGREEN_PROJECT) or patch ($EVERGREEN_IS_PATCH)"
571+
fi
572+
524573
publish-dev-release-info:
525574
- command: shell.exec
526575
params:

.github/copilot-instructions.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
For overview, do not summarize the changes. Only provide high level feedback on code quality, performance, and best practices.
2+
3+
When reviewing code, focus on:
4+
5+
## Performance Red Flags
6+
7+
- Spot inefficient loops and algorithmic issues
8+
- Check for memory leaks and resource cleanup
9+
10+
## Code Quality Essentials
11+
12+
- Functions should be focused and appropriately sized
13+
- Use clear, descriptive naming conventions
14+
- Ensure proper error handling throughout
15+
- Suggest changes to improve code readability and maintainability
16+
17+
## Best practices
18+
19+
- Refer to official documentation and best practices for React.js, Redux and Node.js. If you see anti-patterns, highlight them and provide links to the relevant official documentation.
20+
- Encourage modern JavaScript/TypeScript features and syntax where applicable (e.g. for-of loops, nullish coalescing for Javascript; utility types or satisfied for Typescript..).
21+
22+
### Testing
23+
24+
- Follow the official testing guidelines for Redux and React Testing Library.
25+
- Ensure tests are meaningful, maintainable, and cover edge cases.
26+
- Avoid false positive tests.
27+
28+
### React
29+
30+
- Follow React patterns and naming conventions when designing components, “think in React”.
31+
Be careful when using hooks, make sure that all dependencies are listed for callbacks / memos / effect.
32+
- Keep in mind that defining non-primitive values in render (in function body or as component props) nullifies all memoization benefits.
33+
- Same applies to non-primitive properties constructed inside Redux connect functions, they remove any benefits of granular connections
34+
- Be especially careful when adding effects, remember that “you might not need an effect”.
35+
- If you’re reaching for a useReducer hook, consider if it’s time to move this state and business logic to a Redux store instead.
36+
37+
### Redux
38+
39+
- The store state should be normalized, minimal, and based around the data you’re storing, not components.
40+
- Keep in mind that not all state belongs in the redux store
41+
- Be especially vigilant deciding whether something is state or a derived value produced from multiple existing sources
42+
- As much state as possible should be calculated in reducers, reducers should own the state shape
43+
- Store actions should be modeled around events, should not be dispatched in batches, and should handle all complex feature logic, especially the one requiring state and service access, instead of doing this in UI directly
44+
45+
## Review Style
46+
47+
- Be specific and actionable in feedback
48+
- Explain the "why" behind recommendations
49+
50+
## MongoDB Specifics
51+
52+
### Performance antipatterns
53+
54+
- Warn about db.stats() performance implications, especially in connection with freeStorage: 1. Provide a reference to the official MongoDB documentation.
55+
56+
## Compass Specifics
57+
58+
- We're trying to stick to Redux style guide as close as possible, with two exceptions:
59+
- Compass doesn’t use a single Redux store to manage the whole application state.
60+
- Components inside the feature module boundaries don’t use Redux hooks API as a way to access data from stores (we do allow exposing hooks as public interfaces outside of module boundaries), using connect function instead.

.github/workflows/authors-and-third-party-notices.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040

4141
- uses: actions/setup-node@v4
4242
with:
43-
node-version: 22.15.1
43+
node-version: 22.21.1
4444
cache: 'npm'
4545

4646
- name: Install [email protected]

.github/workflows/bump-packages.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131

3232
- uses: actions/setup-node@v4
3333
with:
34-
node-version: 22.15.1
34+
node-version: 22.21.1
3535
cache: 'npm'
3636

3737
- name: Install [email protected]

.github/workflows/publish-compass.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- name: Setup Node.js Environment
2626
uses: actions/setup-node@v4
2727
with:
28-
node-version: 22.15.1
28+
node-version: 22.21.1
2929
cache: 'npm'
3030

3131
- name: Install [email protected]

.github/workflows/publish-packages.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
- name: 'Use Node.js'
3838
uses: actions/setup-node@v4
3939
with:
40-
node-version: 22.15.1
40+
node-version: 22.21.1
4141

4242
- name: Install [email protected]
4343
run: npm install -g [email protected]

.github/workflows/start-beta.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
3434
- uses: actions/setup-node@v4
3535
with:
36-
node-version: 22.15.1
36+
node-version: 22.21.1
3737
cache: 'npm'
3838

3939
- name: Install [email protected]

.github/workflows/start-ga.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
3434
- uses: actions/setup-node@v4
3535
with:
36-
node-version: 22.15.1
36+
node-version: 22.21.1
3737
cache: 'npm'
3838

3939
- name: Install [email protected]

0 commit comments

Comments
 (0)