Skip to content

Commit

Permalink
Merged
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandruPopovici committed Dec 18, 2024
2 parents b89ce8d + 047f21a commit ac43169
Show file tree
Hide file tree
Showing 322 changed files with 7,449 additions and 3,021 deletions.
7 changes: 4 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,9 @@ jobs:
POSTGRES_USER: speckle
command: -c 'max_connections=1000' -c 'port=5433' -c 'wal_level=logical'
- image: 'minio/minio'
command: server /data --console-address ":9001"
command: server /data --console-address ":9001" --address "0.0.0.0:9000"
- image: 'minio/minio'
command: server /data --console-address ":9021" --address "0.0.0.0:9020"
environment:
# Same as test-server:
NODE_ENV: test
Expand All @@ -621,6 +623,7 @@ jobs:
MULTI_REGION_CONFIG_PATH: '../../.circleci/multiregion.test-ci.json'
FF_WORKSPACES_MODULE_ENABLED: 'true'
FF_WORKSPACES_MULTI_REGION_ENABLED: 'true'
FF_WORKSPACES_MULTI_REGION_BLOB_STORAGE_ENABLED: 'true'
RUN_TESTS_IN_MULTIREGION_MODE: true

test-frontend-2:
Expand Down Expand Up @@ -1046,7 +1049,6 @@ jobs:
docker-build-monitor-container:
<<: *build-job
environment:
FOLDER: utils
SPECKLE_SERVER_PACKAGE: monitor-deployment

docker-build-docker-compose-ingress:
Expand Down Expand Up @@ -1116,7 +1118,6 @@ jobs:
docker-publish-monitor-container:
<<: *publish-job
environment:
FOLDER: utils
SPECKLE_SERVER_PACKAGE: monitor-deployment

