diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8dd1d55f87..aaee3923ef 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,6 +1,6 @@ name: Budibase Release -on: +on: push: branches: - master @@ -9,20 +9,20 @@ env: POSTHOG_TOKEN: ${{ secrets.POSTHOG_TOKEN }} POSTHOG_URL: ${{ secrets.POSTHOG_URL }} SENTRY_DSN: ${{ secrets.SENTRY_DSN }} - + jobs: release: - runs-on: ubuntu-latest + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v1 with: node-version: 12.x - - run: yarn - - run: yarn bootstrap - - run: yarn lint - - run: yarn build + - run: yarn + - run: yarn bootstrap + - run: yarn lint + - run: yarn build - run: yarn test - name: Configure AWS Credentials @@ -35,11 +35,11 @@ jobs: - name: Publish budibase packages to NPM env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - run: | + run: | # setup the username and email. I tend to use 'GitHub Actions Bot' with no email by default git config user.name "Budibase Release Bot" git config user.email "<>" - echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} >> .npmrc + echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} >> .npmrc yarn release - name: 'Get Previous tag' @@ -47,7 +47,7 @@ jobs: uses: "WyriHaximus/github-action-get-previous-tag@v1" - name: Build/release Docker images - run: | + run: | docker login -u $DOCKER_USER -p $DOCKER_PASSWORD yarn build yarn build:docker @@ -68,4 +68,3 @@ jobs: charts_dir: docs env: CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - \ No newline at end of file diff --git a/LICENSE b/LICENSE index e4721dea64..9c0a8c22a0 100644 --- a/LICENSE +++ b/LICENSE @@ -6,6 +6,6 @@ builder: GPLv3 server: GPLv3 client: MPLv2.0 -You can consider Budibase to be GPLv3 licensed. +You can consider Budibase to be GPLv3 licensed. The apps that you build with Budibase do not fall under GPLv3 - hence why our components and client library are licensed differently. diff --git a/hosting/docker-compose.yaml b/hosting/docker-compose.yaml index 229396dacb..18b93fdf61 100644 --- a/hosting/docker-compose.yaml +++ b/hosting/docker-compose.yaml @@ -108,7 +108,7 @@ services: depends_on: - couchdb-service command: ["sh","-c","sleep 10 && $${PUT_CALL}/_users && $${PUT_CALL}/_replicator; fg;"] - + redis-service: restart: always image: redis @@ -117,7 +117,7 @@ services: - "${REDIS_PORT}:6379" volumes: - redis_data:/data - + watchtower-service: image: containrrr/watchtower ports: diff --git a/hosting/kubernetes/budibase/values.yaml b/hosting/kubernetes/budibase/values.yaml index 6a9d84c0b0..1113842c8b 100644 --- a/hosting/kubernetes/budibase/values.yaml +++ b/hosting/kubernetes/budibase/values.yaml @@ -44,7 +44,7 @@ ingress: nginx: true certificateArn: "" className: "" - annotations: + annotations: kubernetes.io/ingress.class: nginx hosts: - host: # change if using custom domain @@ -55,7 +55,7 @@ ingress: service: name: proxy-service port: - number: 10000 + number: 10000 resources: {} # We usually recommend not to specify default resources and to leave this as a conscious @@ -86,7 +86,7 @@ globals: budibaseEnv: PRODUCTION enableAnalytics: false posthogToken: "" - sentryDSN: "" + sentryDSN: "" logLevel: info selfHosted: 1 accountPortalUrL: "" @@ -121,7 +121,7 @@ services: password: "" # only change if pointing to existing couch server port: 5984 storage: 100Mi - + redis: enabled: true # disable if using external redis port: 6379 @@ -129,15 +129,15 @@ services: url: "" # only change if pointing to existing redis cluster and enabled: false password: "budibase" # recommended to override if using built-in redis storage: 100Mi - + objectStore: minio: true browser: true port: 9000 replicaCount: 1 accessKey: "" # AWS_ACCESS_KEY if using S3 or existing minio access key - secretKey: "" # AWS_SECRET_ACCESS_KEY if using S3 or existing minio secret - region: "" # AWS_REGION if using S3 or existing minio secret - url: "" # only change if pointing to existing minio cluster and minio: false + secretKey: "" # AWS_SECRET_ACCESS_KEY if using S3 or existing minio secret + region: "" # AWS_REGION if using S3 or existing minio secret + url: "" # only change if pointing to existing minio cluster and minio: false storage: 100Mi diff --git a/hosting/kubernetes/envoy/envoy.yaml b/hosting/kubernetes/envoy/envoy.yaml index 1041287f5e..c36f04936f 100644 --- a/hosting/kubernetes/envoy/envoy.yaml +++ b/hosting/kubernetes/envoy/envoy.yaml @@ -28,7 +28,7 @@ static_resources: - match: { prefix: "/builder" } route: cluster: app-service - + - match: { prefix: "/app_" } route: cluster: app-service @@ -50,13 +50,13 @@ static_resources: route: cluster: app-service - # special case for when API requests are made, can just forward, not to minio + # special case for when API requests are made, can just forward, not to minio - match: { prefix: "/api/" } route: cluster: app-service - match: { prefix: "/worker/" } - route: + route: cluster: worker-service prefix_rewrite: "/" @@ -85,7 +85,7 @@ static_resources: - lb_endpoints: - endpoint: address: - socket_address: + socket_address: address: app-service.budibase.svc.cluster.local port_value: 4002 @@ -113,7 +113,7 @@ static_resources: - lb_endpoints: - endpoint: address: - socket_address: + socket_address: address: worker-service.budibase.svc.cluster.local port_value: 4001 diff --git a/packages/builder/assets/slack.svg b/packages/builder/assets/slack.svg index adcae7e39d..d0a7c176f9 100644 --- a/packages/builder/assets/slack.svg +++ b/packages/builder/assets/slack.svg @@ -30,4 +30,4 @@ c0,7.1-5.8,12.9-12.9,12.9H82.2z"/> - \ No newline at end of file + diff --git a/packages/builder/src/builderStore/store/automation/index.js b/packages/builder/src/builderStore/store/automation/index.js index db06ce1726..e60553070b 100644 --- a/packages/builder/src/builderStore/store/automation/index.js +++ b/packages/builder/src/builderStore/store/automation/index.js @@ -45,21 +45,24 @@ const automationActions = store => ({ return state }) }, - save: async ({ automation }) => { + save: async automation => { const UPDATE_AUTOMATION_URL = `/api/automations` const response = await api.put(UPDATE_AUTOMATION_URL, automation) const json = await response.json() store.update(state => { + const newAutomation = json.automation const existingIdx = state.automations.findIndex( existing => existing._id === automation._id ) - state.automations.splice(existingIdx, 1, json.automation) - state.automations = state.automations - store.actions.select(json.automation) - return state + if (existingIdx !== -1) { + state.automations.splice(existingIdx, 1, newAutomation) + state.automations = [...state.automations] + store.actions.select(newAutomation) + return state + } }) }, - delete: async ({ automation }) => { + delete: async automation => { const { _id, _rev } = automation const DELETE_AUTOMATION_URL = `/api/automations/${_id}/${_rev}` await api.delete(DELETE_AUTOMATION_URL) @@ -69,17 +72,17 @@ const automationActions = store => ({ existing => existing._id === _id ) state.automations.splice(existingIdx, 1) - state.automations = state.automations + state.automations = [...state.automations] state.selectedAutomation = null state.selectedBlock = null return state }) }, - trigger: async ({ automation }) => { + trigger: async automation => { const { _id } = automation return await api.post(`/api/automations/${_id}/trigger`) }, - test: async ({ automation }, testData) => { + test: async (automation, testData) => { const { _id } = automation const response = await api.post(`/api/automations/${_id}/test`, testData) const json = await response.json() diff --git a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/ActionModal.svelte b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/ActionModal.svelte index 8820259e90..9af78df1b6 100644 --- a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/ActionModal.svelte +++ b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/ActionModal.svelte @@ -38,10 +38,9 @@ actionVal ) automationStore.actions.addBlockToAutomation(newBlock) - await automationStore.actions.save({ - instanceId, - automation: $automationStore.selectedAutomation?.automation, - }) + await automationStore.actions.save( + $automationStore.selectedAutomation?.automation + ) } diff --git a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowChart.svelte b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowChart.svelte index 53a5de3b51..92cc6e7cee 100644 --- a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowChart.svelte +++ b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowChart.svelte @@ -32,16 +32,15 @@ } async function deleteAutomation() { - await automationStore.actions.delete({ - instanceId, - automation: $automationStore.selectedAutomation?.automation, - }) + await automationStore.actions.delete( + $automationStore.selectedAutomation?.automation + ) } async function testAutomation() { - const result = await automationStore.actions.trigger({ - automation: $automationStore.selectedAutomation.automation, - }) + const result = await automationStore.actions.trigger( + $automationStore.selectedAutomation.automation + ) if (result.status === 200) { notifications.success( `Automation ${$automationStore.selectedAutomation.automation.name} triggered successfully.` diff --git a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte index 5898537dae..f077ac35d7 100644 --- a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte +++ b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte @@ -52,10 +52,9 @@ async function deleteStep() { automationStore.actions.deleteAutomationBlock(block) - await automationStore.actions.save({ - instanceId, - automation: $automationStore.selectedAutomation?.automation, - }) + await automationStore.actions.save( + $automationStore.selectedAutomation?.automation + ) } diff --git a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/TestDataModal.svelte b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/TestDataModal.svelte index d05c8fa326..8caba9d351 100644 --- a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/TestDataModal.svelte +++ b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/TestDataModal.svelte @@ -42,7 +42,10 @@ disabled={isError} onConfirm={() => { automationStore.actions.addTestDataToAutomation(testData) - automationStore.actions.test($automationStore.selectedAutomation, testData) + automationStore.actions.test( + $automationStore.selectedAutomation?.automation, + testData + ) }} cancelText="Cancel" > diff --git a/packages/builder/src/components/automation/AutomationPanel/CreateAutomationModal.svelte b/packages/builder/src/components/automation/AutomationPanel/CreateAutomationModal.svelte index e774c366a5..6580cd0b87 100644 --- a/packages/builder/src/components/automation/AutomationPanel/CreateAutomationModal.svelte +++ b/packages/builder/src/components/automation/AutomationPanel/CreateAutomationModal.svelte @@ -29,10 +29,9 @@ webhookModal.show } - await automationStore.actions.save({ - instanceId, - automation: $automationStore.selectedAutomation?.automation, - }) + await automationStore.actions.save( + $automationStore.selectedAutomation?.automation + ) notifications.success(`Automation ${name} created.`) diff --git a/packages/builder/src/components/automation/AutomationPanel/EditAutomationPopover.svelte b/packages/builder/src/components/automation/AutomationPanel/EditAutomationPopover.svelte index a99c11e9e1..fc12b60676 100644 --- a/packages/builder/src/components/automation/AutomationPanel/EditAutomationPopover.svelte +++ b/packages/builder/src/components/automation/AutomationPanel/EditAutomationPopover.svelte @@ -1,20 +1,17 @@ + + + + + + + Learn about automations + + + + + diff --git a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte index 8e6cb42ee2..ea3c60932c 100644 --- a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte +++ b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte @@ -56,10 +56,9 @@ testData[key] = e.detail } else { block.inputs[key] = e.detail - await automationStore.actions.save({ - instanceId, - automation: $automationStore.selectedAutomation?.automation, - }) + await automationStore.actions.save( + $automationStore.selectedAutomation?.automation + ) } }, isTestModal ? 0 : 800 diff --git a/packages/builder/src/components/automation/Shared/CreateWebhookModal.svelte b/packages/builder/src/components/automation/Shared/CreateWebhookModal.svelte index 04656c1e2e..ac63ba6a47 100644 --- a/packages/builder/src/components/automation/Shared/CreateWebhookModal.svelte +++ b/packages/builder/src/components/automation/Shared/CreateWebhookModal.svelte @@ -18,10 +18,7 @@ onMount(async () => { if (!automation?.definition?.trigger?.inputs.schemaUrl) { // save the automation initially - await automationStore.actions.save({ - instanceId, - automation, - }) + await automationStore.actions.save(automation) } interval = setInterval(async () => { await automationStore.actions.fetch() diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/EventPropertyControl.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/EventPropertyControl.svelte index 9e39fd48e9..09a8b491c7 100644 --- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/EventPropertyControl.svelte +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/EventPropertyControl.svelte @@ -46,7 +46,9 @@ } automationStore.actions.addBlockToAutomation(newBlock) - await automationStore.actions.save($automationStore.selectedAutomation) + await automationStore.actions.save( + $automationStore.selectedAutomation?.automation + ) parameters.automationId = $automationStore.selectedAutomation.automation._id delete parameters.newAutomationName } diff --git a/packages/client/manifest.json b/packages/client/manifest.json index 81f1edecd3..7bef9c2e4b 100644 --- a/packages/client/manifest.json +++ b/packages/client/manifest.json @@ -2049,7 +2049,7 @@ "setting": "optionsSource", "value": "provider" } - }, + }, { "type": "options", "key": "customOptions", diff --git a/packages/server/src/api/routes/tests/metadata.spec.js b/packages/server/src/api/routes/tests/metadata.spec.js index 5befd492a2..8ef8e3d45b 100644 --- a/packages/server/src/api/routes/tests/metadata.spec.js +++ b/packages/server/src/api/routes/tests/metadata.spec.js @@ -62,4 +62,4 @@ describe("/metadata", () => { expect(metadata.test).toBeUndefined() }) }) -}) \ No newline at end of file +}) diff --git a/packages/server/src/automations/tests/automation.spec.js b/packages/server/src/automations/tests/automation.spec.js index e1b82e4327..83b7b81a75 100644 --- a/packages/server/src/automations/tests/automation.spec.js +++ b/packages/server/src/automations/tests/automation.spec.js @@ -83,4 +83,4 @@ describe("Run through some parts of the automations system", () => { expect(output.d).toBe(1) expect(output.e).toBe("help") }) -}) \ No newline at end of file +}) diff --git a/packages/server/src/automations/tests/delay.spec.js b/packages/server/src/automations/tests/delay.spec.js index d06bd6cf00..6120cf1af8 100644 --- a/packages/server/src/automations/tests/delay.spec.js +++ b/packages/server/src/automations/tests/delay.spec.js @@ -9,4 +9,4 @@ describe("test the delay logic", () => { // divide by two just so that test will always pass as long as there was some sort of delay expect(now - before).toBeGreaterThanOrEqual(time / 2) }) -}) \ No newline at end of file +}) diff --git a/packages/server/src/automations/tests/filter.spec.js b/packages/server/src/automations/tests/filter.spec.js index 7895433fe9..f11841f7c9 100644 --- a/packages/server/src/automations/tests/filter.spec.js +++ b/packages/server/src/automations/tests/filter.spec.js @@ -45,4 +45,4 @@ describe("test the filter logic", () => { it("check objects always false", async () => { await checkFilter({}, FilterConditions.EQUAL, {}, false) }) -}) \ No newline at end of file +}) diff --git a/packages/server/src/automations/tests/queryRows.spec.js b/packages/server/src/automations/tests/queryRows.spec.js index fca03f4e3b..ec966302a8 100644 --- a/packages/server/src/automations/tests/queryRows.spec.js +++ b/packages/server/src/automations/tests/queryRows.spec.js @@ -48,4 +48,4 @@ describe("Test a query step automation", () => { expect(res.rows.length).toBe(2) expect(res.rows[0].name).toBe(NAME) }) -}) \ No newline at end of file +}) diff --git a/packages/string-templates/manifest.json b/packages/string-templates/manifest.json index 629bb2ebe3..09ebeff301 100644 --- a/packages/string-templates/manifest.json +++ b/packages/string-templates/manifest.json @@ -1219,4 +1219,4 @@ "description": "

Produce a humanized duration left/until given an amount of time and the type of time measurement.

\n" } } -} \ No newline at end of file +}