Merge branch 'develop' of github.com:Budibase/budibase into feature/sql-relationship-filtering

This commit is contained in:
mike12345567 2022-01-13 15:10:55 +00:00
commit 7e73d4bfd2
29 changed files with 282 additions and 159 deletions

View File

@ -79,6 +79,8 @@ Component libraries are collections of components as well as the definition of t
### Getting Started For Contributors ### Getting Started For Contributors
#### 1. Prerequisites #### 1. Prerequisites
NodeJS Version `14.x.x`
*yarn -* `npm install -g yarn` *yarn -* `npm install -g yarn`
*jest* - `npm install -g jest` *jest* - `npm install -g jest`
@ -177,36 +179,7 @@ To enable this mode, use:
yarn mode:account yarn mode:account
``` ```
### CI ### CI
An overview of the CI pipelines can be found [here](./workflows/README.md)
#### PR Job
After your pr is submitted a github action (can be found at `.github/workflows/budibase_ci.yml`) will run to perform some checks against the changes such as linting, build and test.
The job will run when changes are pushed to or targetted at `master` and `develop`
#### Release Develop
To test changes before a release, a prerelease action (can be found at `.github/workflows/release-develop.yml`) will run to build and release develop versions of npm packages and docker images. On each subsequent commit to develop a new alpha version of npm packages will be created and released.
For example:
- `feature1` -> `develop` = `v0.9.160-alpha.1`
- `feature2` -> `develop` = `v0.9.160-alpha.0`
The job will run when changes are pushed to `develop`
#### Release Job
To release changes a release job (can be found at `.github/workflows/release.yml`) will run to create final versions of npm packages and docker images.
Following the example above:
- `develop` -> `master` = `v0.9.160`
The job will run when changes are pushed to `master`
#### Release Self Host Job
To release the self hosted version of docker images, an additional job (can be found at `.github/workflows/release-selfhost.yml`) must be ran manually. This will releaae docker images to docker hub under the tag `latest` to be picked up by self hosted installations.
### Troubleshooting ### Troubleshooting
Sometimes, things go wrong. This can be due to incompatible updates on the budibase platform. To clear down your development environment and start again follow **Step 6. Cleanup**, then proceed from **Step 3. Install and Build** in the setup guide above. You should have a fresh Budibase installation. Sometimes, things go wrong. This can be due to incompatible updates on the budibase platform. To clear down your development environment and start again follow **Step 6. Cleanup**, then proceed from **Step 3. Install and Build** in the setup guide above. You should have a fresh Budibase installation.

93
.github/workflows/README.md vendored Normal file
View File

