Skip to content

Commit 0daaeb0

Browse files
Merge remote-tracking branch 'origin/main' into beta-releases
2 parents 8a325b8 + 7abde1e commit 0daaeb0

File tree

161 files changed

+4960
-8156
lines changed

Some content is hidden

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

161 files changed

+4960
-8156
lines changed

.evergreen/functions.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ functions:
322322
# Load environment variables
323323
eval $(.evergreen/print-compass-env.sh)
324324
# Generates and expansion file with build target metadata in packages/compass/expansions.yml
325-
npm run --workspace mongodb-compass build-info -- ${target_platform} ${target_arch} --format=yaml --flatten --out expansions.raw.yml
325+
npm run --workspace mongodb-compass build-info -- --format=yaml --flatten --out expansions.raw.yml
326326
# the 'author' key conflicts with evergreen's own expansion
327327
grep -v '^author:' < packages/compass/expansions.raw.yml > packages/compass/expansions.yml
328328
- command: expansions.update

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,4 @@ Ruchitha Rajaghatta <[email protected]>
9595
9696
Nikola Irinchev <[email protected]>
9797
djechlin-mongodb <[email protected]>
98+
Dylan Richardson <[email protected]>

THIRD-PARTY-NOTICES.md

Lines changed: 169 additions & 169 deletions
Large diffs are not rendered by default.

docs/tracking-plan.md

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

22
# Compass Tracking Plan
33

4-
Generated on Sun, Dec 8, 2024 at 03:24 AM
4+
Generated on Sun, Dec 15, 2024 at 03:29 AM
55

66
## Table of Contents
77

package-lock.json

Lines changed: 3157 additions & 2947 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/atlas-service/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@
7979
"@mongodb-js/compass-user-data": "^0.3.12",
8080
"@mongodb-js/compass-utils": "^0.6.16",
8181
"@mongodb-js/connection-info": "^0.9.5",
82-
"@mongodb-js/devtools-connect": "^3.3.3",
83-
"@mongodb-js/devtools-proxy-support": "^0.4.1",
82+
"@mongodb-js/devtools-connect": "^3.3.4",
83+
"@mongodb-js/devtools-proxy-support": "^0.4.2",
8484
"@mongodb-js/oidc-plugin": "^1.1.5",
8585
"hadron-app-registry": "^9.2.8",
8686
"compass-preferences-model": "^2.31.1",

packages/atlas-service/src/atlas-auth-service.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import type { AtlasUserInfo } from './util';
44
export type ArgsWithSignal<T = Record<string, unknown>> = T & {
55
signal?: AbortSignal;
66
};
7-
export type SignInPrompt = 'none';
87

