@budibase/worker 2.11.45 → 2.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Dockerfile
CHANGED
|
@@ -14,7 +14,7 @@ RUN yarn global add pm2
|
|
|
14
14
|
|
|
15
15
|
COPY package.json .
|
|
16
16
|
COPY dist/yarn.lock .
|
|
17
|
-
RUN yarn install --production=true
|
|
17
|
+
RUN yarn install --production=true --network-timeout 1000000
|
|
18
18
|
# Remove unneeded data from file system to reduce image size
|
|
19
19
|
RUN apk del .gyp \
|
|
20
20
|
&& yarn cache clean
|
package/Dockerfile.v2
CHANGED
|
@@ -19,7 +19,7 @@ RUN chmod +x ./scripts/removeWorkspaceDependencies.sh
|
|
|
19
19
|
WORKDIR /string-templates
|
|
20
20
|
COPY packages/string-templates/package.json package.json
|
|
21
21
|
RUN ../scripts/removeWorkspaceDependencies.sh package.json
|
|
22
|
-
RUN --mount=type=cache,target=/root/.yarn YARN_CACHE_FOLDER=/root/.yarn yarn install --production=true
|
|
22
|
+
RUN --mount=type=cache,target=/root/.yarn YARN_CACHE_FOLDER=/root/.yarn yarn install --production=true --network-timeout 1000000
|
|
23
23
|
COPY packages/string-templates .
|
|
24
24
|
|
|
25
25
|
|
|
@@ -30,7 +30,7 @@ RUN cd ../string-templates && yarn link && cd - && yarn link @budibase/string-te
|
|
|
30
30
|
|
|
31
31
|
RUN ../scripts/removeWorkspaceDependencies.sh package.json
|
|
32
32
|
|
|
33
|
-
RUN --mount=type=cache,target=/root/.yarn YARN_CACHE_FOLDER=/root/.yarn yarn install --production=true
|
|
33
|
+
RUN --mount=type=cache,target=/root/.yarn YARN_CACHE_FOLDER=/root/.yarn yarn install --production=true --network-timeout 1000000
|
|
34
34
|
# Remove unneeded data from file system to reduce image size
|
|
35
35
|
RUN apk del .gyp \
|
|
36
36
|
&& yarn cache clean
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@budibase/worker",
|
|
3
3
|
"email": "hi@budibase.com",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.12.0",
|
|
5
5
|
"description": "Budibase background service",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"repository": {
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"run:docker": "node dist/index.js",
|
|
21
21
|
"debug": "yarn build && node --expose-gc --inspect=9223 dist/index.js",
|
|
22
22
|
"run:docker:cluster": "pm2-runtime start pm2.config.js",
|
|
23
|
-
"build:docker": "yarn build && docker build
|
|
23
|
+
"build:docker": "yarn nx build && docker buildx build ../.. -t worker-service --label version=$BUDIBASE_RELEASE_VERSION --build-arg BUDIBASE_VERSION=$BUDIBASE_RELEASE_VERSION -f Dockerfile.v2 --platform linux/amd64,linux/arm64",
|
|
24
24
|
"dev:stack:init": "node ./scripts/dev/manage.js init",
|
|
25
25
|
"dev:builder": "npm run dev:stack:init && nodemon",
|
|
26
26
|
"dev:built": "yarn run dev:stack:init && yarn run run:docker",
|
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
"author": "Budibase",
|
|
39
39
|
"license": "GPL-3.0",
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@budibase/backend-core": "2.
|
|
42
|
-
"@budibase/pro": "2.
|
|
43
|
-
"@budibase/string-templates": "2.
|
|
44
|
-
"@budibase/types": "2.
|
|
41
|
+
"@budibase/backend-core": "2.12.0",
|
|
42
|
+
"@budibase/pro": "2.12.0",
|
|
43
|
+
"@budibase/string-templates": "2.12.0",
|
|
44
|
+
"@budibase/types": "2.12.0",
|
|
45
45
|
"@koa/router": "8.0.8",
|
|
46
46
|
"@techpass/passport-openidconnect": "0.3.2",
|
|
47
47
|
"@types/global-agent": "2.1.1",
|
|
@@ -108,5 +108,5 @@
|
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
},
|
|
111
|
-
"gitHead": "
|
|
111
|
+
"gitHead": "b1ed21810000332da296d8fe556a166851626ae2"
|
|
112
112
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { events } from "@budibase/backend-core"
|
|
2
2
|
import { generator } from "@budibase/backend-core/tests"
|
|
3
3
|
import { structures, TestConfiguration, mocks } from "../../../../tests"
|
|
4
|
-
import { UserGroup } from "@budibase/types"
|
|
4
|
+
import { User, UserGroup } from "@budibase/types"
|
|
5
5
|
|
|
6
6
|
mocks.licenses.useGroups()
|
|
7
7
|
|
|
@@ -231,4 +231,39 @@ describe("/api/global/groups", () => {
|
|
|
231
231
|
})
|
|
232
232
|
})
|
|
233
233
|
})
|
|
234
|
+
|
|
235
|
+
describe("with global builder role", () => {
|
|
236
|
+
let builder: User
|
|
237
|
+
let group: UserGroup
|
|
238
|
+
|
|
239
|
+
beforeAll(async () => {
|
|
240
|
+
builder = await config.createUser({
|
|
241
|
+
builder: { global: true },
|
|
242
|
+
admin: { global: false },
|
|
243
|
+
})
|
|
244
|
+
await config.createSession(builder)
|
|
245
|
+
|
|
246
|
+
let resp = await config.api.groups.saveGroup(
|
|
247
|
+
structures.groups.UserGroup()
|
|
248
|
+
)
|
|
249
|
+
group = resp.body as UserGroup
|
|
250
|
+
})
|
|
251
|
+
|
|
252
|
+
it("find should return 200", async () => {
|
|
253
|
+
await config.withUser(builder, async () => {
|
|
254
|
+
await config.api.groups.searchUsers(group._id!, {
|
|
255
|
+
emailSearch: `user1`,
|
|
256
|
+
})
|
|
257
|
+
})
|
|
258
|
+
})
|
|
259
|
+
|
|
260
|
+
it("update should return 200", async () => {
|
|
261
|
+
await config.withUser(builder, async () => {
|
|
262
|
+
await config.api.groups.updateGroupUsers(group._id!, {
|
|
263
|
+
add: [builder._id!],
|
|
264
|
+
remove: [],
|
|
265
|
+
})
|
|
266
|
+
})
|
|
267
|
+
})
|
|
268
|
+
})
|
|
234
269
|
})
|
|
@@ -190,6 +190,16 @@ class TestConfiguration {
|
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
192
|
|
|
193
|
+
async withUser(user: User, f: () => Promise<void>) {
|
|
194
|
+
const oldUser = this.user
|
|
195
|
+
this.user = user
|
|
196
|
+
try {
|
|
197
|
+
await f()
|
|
198
|
+
} finally {
|
|
199
|
+
this.user = oldUser
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
193
203
|
authHeaders(user: User) {
|
|
194
204
|
const authToken: AuthToken = {
|
|
195
205
|
userId: user._id!,
|
|
@@ -257,9 +267,10 @@ class TestConfiguration {
|
|
|
257
267
|
})
|
|
258
268
|
}
|
|
259
269
|
|
|
260
|
-
async createUser(
|
|
261
|
-
|
|
262
|
-
|
|
270
|
+
async createUser(opts?: Partial<User>) {
|
|
271
|
+
let user = structures.users.user()
|
|
272
|
+
if (user) {
|
|
273
|
+
user = { ...user, ...opts }
|
|
263
274
|
}
|
|
264
275
|
const response = await this._req(user, null, controllers.users.save)
|
|
265
276
|
const body = response as SaveUserResponse
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { generator } from "@budibase/backend-core/tests"
|
|
2
2
|
import { db } from "@budibase/backend-core"
|
|
3
|
-
import { UserGroupRoles } from "@budibase/types"
|
|
3
|
+
import { UserGroup as UserGroupType, UserGroupRoles } from "@budibase/types"
|
|
4
4
|
|
|
5
|
-
export
|
|
5
|
+
export function UserGroup(): UserGroupType {
|
|
6
6
|
const appsCount = generator.integer({ min: 0, max: 3 })
|
|
7
7
|
const roles = Array.from({ length: appsCount }).reduce(
|
|
8
8
|
(p: UserGroupRoles, v) => {
|
|
@@ -14,13 +14,11 @@ export const UserGroup = () => {
|
|
|
14
14
|
{}
|
|
15
15
|
)
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
apps: [],
|
|
17
|
+
return {
|
|
19
18
|
color: generator.color(),
|
|
20
19
|
icon: generator.word(),
|
|
21
20
|
name: generator.word(),
|
|
22
21
|
roles: roles,
|
|
23
22
|
users: [],
|
|
24
23
|
}
|
|
25
|
-
return group
|
|
26
24
|
}
|