@ -0,0 +1,93 @@
# Budibase CI Pipelines
Welcome to the budibase CI pipelines directory. This document details what each of the CI pipelines are for, and come common combinations.
## All CI Pipelines
### Note
- When running workflow dispatch jobs, ensure you always run them off the `master` branch. It defaults to `develop`, so double check before running any jobs.
### Standard CI Build Job (budibase_ci.yml)
Triggers:
- PR or push to develop
- PR or push to master
The standard CI Build job is what runs when you raise a PR to develop or master.
- Installs all dependencies,
- builds the project
- run the unit tests
- Generate test coverage metrics with codecov
- Run the cypress tests
### Release Develop Job (release-develop.yml)
Triggers:
- Push to develop
The job responsible for building, tagging and pushing docker images out to the test and staging environments.
- Installs all dependencies
- builds the project
- run the unit tests
- publish the budibase JS packages under a prerelease tag to NPM
- build, tag and push docker images under the `develop` tag to docker hub
These images will then be pulled by the test and staging environments, updating the latest automatically. Discord notifications are sent to the #infra channel when this occurs.
### Release Job (release.yml)
Triggers:
- Push to master
This job is responsible for building and pushing the latest code to NPM and docker hub, so that it can be deployed.
- Installs all dependencies
- builds the project
- run the unit tests
- publish the budibase JS packages under a release tag to NPM (always incremented by patch versions)
- build, tag and push docker images under the `v.x.x.x` (the tag of the NPM release) tag to docker hub
### Release Selfhost Job (release-selfhost.yml)
Triggers:
- Manual Workflow Dispatch Trigger
This job is responsible for delivering the latest version of budibase to those that are self-hosting.
This job relies on the release job to have run first, so the latest image is pushed to dockerhub. This job then will pull the latest version from `lerna.json` and try to find an image in dockerhub corresponding to that version. For example, if the version in `lerna.json` is `1.0.0`:
- Pull the images for all budibase services tagged `v1.0.0` from dockerhub
- Tag these images as `latest`
- Push them back to dockerhub. This now means anyone who pulls `latest` (self hosters using docker-compose) will get the latest version.
- Build and release the budibase helm chart for kubernetes users
- Perform a github release with the latest version. You can see previous releases here (https://github.com/Budibase/budibase/releases)
### Cloud Deploy (deploy-cloud.yml)
Triggers:
- Manual Workflow Dispatch Trigger
This job is responsible for deploying to our production, cloud kubernetes environment. You must run the release job first, to ensure that the latest images have been built and pushed to docker hub. You can also manually enter a version number for this job, so you can perform rollbacks or upgrade to a specific version. After kicking off this job, the following will occur:
- Checks out the master branch
- Pulls the latest `values.yaml` from budibase infra, a private repo containing budibases infrastructure configuration
- Gets the latest budibase version from `lerna.json`, if it hasn't been specified in the workflow when you kicked it off
- Configures AWS Credentials
- Deploys the helm chart in the budibase repo to our production EKS cluster, injecting the `values.yaml` we pulled from budibase-infra
- Fires off a discord webhook in the #infra channel to show that the deployment completely successfully.
## Common Workflows
### Deploy Changes to Production (Release)
- Merge `develop` into `master`
- Wait for budibase CI job and release job to run
- Run cloud deploy job
- Run release selfhost job
### Deploy Changes to Production (Hotfix)
- Branch off `master`
- Perform your hotfix
- Merge back into `master`
- Wait for budibase CI job and release job to run
- Run cloud deploy job
- Run release selfhost job
### Rollback A Bad Cloud Deployment
- Kick off cloud deploy job
- Ensure you are running off master
- Enter the version number of the last known good version of budibase. For example `1.0.0`

View File

@ -41,4 +41,6 @@ jobs:
files: ./packages/server/coverage/clover.xml files: ./packages/server/coverage/clover.xml
name: codecov-umbrella name: codecov-umbrella
verbose: true verbose: true
# TODO: parallelise this
- run: yarn test:e2e:ci - run: yarn test:e2e:ci

View File

@ -12,6 +12,12 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Fail if branch is not master
if: github.ref != 'refs/heads/master'
run: |
echo "Ref is not master, you must run this job from master."
exit 1
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Pull values.yaml from budibase-infra - name: Pull values.yaml from budibase-infra

View File

@ -23,16 +23,19 @@ jobs:
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-1 aws-region: eu-west-1
- name: 'Get Previous tag' - name: Get the latest budibase release version
id: previoustag id: version
uses: "WyriHaximus/github-action-get-previous-tag@v1" run: |
release_version=$(cat lerna.json | jq -r '.version')
echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV
# - name: Pull values.yaml from budibase-infra - name: Pull values.yaml from budibase-infra
# run: | run: |
# curl -H "Authorization: token ${{ secrets.GH_PERSONAL_TOKEN }}" \ [c3a7a9d12] curl -H "Authorization: token ${{ secrets.GH_PERSONAL_TOKEN }}" \
# -H 'Accept: application/vnd.github.v3.raw' \ -H 'Accept: application/vnd.github.v3.raw' \
# -o values.preprod.yaml \ -o values.preprod.yaml \
# -L https://api.github.com/repos/budibase/budibase-infra/contents/kubernetes/values.preprod.yaml -L https://api.github.com/repos/budibase/budibase-infra/contents/kubernetes/budibase-preprod/values.yaml
wc -l values.preprod.yaml
- name: Deploy to Preprod Environment - name: Deploy to Preprod Environment
uses: deliverybot/helm@v1 uses: deliverybot/helm@v1
@ -41,13 +44,17 @@ jobs:
namespace: budibase namespace: budibase
chart: charts/budibase chart: charts/budibase
token: ${{ github.token }} token: ${{ github.token }}
helm: helm3
values: | values: |
globals: globals:
appVersion: ${{ steps.previoustag.outputs.tag }} appVersion: v${{ env.RELEASE_VERSION }}
# value-files: >- ingress:
# [ enabled: true
# "charts/budibase/values.yaml" nginx: true
# ] value-files: >-
[
"values.preprod.yaml"
]
env: env:
KUBECONFIG_FILE: '${{ secrets.PREPROD_KUBECONFIG }}' KUBECONFIG_FILE: '${{ secrets.PREPROD_KUBECONFIG }}'

View File

@ -4,6 +4,16 @@ on:
push: push:
branches: branches:
- develop - develop
paths:
- '.aws/**'
- '.github/**'
- 'charts/**'
- 'packages/**'
- 'scripts/**'
- 'package.json'
- 'yarn.lock'
- 'package.json'
- 'yarn.lock'
env: env:
POSTHOG_TOKEN: ${{ secrets.POSTHOG_TOKEN }} POSTHOG_TOKEN: ${{ secrets.POSTHOG_TOKEN }}

View File

@ -9,9 +9,9 @@ jobs:
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: actions/setup-node@v1
with: with:
node-version: 14.x node-version: 14.x
fetch_depth: 0
- name: Tag and release Docker images (Self Host) - name: Tag and release Docker images (Self Host)
run: | run: |
@ -38,10 +38,6 @@ jobs:
DOCKER_PASSWORD: ${{ secrets.DOCKER_API_KEY }} DOCKER_PASSWORD: ${{ secrets.DOCKER_API_KEY }}
SELFHOST_TAG: latest SELFHOST_TAG: latest
- name: Setup Helm
uses: azure/setup-helm@v1
id: helm-install
- name: Build CLI executables - name: Build CLI executables
run: | run: |
pushd packages/cli pushd packages/cli
@ -49,25 +45,24 @@ jobs:
yarn build yarn build
popd popd
# - name: Build and release helm chart - name: Setup Helm
# run: | uses: azure/setup-helm@v1
# git config user.name "Budibase Helm Bot" id: helm-install
# git config user.email "<>"
# mv budibase-${{ env.RELEASE_VERSION }}.tgz docs
# helm repo index docs
# git checkout gh-pages
# git add -A
# git commit -m "Helm Release: ${{ env.RELEASE_VERSION }}"
# git push
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - name: Deploy - name: Build and release helm chart
# uses: peaceiris/actions-gh-pages@v3 run: |
# with: git config user.name "Budibase Helm Bot"
# github_token: ${{ secrets.GITHUB_TOKEN }} git config user.email "<>"
# publish_dir: ./public git pull
# full_commit_message: "Helm Release: ${{ env.RELEASE_VERSION }}" helm package charts/budibase
git checkout gh-pages
mv *.tgz docs
helm repo index docs
git add -A
git commit -m "Helm Release: ${{ env.RELEASE_VERSION }}"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Perform Github Release - name: Perform Github Release
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1

View File

@ -3,7 +3,17 @@ name: Budibase Release
on: on:
push: push:
branches: branches:
- test - master
paths:
- '.aws/**'
- '.github/**'
- 'charts/**'
- 'packages/**'
- 'scripts/**'
- 'package.json'
- 'yarn.lock'
- 'package.json'
- 'yarn.lock'
env: env:
POSTHOG_TOKEN: ${{ secrets.POSTHOG_TOKEN }} POSTHOG_TOKEN: ${{ secrets.POSTHOG_TOKEN }}
@ -56,34 +66,3 @@ jobs:
DOCKER_USER: ${{ secrets.DOCKER_USERNAME }} DOCKER_USER: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_API_KEY }} DOCKER_PASSWORD: ${{ secrets.DOCKER_API_KEY }}
BUDIBASE_RELEASE_VERSION: ${{ steps.previoustag.outputs.tag }} BUDIBASE_RELEASE_VERSION: ${{ steps.previoustag.outputs.tag }}
# - name: Pull values.yaml from budibase-infra
# run: |
# curl -H "Authorization: token ${{ secrets.GH_PERSONAL_TOKEN }}" \ [c3a7a9d12]
# -H 'Accept: application/vnd.github.v3.raw' \
# -o values.preprod.yaml \
# -L https://api.github.com/repos/budibase/budibase-infra/contents/kubernetes/values.preprod.yaml
# - name: Deploy to Preprod Environment
# uses: deliverybot/helm@v1
# with:
# release: budibase-preprod
# namespace: budibase
# chart: charts/budibase
# token: ${{ github.token }}
# values: |
# globals:
# appVersion: ${{ steps.previoustag.outputs.tag }}
# # value-files: >-
# # [
# # "charts/budibase/values.yaml"
# # ]
# env:
# KUBECONFIG_FILE: '${{ secrets.PREPROD_KUBECONFIG }}'
# - name: Discord Webhook Action
# uses: tsickert/discord-webhook@v4.0.0
# with:
# webhook-url: ${{ secrets.PROD_DEPLOY_WEBHOOK_URL }}
# content: "Preprod Deployment Complete: ${{ env.RELEASE_VERSION }} deployed to Budibase Pre-prod."
# embed-title: ${{ env.RELEASE_VERSION }}