98
type AtlasAuthServiceEvents = {
109
'signed-in': [];
@@ -19,7 +18,7 @@ type AtlasAuthEventListener<T extends AtlasAuthEventNames> = (
1918

2019
export abstract class AtlasAuthService extends EventEmitter {
2120
abstract signIn(
22-
opts?: ArgsWithSignal<{ promptType?: SignInPrompt }>
21+
opts?: ArgsWithSignal<{ mainProcessSignIn?: boolean }>
2322
): Promise<AtlasUserInfo>;
2423
abstract signOut(): Promise<void>;
2524
abstract isAuthenticated(opts?: ArgsWithSignal): Promise<boolean>;

packages/atlas-service/src/compass-atlas-auth-service.spec.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ describe('CompassAtlasAuthService', function () {
4343
const atlasAuthService = getAtlasAuthService({
4444
signIn: signInStub,
4545
});
46-
await atlasAuthService.signIn({ signal: c.signal });
46+
await atlasAuthService.signIn({
47+
mainProcessSignIn: true,
48+
signal: c.signal,
49+
});
4750
expect(signInStub.calledOnce).to.be.true;
4851
expect(signInStub.firstCall.firstArg).to.deep.equal({ signal: c.signal });
4952
});

packages/atlas-service/src/compass-atlas-auth-service.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { ipcRenderer } from 'hadron-ipc';
22
import type { CompassAuthService as AtlasServiceMain } from './main';
3-
import { signInWithoutPrompt } from './store/atlas-signin-reducer';
3+
import { performSignInAttempt } from './store/atlas-signin-reducer';
44
import { getStore } from './store/atlas-signin-store';
55
import { AtlasAuthService } from './atlas-auth-service';
6-
import type { ArgsWithSignal, SignInPrompt } from './atlas-auth-service';
6+
import type { ArgsWithSignal } from './atlas-auth-service';
77

88
export class CompassAtlasAuthService extends AtlasAuthService {
99
private _ipc = ipcRenderer?.createInvoke<
@@ -37,15 +37,14 @@ export class CompassAtlasAuthService extends AtlasAuthService {
3737
return this.ipc.signOut();
3838
}
3939
signIn({
40-
promptType,
40+
mainProcessSignIn,
4141
signal,
42-
}: ArgsWithSignal<{ promptType?: SignInPrompt }> = {}) {
43-
switch (promptType) {
44-
case 'none':
45-
return getStore().dispatch(signInWithoutPrompt({ signal }));
46-
default:
47-
return this.ipc.signIn({ signal });
42+
}: ArgsWithSignal<{ mainProcessSignIn?: boolean }> = {}) {
43+
if (mainProcessSignIn) {
44+
return this.ipc.signIn({ signal });
4845
}
46+
47+
return getStore().dispatch(performSignInAttempt({ signal }));
4948
}
5049
getUserInfo(opts?: ArgsWithSignal) {
5150
return this.ipc.getUserInfo(opts);

packages/atlas-service/src/store/atlas-signin-reducer.spec.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
cancelSignIn,
66
attemptId,
77
AttemptStateMap,
8-
signInWithoutPrompt,
8+
performSignInAttempt,
99
} from './atlas-signin-reducer';
1010
import { expect } from 'chai';
1111
import { configureStore } from './atlas-signin-store';
@@ -174,7 +174,7 @@ describe('atlasSignInReducer', function () {
174174
atlasAuthService: mockAtlasService as any,
175175
});
176176

177-
void store.dispatch(signInWithoutPrompt()).catch(() => {});
177+
void store.dispatch(performSignInAttempt()).catch(() => {});
178178

179179
await Promise.all([
180180
store.dispatch(signIn()),
@@ -184,7 +184,7 @@ describe('atlasSignInReducer', function () {
184184
});
185185
});
186186

187-
describe('signInWithoutPrompt', function () {
187+
describe('performSignInAttempt', function () {
188188
it('should resolve when sign in flow finishes', async function () {
189189
const mockAtlasService = {
190190
isAuthenticated: sandbox.stub().resolves(false),
@@ -195,7 +195,7 @@ describe('atlasSignInReducer', function () {
195195
const store = configureStore({
196196
atlasAuthService: mockAtlasService as any,
197197
});
198-
await store.dispatch(signInWithoutPrompt());
198+
await store.dispatch(performSignInAttempt());
199199
expect(store.getState()).to.have.property('state', 'success');
200200
});
201201

@@ -210,8 +210,8 @@ describe('atlasSignInReducer', function () {
210210
atlasAuthService: mockAtlasService as any,
211211
});
212212
try {
213-
await store.dispatch(signInWithoutPrompt());
214-
expect.fail('Expected signInWithoutPrompt action to throw');
213+
await store.dispatch(performSignInAttempt());
214+
expect.fail('Expected performSignInAttempt action to throw');
215215
} catch (err) {
216216
expect(err).to.have.property('message', 'Sign in failed');
217217
}
@@ -237,7 +237,7 @@ describe('atlasSignInReducer', function () {
237237
});
238238
const c = new AbortController();
239239
const signInPromise = store.dispatch(
240-
signInWithoutPrompt({ signal: c.signal })
240+
performSignInAttempt({ signal: c.signal })
241241
);
242242
c.abort(new Error('Aborted from outside'));
243243
try {

0 commit comments

Comments
 (0)