docker-publish-docker-compose-ingress:
Expand Down
16 changes: 16 additions & 0 deletions .circleci/multiregion.test-ci.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,28 @@
"main": {
"postgres": {
"connectionUri": "postgresql://speckle:[email protected]:5432/speckle2_test"
},
"blobStorage": {
"accessKey": "minioadmin",
"secretKey": "minioadmin",
"bucket": "speckle-server",
"createBucketIfNotExists": true,
"endpoint": "http://127.0.0.1:9000",
"s3Region": "us-east-1"
}
},
"regions": {
"region1": {
"postgres": {
"connectionUri": "postgresql://speckle:[email protected]:5433/speckle2_test"
},
"blobStorage": {
"accessKey": "minioadmin",
"secretKey": "minioadmin",
"bucket": "speckle-server",
"createBucketIfNotExists": true,
"endpoint": "http://127.0.0.1:9020",
"s3Region": "us-east-1"
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ redis-data/
.tshy-build
obj/
bin/

!packages/monitor-deployment/bin
!packages/preview-service/bin
!packages/server/bin

# Server
multiregion.json
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,14 @@ EMAIL_PORT="1025"

The web portal is available at `localhost:1080` and it's listening for mail on port `1025`.

### Minio (S3 storage)

Default credentials are: `minioadmin:minioadmin`
Main storage Web UI: [http://localhost:9001/](http://localhost:9001/)
Region1 storage Web UI: [http://localhost:9021/](http://localhost:9021/)

You can use the web UI to validate uploaded blobs

# Contributing

Please make sure you read the [contribution guidelines](https://github.com/specklesystems/speckle-server/blob/main/CONTRIBUTING.md) for an overview of the best practices we try to follow.
Expand Down
11 changes: 11 additions & 0 deletions docker-compose-deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,16 @@ services:
- '127.0.0.1:9000:9000'
- '127.0.0.1:9001:9001'

minio-region1:
image: 'minio/minio'
command: server /data --console-address ":9001"
restart: always
volumes:
- minio-region1-data:/data
ports:
- '127.0.0.1:9020:9000'
- '127.0.0.1:9021:9001'

# Local OIDC provider for testing
keycloak:
image: quay.io/keycloak/keycloak:25.0
Expand Down Expand Up @@ -127,3 +137,4 @@ volumes:
pgadmin-data:
redis_insight-data:
minio-data:
minio-region1-data:
2 changes: 2 additions & 0 deletions mise.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[tools]
node = '22'
20 changes: 20 additions & 0 deletions packages/dui3/lib/common/generated/gql/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2556,8 +2556,11 @@ export type Query = {
/**
* Search for users and return limited metadata about them, if you have the server:user role.
* The query looks for matches in name & email
* @deprecated Use users() instead.
*/
userSearch: UserSearchResultCollection;
/** Look up server users */
users: UserSearchResultCollection;
/** Validates the slug, to make sure it contains only valid characters and its not taken. */
validateWorkspaceSlug: Scalars['Boolean']['output'];
workspace: Workspace;
Expand Down Expand Up @@ -2699,6 +2702,11 @@ export type QueryUserSearchArgs = {
};


export type QueryUsersArgs = {
input: UsersRetrievalInput;
};


export type QueryValidateWorkspaceSlugArgs = {
slug: Scalars['String']['input'];
};
Expand Down Expand Up @@ -3871,6 +3879,18 @@ export type UserWorkspacesFilter = {
search?: InputMaybe<Scalars['String']['input']>;
};

export type UsersRetrievalInput = {
cursor?: InputMaybe<Scalars['String']['input']>;
/** Only find users with directly matching emails */
emailOnly?: InputMaybe<Scalars['Boolean']['input']>;
/** Limit defaults to 10 */
limit?: InputMaybe<Scalars['Int']['input']>;
/** Only find users that are collaborators of the specified project */
projectId?: InputMaybe<Scalars['String']['input']>;
/** The query looks for matches in user name & email */
query: Scalars['String']['input'];
};

export type Version = {
__typename?: 'Version';
authorUser?: Maybe<LimitedUser>;
Expand Down
2 changes: 1 addition & 1 deletion packages/fileimport-service/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ RUN chmod +x /usr/bin/tini
RUN apt-get update -y \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
--no-install-recommends \
curl=8.5.0-2ubuntu10.5 \
curl=8.5.0-2ubuntu10.6 \
&& curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
--no-install-recommends \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1" />
<PackageReference Include="Speckle.WebIfc.Importer" Version="0.0.5" />
<PackageReference Include="Speckle.WebIfc.Importer" Version="0.0.7" />
<PackageReference Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
</ItemGroup>

Expand Down
15 changes: 12 additions & 3 deletions packages/fileimport-service/knex.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,25 @@ const isDevEnv = process.env.NODE_ENV !== 'production'
let dbClients
const getDbClients = async () => {
if (dbClients) return dbClients
const maxConnections =
parseInt(process.env.POSTGRES_MAX_CONNECTIONS_FILE_IMPORT_SERVICE) || 1
const maxConnections = parseInt(
process.env['POSTGRES_MAX_CONNECTIONS_FILE_IMPORT_SERVICE'] || '1'
)
const connectionAcquireTimeoutMillis = parseInt(
process.env['POSTGRES_CONNECTION_ACQUIRE_TIMEOUT_MILLIS'] || '16000'
)
const connectionCreateTimeoutMillis = parseInt(
process.env['POSTGRES_CONNECTION_CREATE_TIMEOUT_MILLIS'] || '5000'
)

const configArgs = {
migrationDirs: [],
isTestEnv: isDevEnv,
isDevOrTestEnv: isDevEnv,
logger,
maxConnections,
applicationName: 'speckle_fileimport_service'
applicationName: 'speckle_fileimport_service',
connectionAcquireTimeoutMillis,
connectionCreateTimeoutMillis
}
if (!FF_WORKSPACES_MULTI_REGION_ENABLED) {
const mainClient = configureKnexClient(
Expand Down
1 change: 0 additions & 1 deletion packages/frontend-2/components/auth/sso/Login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ graphql(`
slug
name
logo
defaultLogoIndex
}
`)
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend-2/components/auth/sso/Register.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<div class="flex flex-col items-center gap-4">
<WorkspaceAvatar
v-if="workspace"
:name="workspace.name"
:logo="workspace.logo"
:default-logo-index="workspace.defaultLogoIndex"
size="xl"
/>

Expand Down
12 changes: 2 additions & 10 deletions packages/frontend-2/components/auth/sso/WorkspaceSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,14 @@
>
<template #option="{ item }">
<div class="flex items-center gap-2">
<WorkspaceAvatar
:logo="item.logo"
:default-logo-index="item.defaultLogoIndex"
size="xs"
/>
<WorkspaceAvatar :name="item.name" :logo="item.logo" size="xs" />
<span>{{ item.name }}</span>
</div>
</template>
<template #nothing-selected>Select a workspace</template>
<template #something-selected="{ value }">
<div v-if="!isArrayValue(value)" class="flex items-center gap-2">
<WorkspaceAvatar
:logo="value.logo"
:default-logo-index="value.defaultLogoIndex"
size="xs"
/>
<WorkspaceAvatar :logo="value.logo" :name="value.name" size="xs" />
<span>{{ value.name }}</span>
</div>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ const buttons = computed((): LayoutDialogButton[] => {
disabled: !selectedFunction.value
},
onClick: () => {
mixpanel.track('Automate Select Function')
step.value++
}
}
Expand All @@ -239,6 +240,9 @@ const buttons = computed((): LayoutDialogButton[] => {
{
id: 'fnParamsNext',
text: 'Next',
onClick: () => {
mixpanel.track('Automate Set Function Parameters ')
},
props: {
disabled: hasParameterErrors.value
},
Expand All @@ -258,6 +262,9 @@ const buttons = computed((): LayoutDialogButton[] => {
{
id: 'detailsCreate',
text: 'Create',
onClick: () => {
mixpanel.track('Automate Set Automation Details')
},
submit: true,
disabled: creationLoading.value
}
Expand Down Expand Up @@ -431,7 +438,7 @@ const onDetailsSubmit = handleDetailsSubmit(async () => {
return
}
mixpanel.track('Automation created', {
mixpanel.track('Automate Automation Created', {
automationId: aId,
name,
projectId: project.id,
Expand Down
36 changes: 29 additions & 7 deletions packages/frontend-2/components/automate/function/CreateDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,12 @@ import {
useUpdateAutomateFunction
} from '~/lib/automate/composables/management'
import { useMutationLoading } from '@vue/apollo-composable'
import type { AutomateFunctionCreateDialogDoneStep_AutomateFunctionFragment } from '~~/lib/common/generated/gql/graphql'
import type {
AutomateFunctionCreateDialogDoneStep_AutomateFunctionFragment,
AutomateFunctionCreateDialog_WorkspaceFragment
} from '~~/lib/common/generated/gql/graphql'
import { useMixpanel } from '~/lib/core/composables/mp'
import { graphql } from '~/lib/common/generated/gql'
enum FunctionCreateSteps {
Authorize,
Expand All @@ -73,11 +77,19 @@ enum FunctionCreateSteps {
type DetailsFormValues = FunctionDetailsFormValues
graphql(`
fragment AutomateFunctionCreateDialog_Workspace on Workspace {
id
name
slug
}
`)
const props = defineProps<{
isAuthorized: boolean
templates: CreatableFunctionTemplate[]
githubOrgs: string[]
workspaceId?: string
workspace?: AutomateFunctionCreateDialog_WorkspaceFragment
}>()
const open = defineModel<boolean>('open', { required: true })
Expand Down Expand Up @@ -114,26 +126,27 @@ const onDetailsSubmit = handleDetailsSubmit(async (values) => {
templateId: selectedTemplate.value.id,
name: values.name,
/* eslint-disable-next-line camelcase */
workspace_id: props.workspaceId
workspace_id: props.workspace?.id
})
createdFunction.value = res
step.value++
if (!props.workspaceId) {
if (!props.workspace?.id) {
return
}
await updateFunction({
input: {
id: res.id,
workspaceIds: [props.workspaceId]
workspaceIds: [props.workspace.id]
}
})
})
const onSubmit = computed(() => {
switch (enumStep.value) {
case FunctionCreateSteps.Details:
mixpanel.track('Automate Configure Function Details')
return onDetailsSubmit
default:
return noop
Expand Down Expand Up @@ -183,7 +196,10 @@ const title = computed(() => {
})
const authorizeGithubUrl = computed(() => {
const redirectUrl = new URL(automateGithubAppAuthorizationRoute, apiBaseUrl)
const redirectUrl = new URL(
automateGithubAppAuthorizationRoute(props.workspace?.slug),
apiBaseUrl
)
return redirectUrl.toString()
})
Expand All @@ -203,6 +219,9 @@ const buttons = computed((): LayoutDialogButton[] => {
{
id: 'authorizeAuthorize',
text: 'Authorize',
onClick: () => {
mixpanel.track('Automate Start Authorize GitHub App')
},
props: {
fullWidth: true,
to: authorizeGithubUrl.value,
Expand All @@ -219,7 +238,10 @@ const buttons = computed((): LayoutDialogButton[] => {
iconRight: ChevronRightIcon,
disabled: !selectedTemplate.value
},
onClick: () => step.value++
onClick: () => {
mixpanel.track('Automate Select Function Template')
step.value++
}
}
]
case FunctionCreateSteps.Details:
Expand Down
Loading

0 comments on commit ac43169

Please sign in to comment.