View File

@ -0,0 +1,9 @@
dependencies:
- name: couchdb
repository: https://apache.github.io/couchdb-helm
version: 3.3.4
- name: ingress-nginx
repository: https://kubernetes.github.io/ingress-nginx
version: 4.0.13
digest: sha256:20892705c2d8e64c98257d181063a514ac55013e2b43399a6e54868a97f97845
generated: "2021-12-30T18:55:30.878411Z"

View File

@ -11,14 +11,14 @@ sources:
- https://github.com/Budibase/budibase - https://github.com/Budibase/budibase
- https://budibase.com - https://budibase.com
type: application type: application
version: 1.0.0 version: 0.2.5
appVersion: 1.0.20 appVersion: 1.0.25
dependencies: dependencies:
- name: couchdb - name: couchdb
version: 3.3.4 version: 3.3.4
repository: https://apache.github.io/couchdb-helm repository: https://apache.github.io/couchdb-helm
condition: services.couchdb.enabled condition: services.couchdb.enabled
- name: ingress-nginx - name: ingress-nginx
version: 3.35.0 version: 4.0.13
repository: https://github.com/kubernetes/ingress-nginx repository: https://kubernetes.github.io/ingress-nginx
condition: ingress.nginx condition: ingress.nginx

Binary file not shown.

