Skip to content

Commit 5162f84

Browse files
Merge branch 'main' into clean-outputs
2 parents a3dc3b3 + d47820d commit 5162f84

File tree

11 files changed

+155
-117
lines changed

11 files changed

+155
-117
lines changed

CHANGELOG.md

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,31 @@
22

33
<!-- <START NEW CHANGELOG ENTRY> -->
44

5+
## 0.51.3
6+
7+
([Full Changelog](https://github.com/jupyterlab/jupyterlab-git/compare/v0.51.2...73bb0d02e48e8fa5794885be900809b588d2c122))
8+
9+
### Enhancements made
10+
11+
- Use `serverSettings` to make API requests [#1437](https://github.com/jupyterlab/jupyterlab-git/pull/1437) ([@jtpio](https://github.com/jtpio))
12+
13+
### Bugs fixed
14+
15+
- Fix scrolling issue in diff viewer [#1433](https://github.com/jupyterlab/jupyterlab-git/pull/1433) ([@Meriem-BenIsmail](https://github.com/Meriem-BenIsmail))
16+
- Fix cloning from new host via ssh by prompting for confirmation [#1408](https://github.com/jupyterlab/jupyterlab-git/pull/1408) ([@jesuino](https://github.com/jesuino))
17+
18+
### Maintenance and upkeep improvements
19+
20+
- Remove unused `handler.ts` file [#1436](https://github.com/jupyterlab/jupyterlab-git/pull/1436) ([@jtpio](https://github.com/jtpio))
21+
22+
### Contributors to this release
23+
24+
([GitHub contributors page for this release](https://github.com/jupyterlab/jupyterlab-git/graphs/contributors?from=2025-06-12&to=2025-12-10&type=c))
25+
26+
[@github-actions](https://github.com/search?q=repo%3Ajupyterlab%2Fjupyterlab-git+involves%3Agithub-actions+updated%3A2025-06-12..2025-12-10&type=Issues) | [@jesuino](https://github.com/search?q=repo%3Ajupyterlab%2Fjupyterlab-git+involves%3Ajesuino+updated%3A2025-06-12..2025-12-10&type=Issues) | [@jtpio](https://github.com/search?q=repo%3Ajupyterlab%2Fjupyterlab-git+involves%3Ajtpio+updated%3A2025-06-12..2025-12-10&type=Issues) | [@Meriem-BenIsmail](https://github.com/search?q=repo%3Ajupyterlab%2Fjupyterlab-git+involves%3AMeriem-BenIsmail+updated%3A2025-06-12..2025-12-10&type=Issues)
27+
28+
<!-- <END NEW CHANGELOG ENTRY> -->
29+
530
## 0.51.2
631

732
([Full Changelog](https://github.com/jupyterlab/jupyterlab-git/compare/v0.51.1...bee4e6492440dd17280fb30478420f18e7f3c416))
@@ -26,8 +51,6 @@
2651

2752
[@ctcjab](https://github.com/search?q=repo%3Ajupyterlab%2Fjupyterlab-git+involves%3Actcjab+updated%3A2025-04-03..2025-06-12&type=Issues) | [@dependabot](https://github.com/search?q=repo%3Ajupyterlab%2Fjupyterlab-git+involves%3Adependabot+updated%3A2025-04-03..2025-06-12&type=Issues) | [@github-actions](https://github.com/search?q=repo%3Ajupyterlab%2Fjupyterlab-git+involves%3Agithub-actions+updated%3A2025-04-03..2025-06-12&type=Issues) | [@gjmooney](https://github.com/search?q=repo%3Ajupyterlab%2Fjupyterlab-git+involves%3Agjmooney+updated%3A2025-04-03..2025-06-12&type=Issues) | [@jiridanek](https://github.com/search?q=repo%3Ajupyterlab%2Fjupyterlab-git+involves%3Ajiridanek+updated%3A2025-04-03..2025-06-12&type=Issues) | [@jtpio](https://github.com/search?q=repo%3Ajupyterlab%2Fjupyterlab-git+involves%3Ajtpio+updated%3A2025-04-03..2025-06-12&type=Issues)
2853

29-
<!-- <END NEW CHANGELOG ENTRY> -->
30-
3154
## 0.51.1
3255

3356
([Full Changelog](https://github.com/jupyterlab/jupyterlab-git/compare/v0.51.0...3dcaf17a0db3161e7256961ac8eb2a8c6f1edaab))

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@jupyterlab/git",
3-
"version": "0.51.2",
3+
"version": "0.51.3",
44
"description": "A JupyterLab extension for version control using git",
55
"main": "lib/index.js",
66
"types": "lib/index.d.ts",

src/__tests__/plugin.spec.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { ISettingRegistry, SettingRegistry } from '@jupyterlab/settingregistry';
66
import { JupyterLab } from '@jupyterlab/application';
77
import { showErrorMessage } from '@jupyterlab/apputils';
88
import { URLExt } from '@jupyterlab/coreutils';
9+
import { ServerConnection } from '@jupyterlab/services';
910
import { Signal } from '@lumino/signaling';
1011
import {
1112
defaultMockedResponses,
@@ -30,6 +31,10 @@ describe('plugin', () => {
3031

3132
beforeAll(() => {
3233
app = new JupyterLab() as jest.Mocked<JupyterLab>;
34+
// Add the serviceManager.serverSettings mock
35+
(app as any).serviceManager = {
36+
serverSettings: ServerConnection.makeSettings()
37+
};
3338
browserFactory = {
3439
defaultBrowser: {
3540
model: { pathChanged: new Signal(null), restored: Promise.resolve() }

src/__tests__/utils.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { ServerConnection } from '@jupyterlab/services';
12
import { ReadonlyJSONObject } from '@lumino/coreutils';
23
import { Git } from '../tokens';
34

@@ -44,8 +45,7 @@ export const defaultMockedResponses: {
4445
stash: {
4546
body: () => ({
4647
code: 0,
47-
message: '',
48-
command: ''
48+
stashes: []
4949
})
5050
},
5151
status: {
@@ -68,13 +68,15 @@ export function mockedRequestAPI(
6868
endPoint?: string,
6969
method?: string,
7070
body?: ReadonlyJSONObject | null,
71-
namespace?: string
71+
namespace?: string,
72+
serverSettings?: ServerConnection.ISettings
7273
) => Promise<any> {
7374
const mockedImplementation = (
7475
url?: string,
7576
method?: string,
7677
body?: ReadonlyJSONObject | null,
77-
namespace?: string
78+
namespace?: string,
79+
serverSettings?: ServerConnection.ISettings
7880
) => {
7981
mockedResponses = mockedResponses ?? {};
8082
const path = mockedResponses.path ?? DEFAULT_REPOSITORY_PATH;

src/git.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export const AUTH_ERROR_MESSAGES = [
2020
* @param method HTML method; default 'GET'
2121
* @param body JSON object to be passed as body or null; default null
2222
* @param namespace API namespace; default 'git'
23+
* @param serverSettings Optional server connection settings; if not provided, uses ServerConnection.makeSettings()
2324
* @returns The response body interpreted as JSON
2425
*
2526
* @throws {Git.GitResponseError} If the server response is not ok
@@ -29,10 +30,11 @@ export async function requestAPI<T>(
2930
endPoint = '',
3031
method = 'GET',
3132
body: Partial<ReadonlyJSONObject> | null = null,
32-
namespace = 'git'
33+
namespace = 'git',
34+
serverSettings?: ServerConnection.ISettings
3335
): Promise<T> {
3436
// Make request to Jupyter API
35-
const settings = ServerConnection.makeSettings();
37+
const settings = serverSettings ?? ServerConnection.makeSettings();
3638
const requestUrl = URLExt.join(
3739
settings.baseUrl,
3840
namespace, // API Namespace

src/handler.ts

Lines changed: 0 additions & 46 deletions
This file was deleted.

src/index.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ async function activate(
8686
translator: ITranslator | null
8787
): Promise<IGitExtension> {
8888
let settings: ISettingRegistry.ISettings | undefined = undefined;
89-
let serverSettings: Git.IServerSettings;
89+
let gitServerSettings: Git.IServerSettings;
9090
translator = translator ?? nullTranslator;
9191
const trans = translator.load('jupyterlab_git');
9292

@@ -98,9 +98,10 @@ async function activate(
9898
trans.__('Failed to load settings for the Git Extension.\n%1', error)
9999
);
100100
}
101+
const serverSettings = app.serviceManager.serverSettings;
101102
try {
102-
serverSettings = await getServerSettings(trans);
103-
const { frontendVersion, gitVersion, serverVersion } = serverSettings;
103+
gitServerSettings = await getServerSettings(trans, serverSettings);
104+
const { frontendVersion, gitVersion, serverVersion } = gitServerSettings;
104105

105106
// Version validation
106107
if (!gitVersion) {
@@ -145,7 +146,12 @@ async function activate(
145146
return null;
146147
}
147148
// Create the Git model
148-
const gitExtension = new GitExtension(docmanager, app.docRegistry, settings);
149+
const gitExtension = new GitExtension(
150+
docmanager,
151+
app.docRegistry,
152+
settings,
153+
serverSettings
154+
);
149155

150156
const onPathChanged = (
151157
model: FileBrowserModel,

0 commit comments

Comments
 (0)