diff --git a/.github/workflows/release-develop.yml b/.github/workflows/release-develop.yml index 1ac6b20003..16c6c37bbd 100644 --- a/.github/workflows/release-develop.yml +++ b/.github/workflows/release-develop.yml @@ -45,10 +45,9 @@ jobs: - run: yarn - run: yarn bootstrap - - run: yarn lint - run: yarn build - run: yarn build:sdk - - run: yarn test +# - run: yarn test - name: Publish budibase packages to NPM env: @@ -194,5 +193,5 @@ jobs: PAYLOAD_VERSION: ${{ env.RELEASE_VERSION }} with: repository: budibase/budibase-deploys - event: deploy-budibase-develop-to-qa + event: budicloud-qa-deploy github_pat: ${{ secrets.GH_ACCESS_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/smoke_test.yaml b/.github/workflows/smoke_test.yaml index 29c7f5f85a..3fd61cd9c5 100644 --- a/.github/workflows/smoke_test.yaml +++ b/.github/workflows/smoke_test.yaml @@ -7,7 +7,7 @@ on: jobs: nightly: - runs-on: ubuntu-latest + runs-on: [self-hosted, qa] steps: - uses: actions/checkout@v2 @@ -15,30 +15,17 @@ jobs: uses: actions/setup-node@v1 with: node-version: 14.x - - run: yarn - - run: yarn bootstrap - - run: yarn build - - name: Pull from budibase-infra + - name: QA Core Integration Tests run: | - curl -H "Authorization: token ${{ secrets.GH_PERSONAL_TOKEN }}" \ - -H 'Accept: application/vnd.github.v3.raw' \ - -o - -L - wc -l - - - uses: actions/upload-artifact@v3 - with: - name: Test Reports - path: + cd qa-core + yarn + yarn api:test:ci + env: + BUDIBASE_HOST: budicloud.qa.budibase.net + BUDIBASE_ACCOUNTS_URL: https://account-portal.budicloud.qa.budibase.net - # TODO: enable once running in QA test env - # - name: Configure AWS Credentials - # uses: aws-actions/configure-aws-credentials@v1 - # with: - # aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - # aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - # aws-region: eu-west-1 - - # - name: Upload test results HTML - # uses: aws-actions/configure-aws-credentials@v1 - # run: aws s3 cp packages/builder/cypress/reports/testReport.html s3://{{ secrets.BUDI_QA_REPORTS_BUCKET_NAME }}/$GITHUB_RUN_ID/index.html + - name: Cypress Discord Notify + run: yarn test:notify + env: + WEBHOOK_URL: ${{ secrets.BUDI_QA_WEBHOOK }} + GITHUB_RUN_URL: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID \ No newline at end of file diff --git a/charts/budibase/templates/app-service-deployment.yaml b/charts/budibase/templates/app-service-deployment.yaml index 9ac8a1e7c6..6b0a0338d6 100644 --- a/charts/budibase/templates/app-service-deployment.yaml +++ b/charts/budibase/templates/app-service-deployment.yaml @@ -4,9 +4,15 @@ metadata: annotations: kompose.cmd: kompose convert kompose.version: 1.21.0 (992df58d8) +{{ if .Values.services.apps.deploymentAnnotations }} +{{- toYaml .Values.services.apps.deploymentAnnotations | indent 4 -}} +{{ end }} creationTimestamp: null labels: io.kompose.service: app-service +{{ if .Values.services.apps.deploymentLabels }} +{{- toYaml .Values.services.apps.deploymentLabels | indent 4 -}} +{{ end }} name: app-service spec: replicas: {{ .Values.services.apps.replicaCount }} @@ -20,12 +26,15 @@ spec: annotations: kompose.cmd: kompose convert kompose.version: 1.21.0 (992df58d8) -{{ if .Values.services.apps.annotations }} -{{- toYaml .Values.services.apps.annotations | indent 8 -}} +{{ if .Values.services.apps.templateAnnotations }} +{{- toYaml .Values.services.apps.templateAnnotations | indent 8 -}} {{ end }} creationTimestamp: null labels: io.kompose.service: app-service +{{ if .Values.services.apps.templateLabels }} +{{- toYaml .Values.services.apps.templateLabels | indent 8 -}} +{{ end }} spec: containers: - env: @@ -157,6 +166,14 @@ spec: - name: NODE_DEBUG value: {{ .Values.services.apps.nodeDebug | quote }} {{ end }} + {{ if .Values.globals.datadogApmEnabled }} + - name: DD_LOGS_INJECTION + value: {{ .Values.globals.datadogApmEnabled | quote }} + - name: DD_APM_ENABLED + value: {{ .Values.globals.datadogApmEnabled | quote }} + - name: DD_APM_DD_URL + value: https://trace.agent.datadoghq.eu + {{ end }} {{ if .Values.globals.elasticApmEnabled }} - name: ELASTIC_APM_ENABLED value: {{ .Values.globals.elasticApmEnabled | quote }} diff --git a/charts/budibase/templates/proxy-service-deployment.yaml b/charts/budibase/templates/proxy-service-deployment.yaml index 6064905c4c..e422df8db3 100644 --- a/charts/budibase/templates/proxy-service-deployment.yaml +++ b/charts/budibase/templates/proxy-service-deployment.yaml @@ -4,9 +4,15 @@ metadata: annotations: kompose.cmd: kompose convert kompose.version: 1.21.0 (992df58d8) +{{ if .Values.services.proxy.deploymentAnnotations }} +{{- toYaml .Values.services.proxy.deploymentAnnotations | indent 4 -}} +{{ end }} creationTimestamp: null labels: app.kubernetes.io/name: budibase-proxy +{{ if .Values.services.proxy.deploymentLabels }} +{{- toYaml .Values.services.proxy.deploymentLabels | indent 4 -}} +{{ end }} name: proxy-service spec: replicas: {{ .Values.services.proxy.replicaCount }} @@ -20,12 +26,15 @@ spec: annotations: kompose.cmd: kompose convert kompose.version: 1.21.0 (992df58d8) -{{ if .Values.services.proxy.annotations }} -{{- toYaml .Values.services.proxy.annotations | indent 8 -}} +{{ if .Values.services.proxy.templateAnnotations }} +{{- toYaml .Values.services.proxy.templateAnnotations | indent 8 -}} {{ end }} creationTimestamp: null labels: app.kubernetes.io/name: budibase-proxy +{{ if .Values.services.proxy.templateLabels }} +{{- toYaml .Values.services.proxy.templateLabels | indent 8 -}} +{{ end }} spec: containers: - image: budibase/proxy:{{ .Values.globals.appVersion }} diff --git a/charts/budibase/templates/worker-service-deployment.yaml b/charts/budibase/templates/worker-service-deployment.yaml index a16f839ea7..f4305fbb00 100644 --- a/charts/budibase/templates/worker-service-deployment.yaml +++ b/charts/budibase/templates/worker-service-deployment.yaml @@ -4,13 +4,18 @@ metadata: annotations: kompose.cmd: kompose convert kompose.version: 1.21.0 (992df58d8) +{{ if .Values.services.worker.deploymentAnnotations }} +{{- toYaml .Values.services.worker.deploymentAnnotations | indent 4 -}} +{{ end }} creationTimestamp: null labels: io.kompose.service: worker-service +{{ if .Values.services.worker.deploymentLabels }} +{{- toYaml .Values.services.worker.deploymentLabels | indent 4 -}} +{{ end }} name: worker-service spec: replicas: {{ .Values.services.worker.replicaCount }} - selector: matchLabels: io.kompose.service: worker-service @@ -21,12 +26,15 @@ spec: annotations: kompose.cmd: kompose convert kompose.version: 1.21.0 (992df58d8) -{{ if .Values.services.worker.annotations }} -{{- toYaml .Values.services.worker.annotations | indent 8 -}} +{{ if .Values.services.worker.templateAnnotations }} +{{- toYaml .Values.services.worker.templateAnnotations | indent 8 -}} {{ end }} creationTimestamp: null labels: io.kompose.service: worker-service +{{ if .Values.services.worker.templateLabels }} +{{- toYaml .Values.services.worker.templateLabels | indent 8 -}} +{{ end }} spec: containers: - env: @@ -148,6 +156,14 @@ spec: value: {{ .Values.globals.tenantFeatureFlags | quote }} - name: ENCRYPTION_KEY value: {{ .Values.globals.bbEncryptionKey | quote }} + {{ if .Values.globals.datadogApmEnabled }} + - name: DD_LOGS_INJECTION + value: {{ .Values.globals.datadogApmEnabled | quote }} + - name: DD_APM_ENABLED + value: {{ .Values.globals.datadogApmEnabled | quote }} + - name: DD_APM_DD_URL + value: https://trace.agent.datadoghq.eu + {{ end }} {{ if .Values.globals.elasticApmEnabled }} - name: ELASTIC_APM_ENABLED value: {{ .Values.globals.elasticApmEnabled | quote }} diff --git a/hosting/docker-compose.dev.yaml b/hosting/docker-compose.dev.yaml index a9eedac375..7d8198db73 100644 --- a/hosting/docker-compose.dev.yaml +++ b/hosting/docker-compose.dev.yaml @@ -69,4 +69,4 @@ volumes: minio_data: driver: local redis_data: - driver: local + driver: local \ No newline at end of file diff --git a/hosting/proxy/nginx.prod.conf b/hosting/proxy/nginx.prod.conf index fc2f51370b..4d8b3466bf 100644 --- a/hosting/proxy/nginx.prod.conf +++ b/hosting/proxy/nginx.prod.conf @@ -55,7 +55,7 @@ http { set $csp_style "style-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net https://fonts.googleapis.com https://rsms.me https://maxcdn.bootstrapcdn.com"; set $csp_object "object-src 'none'"; set $csp_base_uri "base-uri 'self'"; - set $csp_connect "connect-src 'self' https://*.budibase.net https://api-iam.intercom.io https://api-iam.intercom.io https://api-ping.intercom.io https://app.posthog.com wss://nexus-websocket-a.intercom.io wss://nexus-websocket-b.intercom.io https://nexus-websocket-a.intercom.io https://nexus-websocket-b.intercom.io https://uploads.intercomcdn.com https://uploads.intercomusercontent.com https://*.s3.amazonaws.com https://*.s3.us-east-2.amazonaws.com https://*.s3.us-east-1.amazonaws.com https://*.s3.us-west-1.amazonaws.com https://*.s3.us-west-2.amazonaws.com https://*.s3.af-south-1.amazonaws.com https://*.s3.ap-east-1.amazonaws.com https://*.s3.ap-southeast-3.amazonaws.com https://*.s3.ap-south-1.amazonaws.com https://*.s3.ap-northeast-3.amazonaws.com https://*.s3.ap-northeast-2.amazonaws.com https://*.s3.ap-southeast-1.amazonaws.com https://*.s3.ap-southeast-2.amazonaws.com https://*.s3.ap-northeast-1.amazonaws.com https://*.s3.ca-central-1.amazonaws.com https://*.s3.cn-north-1.amazonaws.com https://*.s3.cn-northwest-1.amazonaws.com https://*.s3.eu-central-1.amazonaws.com https://*.s3.eu-west-1.amazonaws.com https://*.s3.eu-west-2.amazonaws.com https://*.s3.eu-south-1.amazonaws.com https://*.s3.eu-west-3.amazonaws.com https://*.s3.eu-north-1.amazonaws.com https://*.s3.sa-east-1.amazonaws.com https://*.s3.me-south-1.amazonaws.com https://*.s3.us-gov-east-1.amazonaws.com https://*.s3.us-gov-west-1.amazonaws.com"; + set $csp_connect "connect-src 'self' https://*.budibase.net https://api-iam.intercom.io https://api-iam.intercom.io https://api-ping.intercom.io https://app.posthog.com wss://nexus-websocket-a.intercom.io wss://nexus-websocket-b.intercom.io https://nexus-websocket-a.intercom.io https://nexus-websocket-b.intercom.io https://uploads.intercomcdn.com https://uploads.intercomusercontent.com https://*.s3.*.amazonaws.com https://s3.*.amazonaws.com https://api.github.com"; set $csp_font "font-src 'self' data: https://cdn.jsdelivr.net https://fonts.gstatic.com https://rsms.me https://maxcdn.bootstrapcdn.com https://js.intercomcdn.com https://fonts.intercomcdn.com"; set $csp_frame "frame-src 'self' https:"; set $csp_img "img-src http: https: data: blob:"; diff --git a/lerna.json b/lerna.json index 375f4b1259..dda0b8dfc8 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.3.2-alpha.3", + "version": "2.3.17-alpha.4", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index e20798f3ac..ff05f371bc 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "2.3.2-alpha.3", + "version": "2.3.17-alpha.4", "description": "Budibase backend core libraries used in server and worker", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -24,7 +24,7 @@ "dependencies": { "@budibase/nano": "10.1.1", "@budibase/pouchdb-replication-stream": "1.2.10", - "@budibase/types": "2.3.2-alpha.3", + "@budibase/types": "2.3.17-alpha.4", "@shopify/jest-koa-mocks": "5.0.1", "@techpass/passport-openidconnect": "0.3.2", "aws-cloudfront-sign": "2.2.0", diff --git a/packages/backend-core/src/middleware/passport/third-party-common.ts b/packages/backend-core/src/middleware/passport/third-party-common.ts index 451cdf6cc6..9d7b93f370 100644 --- a/packages/backend-core/src/middleware/passport/third-party-common.ts +++ b/packages/backend-core/src/middleware/passport/third-party-common.ts @@ -94,7 +94,7 @@ export async function authenticateThirdParty( try { await saveUserFn(dbUser, { hashPassword: false, requirePassword: false }) } catch (err: any) { - return authError(done, err) + return authError(done, "Error saving user", err) } // now that we're sure user exists, load them from the db diff --git a/packages/bbui/package.json b/packages/bbui/package.json index cc9a101af0..bf2782d843 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "2.3.2-alpha.3", + "version": "2.3.17-alpha.4", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "1.2.1", - "@budibase/string-templates": "2.3.2-alpha.3", + "@budibase/string-templates": "2.3.17-alpha.4", "@spectrum-css/accordion": "3.0.24", "@spectrum-css/actionbutton": "1.0.1", "@spectrum-css/actiongroup": "1.0.1", diff --git a/packages/bbui/src/FancyForm/FancyInput.svelte b/packages/bbui/src/FancyForm/FancyInput.svelte index 8735e2c30c..0c58b9b045 100644 --- a/packages/bbui/src/FancyForm/FancyInput.svelte +++ b/packages/bbui/src/FancyForm/FancyInput.svelte @@ -1,5 +1,5 @@ @@ -39,6 +63,7 @@ on:focus={() => (focused = true)} on:blur={() => (focused = false)} class:placeholder + bind:this={ref} /> {#if suffix && !placeholder}
{suffix}
@@ -74,4 +99,11 @@ line-height: 17px; font-family: var(--font-sans); } + input:-webkit-autofill { + border-radius: 2px; + -webkit-box-shadow: 0 0 0 100px var(--spectrum-global-color-gray-300) inset; + -webkit-text-fill-color: var(--spectrum-global-color-gray-900); + transition: -webkit-box-shadow 130ms 200ms, background-color 0s 86400s; + padding: 3px 8px 4px 8px; + } diff --git a/packages/bbui/src/Form/Core/TextField.svelte b/packages/bbui/src/Form/Core/TextField.svelte index fe05ef2c64..acc2169a06 100644 --- a/packages/bbui/src/Form/Core/TextField.svelte +++ b/packages/bbui/src/Form/Core/TextField.svelte @@ -13,6 +13,7 @@ export let quiet = false export let align export let autofocus = false + export let autocomplete = null const dispatch = createEventDispatcher() @@ -103,6 +104,7 @@ class="spectrum-Textfield-input" style={align ? `text-align: ${align};` : ""} inputmode={type === "number" ? "decimal" : "text"} + {autocomplete} /> diff --git a/packages/bbui/src/Form/Input.svelte b/packages/bbui/src/Form/Input.svelte index f37cf55b63..d3cb13e731 100644 --- a/packages/bbui/src/Form/Input.svelte +++ b/packages/bbui/src/Form/Input.svelte @@ -14,6 +14,7 @@ export let updateOnChange = true export let quiet = false export let autofocus + export let autocomplete const dispatch = createEventDispatcher() const onChange = e => { @@ -33,6 +34,7 @@ {type} {quiet} {autofocus} + {autocomplete} on:change={onChange} on:click on:input diff --git a/packages/builder/package.json b/packages/builder/package.json index 153da728e0..049b8d2a9f 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "2.3.2-alpha.3", + "version": "2.3.17-alpha.4", "license": "GPL-3.0", "private": true, "scripts": { @@ -58,10 +58,10 @@ } }, "dependencies": { - "@budibase/bbui": "2.3.2-alpha.3", - "@budibase/client": "2.3.2-alpha.3", - "@budibase/frontend-core": "2.3.2-alpha.3", - "@budibase/string-templates": "2.3.2-alpha.3", + "@budibase/bbui": "2.3.17-alpha.4", + "@budibase/client": "2.3.17-alpha.4", + "@budibase/frontend-core": "2.3.17-alpha.4", + "@budibase/string-templates": "2.3.17-alpha.4", "@fortawesome/fontawesome-svg-core": "^6.2.1", "@fortawesome/free-brands-svg-icons": "^6.2.1", "@fortawesome/free-solid-svg-icons": "^6.2.1", diff --git a/packages/builder/src/builderStore/store/frontend.js b/packages/builder/src/builderStore/store/frontend.js index 7d19573cce..56b8a599f0 100644 --- a/packages/builder/src/builderStore/store/frontend.js +++ b/packages/builder/src/builderStore/store/frontend.js @@ -312,7 +312,7 @@ export const getFrontendStore = () => { const screensToDelete = Array.isArray(screens) ? screens : [screens] // Build array of promises to speed up bulk deletions - const promises = [] + let promises = [] let deleteUrls = [] screensToDelete.forEach(screen => { // Delete the screen @@ -326,8 +326,8 @@ export const getFrontendStore = () => { deleteUrls.push(screen.routing.route) }) - promises.push(store.actions.links.delete(deleteUrls)) await Promise.all(promises) + await store.actions.links.delete(deleteUrls) const deletedIds = screensToDelete.map(screen => screen._id) const routesResponse = await API.fetchAppRoutes() store.update(state => { diff --git a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte index 3e5549fcf5..d7225a6645 100644 --- a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte @@ -18,7 +18,6 @@ import { TableNames, UNEDITABLE_USER_FIELDS } from "constants" import { FIELDS, - AUTO_COLUMN_SUB_TYPES, RelationshipTypes, ALLOWABLE_STRING_OPTIONS, ALLOWABLE_NUMBER_OPTIONS, @@ -75,16 +74,20 @@ editableColumn.constraints.presence = { allowEmpty: false } } - $: if (field && !savingColumn) { - editableColumn = cloneDeep(field) - originalName = editableColumn.name ? editableColumn.name + "" : null - linkEditDisabled = originalName != null - isCreating = originalName == null - primaryDisplay = - $tables.selected.primaryDisplay == null || - $tables.selected.primaryDisplay === editableColumn.name + const initialiseField = (field, savingColumn) => { + if (field && !savingColumn) { + editableColumn = cloneDeep(field) + originalName = editableColumn.name ? editableColumn.name + "" : null + linkEditDisabled = originalName != null + isCreating = originalName == null + primaryDisplay = + $tables.selected.primaryDisplay == null || + $tables.selected.primaryDisplay === editableColumn.name + } } + $: initialiseField(field, savingColumn) + $: checkConstraints(editableColumn) $: required = !!editableColumn?.constraints?.presence || primaryDisplay $: uneditable = @@ -128,12 +131,6 @@ : availableAutoColumns // used to select what different options can be displayed for column type - $: canBeSearched = - editableColumn?.type !== LINK_TYPE && - editableColumn?.type !== JSON_TYPE && - editableColumn?.subtype !== AUTO_COLUMN_SUB_TYPES.CREATED_BY && - editableColumn?.subtype !== AUTO_COLUMN_SUB_TYPES.UPDATED_BY && - editableColumn?.type !== FORMULA_TYPE $: canBeDisplay = editableColumn?.type !== LINK_TYPE && editableColumn?.type !== AUTO_TYPE && @@ -250,18 +247,6 @@ } } - function onChangePrimaryIndex(e) { - indexes = e.detail ? [editableColumn.name] : [] - } - - function onChangeSecondaryIndex(e) { - if (e.detail) { - indexes[1] = editableColumn.name - } else { - indexes = indexes.slice(0, 1) - } - } - function openJsonSchemaEditor() { jsonSchemaModal.show() } @@ -456,24 +441,6 @@ {/if} - {#if canBeSearched && !external} -
- - - -
- {/if} - {#if editableColumn.type === "string"} (editableColumn.formula = e.detail)} + on:change={e => { + editableColumn = { + ...editableColumn, + formula: e.detail, + } + }} bindings={getBindings({ table })} allowJS /> diff --git a/packages/builder/src/components/backend/Datasources/CreateEditRelationship.svelte b/packages/builder/src/components/backend/Datasources/CreateEditRelationship.svelte index 4a3c4f6c60..1413cd157e 100644 --- a/packages/builder/src/components/backend/Datasources/CreateEditRelationship.svelte +++ b/packages/builder/src/components/backend/Datasources/CreateEditRelationship.svelte @@ -152,7 +152,7 @@ fromTable, throughTable, fromTable.primary[0], - throughFromKey + throughToKey ), throughToKey: errorChecker.manyForeignKeySet(throughToKey) || @@ -160,7 +160,7 @@ toTable, throughTable, toTable.primary[0], - throughToKey + throughFromKey ), fromForeign: errorChecker.foreignKeySet(fromForeign) || @@ -391,24 +391,14 @@ options={Object.keys(getTable(throughId)?.schema)} bind:value={throughToKey} bind:error={errors.throughToKey} - on:change={e => - changed(() => { - if (throughFromKey === e.detail) { - throughFromKey = null - } - })} + on:change={changed} /> + import { Select, Label } from "@budibase/bbui" + import { tables } from "stores/backend" + import DrawerBindableInput from "components/common/bindings/DrawerBindableInput.svelte" + + export let parameters + export let bindings = [] + + $: tableOptions = $tables.list || [] + + +
+ +