View File

@ -9,11 +9,10 @@ metadata:
app.kubernetes.io/name: budibase-proxy app.kubernetes.io/name: budibase-proxy
name: proxy-service name: proxy-service
spec: spec:
type: NodePort
ports: ports:
- port: {{ .Values.services.proxy.port }} - name: {{ .Values.services.proxy.port | quote }}
port: {{ .Values.services.proxy.port }}
targetPort: {{ .Values.services.proxy.port }} targetPort: {{ .Values.services.proxy.port }}
protocol: TCP
selector: selector:
app.kubernetes.io/name: budibase-proxy app.kubernetes.io/name: budibase-proxy
status: status:

View File

@ -40,7 +40,7 @@ service:
port: 10000 port: 10000
ingress: ingress:
enabled: false enabled: true
aws: false aws: false
nginx: true nginx: true
certificateArn: "" certificateArn: ""

View File

@ -1,5 +1,5 @@
{ {
"version": "1.0.27-alpha.13", "version": "1.0.27-alpha.17",
"npmClient": "yarn", "npmClient": "yarn",
"packages": [ "packages": [
"packages/*" "packages/*"

View File

@ -1,6 +1,6 @@
{ {
"name": "@budibase/backend-core", "name": "@budibase/backend-core",
"version": "1.0.27-alpha.13", "version": "1.0.27-alpha.17",
"description": "Budibase backend core libraries used in server and worker", "description": "Budibase backend core libraries used in server and worker",
"main": "src/index.js", "main": "src/index.js",
"author": "Budibase", "author": "Budibase",

View File

@ -1,7 +1,7 @@
{ {
"name": "@budibase/bbui", "name": "@budibase/bbui",
"description": "A UI solution used in the different Budibase projects.", "description": "A UI solution used in the different Budibase projects.",
"version": "1.0.27-alpha.13", "version": "1.0.27-alpha.17",
"license": "MPL-2.0", "license": "MPL-2.0",
"svelte": "src/index.js", "svelte": "src/index.js",
"module": "dist/bbui.es.js", "module": "dist/bbui.es.js",

View File

@ -1,6 +1,6 @@
{ {
"name": "@budibase/builder", "name": "@budibase/builder",
"version": "1.0.27-alpha.13", "version": "1.0.27-alpha.17",
"license": "GPL-3.0", "license": "GPL-3.0",
"private": true, "private": true,
"scripts": { "scripts": {
@ -65,10 +65,10 @@
} }
}, },
"dependencies": { "dependencies": {
"@budibase/bbui": "^1.0.27-alpha.13", "@budibase/bbui": "^1.0.27-alpha.17",
"@budibase/client": "^1.0.27-alpha.13", "@budibase/client": "^1.0.27-alpha.17",
"@budibase/colorpicker": "1.1.2", "@budibase/colorpicker": "1.1.2",
"@budibase/string-templates": "^1.0.27-alpha.13", "@budibase/string-templates": "^1.0.27-alpha.17",
"@sentry/browser": "5.19.1", "@sentry/browser": "5.19.1",
"@spectrum-css/page": "^3.0.1", "@spectrum-css/page": "^3.0.1",
"@spectrum-css/vars": "^3.0.1", "@spectrum-css/vars": "^3.0.1",

View File

@ -1,6 +1,6 @@
{ {
"name": "@budibase/cli", "name": "@budibase/cli",
"version": "1.0.27-alpha.13", "version": "1.0.27-alpha.17",
"description": "Budibase CLI, for developers, self hosting and migrations.", "description": "Budibase CLI, for developers, self hosting and migrations.",
"main": "src/index.js", "main": "src/index.js",
"bin": { "bin": {

View File

@ -1,6 +1,6 @@
{ {
"name": "@budibase/client", "name": "@budibase/client",
"version": "1.0.27-alpha.13", "version": "1.0.27-alpha.17",
"license": "MPL-2.0", "license": "MPL-2.0",
"module": "dist/budibase-client.js", "module": "dist/budibase-client.js",
"main": "dist/budibase-client.js", "main": "dist/budibase-client.js",
@ -19,9 +19,9 @@
"dev:builder": "rollup -cw" "dev:builder": "rollup -cw"
}, },
"dependencies": { "dependencies": {
"@budibase/bbui": "^1.0.27-alpha.13", "@budibase/bbui": "^1.0.27-alpha.17",
"@budibase/standard-components": "^0.9.139", "@budibase/standard-components": "^0.9.139",
"@budibase/string-templates": "^1.0.27-alpha.13", "@budibase/string-templates": "^1.0.27-alpha.17",
"regexparam": "^1.3.0", "regexparam": "^1.3.0",
"shortid": "^2.2.15", "shortid": "^2.2.15",
"svelte-spa-router": "^3.0.5" "svelte-spa-router": "^3.0.5"

View File

@ -1,7 +1,7 @@
{ {
"name": "@budibase/server", "name": "@budibase/server",
"email": "hi@budibase.com", "email": "hi@budibase.com",
"version": "1.0.27-alpha.13", "version": "1.0.27-alpha.17",
"description": "Budibase Web Server", "description": "Budibase Web Server",
"main": "src/index.ts", "main": "src/index.ts",
"repository": { "repository": {
@ -70,9 +70,9 @@
"license": "GPL-3.0", "license": "GPL-3.0",
"dependencies": { "dependencies": {
"@apidevtools/swagger-parser": "^10.0.3", "@apidevtools/swagger-parser": "^10.0.3",
"@budibase/backend-core": "^1.0.27-alpha.13", "@budibase/backend-core": "^1.0.27-alpha.17",
"@budibase/client": "^1.0.27-alpha.13", "@budibase/client": "^1.0.27-alpha.17",
"@budibase/string-templates": "^1.0.27-alpha.13", "@budibase/string-templates": "^1.0.27-alpha.17",
"@bull-board/api": "^3.7.0", "@bull-board/api": "^3.7.0",
"@bull-board/koa": "^3.7.0", "@bull-board/koa": "^3.7.0",
"@elastic/elasticsearch": "7.10.0", "@elastic/elasticsearch": "7.10.0",

View File

@ -65,6 +65,7 @@ module.exports = {
DEPLOYMENT_CREDENTIALS_URL: process.env.DEPLOYMENT_CREDENTIALS_URL, DEPLOYMENT_CREDENTIALS_URL: process.env.DEPLOYMENT_CREDENTIALS_URL,
ALLOW_DEV_AUTOMATIONS: process.env.ALLOW_DEV_AUTOMATIONS, ALLOW_DEV_AUTOMATIONS: process.env.ALLOW_DEV_AUTOMATIONS,
DISABLE_THREADING: process.env.DISABLE_THREADING, DISABLE_THREADING: process.env.DISABLE_THREADING,
QUERY_THREAD_TIMEOUT: process.env.QUERY_THREAD_TIMEOUT,
_set(key, value) { _set(key, value) {
process.env[key] = value process.env[key] = value
module.exports[key] = value module.exports[key] = value

View File

@ -80,6 +80,17 @@ module DynamoModule {
}, },
}, },
}, },
describe: {
type: QueryTypes.FIELDS,
customisable: true,
readable: true,
fields: {
table: {
type: DatasourceFieldTypes.STRING,
required: true,
},
},
},
get: { get: {
type: QueryTypes.FIELDS, type: QueryTypes.FIELDS,
customisable: true, customisable: true,
@ -180,6 +191,13 @@ module DynamoModule {
return response return response
} }
async describe(query: { table: string }) {
const params = {
TableName: query.table,
}
return new AWS.DynamoDB().describeTable(params).promise()
}
async get(query: { table: string; json: object }) { async get(query: { table: string; json: object }) {
const params = { const params = {
TableName: query.table, TableName: query.table,

View File

@ -43,8 +43,8 @@ const coreFields = {
enum: Object.values(BodyTypes), enum: Object.values(BodyTypes),
}, },
pagination: { pagination: {
type: DatasourceFieldTypes.OBJECT type: DatasourceFieldTypes.OBJECT,
} },
} }
module RestModule { module RestModule {
@ -178,12 +178,17 @@ module RestModule {
headers, headers,
}, },
pagination: { pagination: {
cursor: nextCursor cursor: nextCursor,
} },
} }
} }
getUrl(path: string, queryString: string, pagination: PaginationConfig | null, paginationValues: PaginationValues | null): string { getUrl(
path: string,
queryString: string,
pagination: PaginationConfig | null,
paginationValues: PaginationValues | null
): string {
// Add pagination params to query string if required // Add pagination params to query string if required
if (pagination?.location === "query" && paginationValues) { if (pagination?.location === "query" && paginationValues) {
const { pageParam, sizeParam } = pagination const { pageParam, sizeParam } = pagination
@ -217,14 +222,22 @@ module RestModule {
return complete return complete
} }
addBody(bodyType: string, body: string | any, input: any, pagination: PaginationConfig | null, paginationValues: PaginationValues | null) { addBody(
bodyType: string,
body: string | any,
input: any,
pagination: PaginationConfig | null,
paginationValues: PaginationValues | null
) {
if (!input.headers) { if (!input.headers) {
input.headers = {} input.headers = {}
} }
if (bodyType === BodyTypes.NONE) { if (bodyType === BodyTypes.NONE) {
return input return input
} }
let error, object: any = {}, string = "" let error,
object: any = {},
string = ""
try { try {
if (body) { if (body) {
string = typeof body !== "string" ? JSON.stringify(body) : body string = typeof body !== "string" ? JSON.stringify(body) : body
@ -333,7 +346,7 @@ module RestModule {
requestBody, requestBody,
authConfigId, authConfigId,
pagination, pagination,
paginationValues paginationValues,
} = query } = query
const authHeaders = this.getAuthHeaders(authConfigId) const authHeaders = this.getAuthHeaders(authConfigId)
@ -352,7 +365,13 @@ module RestModule {
} }
let input: any = { method, headers: this.headers } let input: any = { method, headers: this.headers }
input = this.addBody(bodyType, requestBody, input, pagination, paginationValues) input = this.addBody(
bodyType,
requestBody,
input,
pagination,
paginationValues
)
this.startTimeMs = performance.now() this.startTimeMs = performance.now()
const url = this.getUrl(path, queryString, pagination, paginationValues) const url = this.getUrl(path, queryString, pagination, paginationValues)

View File

@ -8,6 +8,8 @@ module S3Module {
region: string region: string
accessKeyId: string accessKeyId: string
secretAccessKey: string secretAccessKey: string
s3ForcePathStyle: boolean
endpoint?: string
} }
const SCHEMA: Integration = { const SCHEMA: Integration = {
@ -18,7 +20,7 @@ module S3Module {
datasource: { datasource: {
region: { region: {
type: "string", type: "string",
required: true, required: false,
default: "us-east-1", default: "us-east-1",
}, },
accessKeyId: { accessKeyId: {
@ -29,6 +31,15 @@ module S3Module {
type: "password", type: "password",
required: true, required: true,
}, },
endpoint: {
type: "string",
required: false,
},
signatureVersion: {
type: "string",
required: false,
default: "v4"
},
}, },
query: { query: {
read: { read: {
@ -46,16 +57,16 @@ module S3Module {
class S3Integration implements IntegrationBase { class S3Integration implements IntegrationBase {
private readonly config: S3Config private readonly config: S3Config
private client: any private client: any
private connectionPromise: Promise<any>
constructor(config: S3Config) { constructor(config: S3Config) {
this.config = config this.config = config
this.connectionPromise = this.connect() if (this.config.endpoint) {
this.client = new AWS.S3() this.config.s3ForcePathStyle = true
} } else {
delete this.config.endpoint
}
async connect() { this.client = new AWS.S3(this.config)
AWS.config.update(this.config)
} }
async read(query: { bucket: string }) { async read(query: { bucket: string }) {

View File

@ -1,12 +1,8 @@
import { SourceNames, SqlQuery } from "../definitions/datasource" import { SourceNames, SqlQuery } from "../definitions/datasource"
import { Datasource, Table } from "../definitions/common" import { Datasource, Table } from "../definitions/common"
import { SourceNames } from "../definitions/datasource"
const { DocumentTypes, SEPARATOR } = require("../db/utils") import { DocumentTypes, SEPARATOR } from "../db/utils"
const { import { FieldTypes, BuildSchemaErrors, InvalidColumns } from "../constants"
FieldTypes,
BuildSchemaErrors,
InvalidColumns,
} = require("../constants")
const DOUBLE_SEPARATOR = `${SEPARATOR}${SEPARATOR}` const DOUBLE_SEPARATOR = `${SEPARATOR}${SEPARATOR}`
const ROW_ID_REGEX = /^\[.*]$/g const ROW_ID_REGEX = /^\[.*]$/g
@ -163,7 +159,12 @@ function copyExistingPropsOver(
if (!existingTableSchema.hasOwnProperty(key)) { if (!existingTableSchema.hasOwnProperty(key)) {
continue continue
} }
if (existingTableSchema[key].type === "link") { if (
existingTableSchema[key].type === FieldTypes.LINK ||
existingTableSchema[key].type === FieldTypes.OPTIONS ||
((!table.schema[key] || table.schema[key].type === FieldTypes.NUMBER) &&
existingTableSchema[key].type === FieldTypes.BOOLEAN)
) {
table.schema[key] = existingTableSchema[key] table.schema[key] = existingTableSchema[key]
} }
} }

View File

@ -34,7 +34,7 @@ exports.checkSlashesInUrl = url => {
* @return {string} The base URL of the object store (MinIO or S3). * @return {string} The base URL of the object store (MinIO or S3).
*/ */
exports.objectStoreUrl = () => { exports.objectStoreUrl = () => {
if (env.SELF_HOSTED) { if (env.SELF_HOSTED || env.MINIO_URL) {
// can use a relative url for this as all goes through the proxy (this is hosted in minio) // can use a relative url for this as all goes through the proxy (this is hosted in minio)
return OBJ_STORE_DIRECTORY return OBJ_STORE_DIRECTORY
} else { } else {

View File

@ -1,6 +1,6 @@
{ {
"name": "@budibase/string-templates", "name": "@budibase/string-templates",
"version": "1.0.27-alpha.13", "version": "1.0.27-alpha.17",
"description": "Handlebars wrapper for Budibase templating.", "description": "Handlebars wrapper for Budibase templating.",
"main": "src/index.cjs", "main": "src/index.cjs",
"module": "dist/bundle.mjs", "module": "dist/bundle.mjs",

View File

@ -1,7 +1,7 @@
{ {
"name": "@budibase/worker", "name": "@budibase/worker",
"email": "hi@budibase.com", "email": "hi@budibase.com",
"version": "1.0.27-alpha.13", "version": "1.0.27-alpha.17",
"description": "Budibase background service", "description": "Budibase background service",
"main": "src/index.js", "main": "src/index.js",
"repository": { "repository": {
@ -29,8 +29,8 @@
"author": "Budibase", "author": "Budibase",
"license": "GPL-3.0", "license": "GPL-3.0",
"dependencies": { "dependencies": {
"@budibase/backend-core": "^1.0.27-alpha.13", "@budibase/backend-core": "^1.0.27-alpha.17",
"@budibase/string-templates": "^1.0.27-alpha.13", "@budibase/string-templates": "^1.0.27-alpha.17",
"@koa/router": "^8.0.0", "@koa/router": "^8.0.0",
"@sentry/node": "^6.0.0", "@sentry/node": "^6.0.0",
"@techpass/passport-openidconnect": "^0.3.0", "@techpass/passport-openidconnect": "^0.3.0",