Skip to content

Commit a4a1d37

Browse files
authored
Merge branch 'main' into typescript-setup
2 parents 983aa07 + 1052727 commit a4a1d37

File tree

19 files changed

+837
-404
lines changed

19 files changed

+837
-404
lines changed

cypress/e2e/autoApproved.cy.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,9 @@ describe('Auto-Approved Push Test', () => {
6363
.local()
6464
.format('dddd, MMMM Do YYYY, h:mm:ss a');
6565

66-
cy.get('kbd')
67-
.trigger('mouseover')
68-
.then(() => {
69-
cy.get('.MuiTooltip-tooltip').should('contain', expectedTooltipTimestamp);
70-
});
66+
cy.get('kbd').trigger('mouseover');
67+
68+
cy.get('.MuiTooltip-tooltip').should('contain', expectedTooltipTimestamp);
7169

7270
cy.contains('approved this contribution').should('not.exist');
7371
});

cypress/e2e/repo.cy.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,11 @@ describe('Repo', () => {
133133
.next()
134134
.get('svg.octicon-copy')
135135
.should('exist')
136-
.click()
137-
.get('svg.octicon-copy')
138-
.should('not.exist')
139-
.get('svg.octicon-check')
140-
.should('exist');
136+
.click();
137+
138+
cy.get('svg.octicon-copy').should('not.exist');
139+
140+
cy.get('svg.octicon-check').should('exist');
141141
});
142142

143143
after(() => {

experimental/license-inventory/package-lock.json

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

experimental/license-inventory/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"cors": "^2.8.5",
2121
"dotenv": "^17.2.2",
2222
"express": "^5.1.0",
23-
"express-rate-limit": "^7.5.0",
23+
"express-rate-limit": "^8.1.0",
2424
"helmet": "^8.0.0",
2525
"http-status-codes": "^2.3.0",
2626
"mongoose": "^8.10.1",

package-lock.json

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

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@
8282
"@seald-io/nedb": "^4.1.2",
8383
"axios": "^1.12.2",
8484
"bcryptjs": "^3.0.2",
85-
"bit-mask": "^1.0.2",
8685
"clsx": "^2.1.1",
8786
"concurrently": "^9.2.1",
8887
"connect-mongo": "^5.1.0",
@@ -91,7 +90,7 @@
9190
"env-paths": "^2.2.1",
9291
"express": "^4.21.2",
9392
"express-http-proxy": "^2.1.2",
94-
"express-rate-limit": "^7.5.1",
93+
"express-rate-limit": "^8.1.0",
9594
"express-session": "^1.18.2",
9695
"history": "5.3.0",
9796
"isomorphic-git": "^1.33.1",

plugins/git-proxy-plugin-samples/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"./example": "./example.cjs"
1414
},
1515
"dependencies": {
16-
"express": "^4.21.2"
16+
"express": "^5.1.0"
1717
},
1818
"peerDependencies": {
1919
"@finos/git-proxy": "^1.19.2"

src/db/file/repo.ts

Lines changed: 40 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -106,20 +106,19 @@ export const createRepo = async (repo: Repo): Promise<Repo> => {
106106

107107
export const addUserCanPush = async (_id: string, user: string): Promise<void> => {
108108
user = user.toLowerCase();
109-
return new Promise(async (resolve, reject) => {
110-
const repo = await getRepoById(_id);
111-
if (!repo) {
112-
reject(new Error('Repo not found'));
113-
return;
114-
}
115-
116-
if (repo.users?.canPush.includes(user)) {
117-
resolve();
118-
return;
119-
}
120-
repo.users?.canPush.push(user);
121-
122-
const options = { multi: false, upsert: false };
109+
const repo = await getRepoById(_id);
110+
if (!repo) {
111+
throw new Error('Repo not found');
112+
}
113+
114+
if (repo.users?.canPush.includes(user)) {
115+
return;
116+
}
117+
repo.users?.canPush.push(user);
118+
119+
const options = { multi: false, upsert: false };
120+
121+
return new Promise<void>((resolve, reject) => {
123122
db.update({ _id: _id }, repo, options, (err) => {
124123
// ignore for code coverage as neDB rarely returns errors even for an invalid query
125124
/* istanbul ignore if */
@@ -134,21 +133,20 @@ export const addUserCanPush = async (_id: string, user: string): Promise<void> =
134133

135134
export const addUserCanAuthorise = async (_id: string, user: string): Promise<void> => {
136135
user = user.toLowerCase();
137-
return new Promise(async (resolve, reject) => {
138-
const repo = await getRepoById(_id);
139-
if (!repo) {
140-
reject(new Error('Repo not found'));
141-
return;
142-
}
136+
const repo = await getRepoById(_id);
137+
if (!repo) {
138+
throw new Error('Repo not found');
139+
}
143140

144-
if (repo.users.canAuthorise.includes(user)) {
145-
resolve();
146-
return;
147-
}
141+
if (repo.users.canAuthorise.includes(user)) {
142+
return;
143+
}
148144

149-
repo.users.canAuthorise.push(user);
145+
repo.users.canAuthorise.push(user);
150146

151-
const options = { multi: false, upsert: false };
147+
const options = { multi: false, upsert: false };
148+
149+
return new Promise((resolve, reject) => {
152150
db.update({ _id: _id }, repo, options, (err) => {
153151
// ignore for code coverage as neDB rarely returns errors even for an invalid query
154152
/* istanbul ignore if */
@@ -163,16 +161,16 @@ export const addUserCanAuthorise = async (_id: string, user: string): Promise<vo
163161

164162
export const removeUserCanAuthorise = async (_id: string, user: string): Promise<void> => {
165163
user = user.toLowerCase();
166-
return new Promise(async (resolve, reject) => {
167-
const repo = await getRepoById(_id);
168-
if (!repo) {
169-
reject(new Error('Repo not found'));
170-
return;
171-
}
164+
const repo = await getRepoById(_id);
165+
if (!repo) {
166+
throw new Error('Repo not found');
167+
}
172168

173-
repo.users.canAuthorise = repo.users.canAuthorise.filter((x: string) => x != user);
169+
repo.users.canAuthorise = repo.users.canAuthorise.filter((x: string) => x != user);
174170

175-
const options = { multi: false, upsert: false };
171+
const options = { multi: false, upsert: false };
172+
173+
return new Promise<void>((resolve, reject) => {
176174
db.update({ _id: _id }, repo, options, (err) => {
177175
// ignore for code coverage as neDB rarely returns errors even for an invalid query
178176
/* istanbul ignore if */
@@ -187,16 +185,16 @@ export const removeUserCanAuthorise = async (_id: string, user: string): Promise
187185

188186
export const removeUserCanPush = async (_id: string, user: string): Promise<void> => {
189187
user = user.toLowerCase();
190-
return new Promise(async (resolve, reject) => {
191-
const repo = await getRepoById(_id);
192-
if (!repo) {
193-
reject(new Error('Repo not found'));
194-
return;
195-
}
188+
const repo = await getRepoById(_id);
189+
if (!repo) {
190+
throw new Error('Repo not found');
191+
}
192+
193+
repo.users.canPush = repo.users.canPush.filter((x) => x != user);
196194

197-
repo.users.canPush = repo.users.canPush.filter((x) => x != user);
195+
const options = { multi: false, upsert: false };
198196

199-
const options = { multi: false, upsert: false };
197+
return new Promise<void>((resolve, reject) => {
200198
db.update({ _id: _id }, repo, options, (err) => {
201199
// ignore for code coverage as neDB rarely returns errors even for an invalid query
202200
/* istanbul ignore if */

0 commit comments

Comments
 (0)