Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prevent attachment column updates when importing budibase templates #15000

Merged
merged 2 commits into from
Nov 8, 2024

Conversation

andz-bb
Copy link
Contributor

@andz-bb andz-bb commented Nov 8, 2024

Description

We want to be able to import apps from templates while preserving the attachment data from those template dbs. updateAttachmentColumns is great when importing an app with attachments from a file, but wrecks the attachment data in our templates which is always pointing to a public s3 bucket rather than the instance's own object storage

for example, an attachment in my template app db:

"Image":{"size":604516,"name":"amsterdam.jpg","extension":"jpg","key":"amsterdam.jpg","url":"https://prod-budi-templates.s3.eu-west-1.amazonaws.com/attachments/expense-approval/amsterdam.jpg"}

gets completely stripped out by the above function. I've added in a flag to prevent it from running when we're importing from a template rather than a file (i.e. when template.key has a value)

Launchcontrol

fix for attachments in budibase templates

@andz-bb andz-bb requested a review from a team as a code owner November 8, 2024 14:11
Copy link

qa-wolf bot commented Nov 8, 2024

QA Wolf here! As you write new code it's important that your test coverage is keeping up.
Click here to request test coverage for this PR!

@github-actions github-actions bot added the size/s label Nov 8, 2024
Copy link
Collaborator

@mike12345567 mike12345567 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Member

@aptkingston aptkingston left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one sneaky change needed due to how default params work, but otherwise LGTM!

@andz-bb andz-bb merged commit b651b58 into master Nov 8, 2024
13 checks passed
@andz-bb andz-bb deleted the bb-templates-attachments-fix branch November 8, 2024 14:41
@github-actions github-actions bot locked and limited conversation to collaborators Nov 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants