-
Notifications
You must be signed in to change notification settings - Fork 6
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
feat(awards): add file storage for award logos #32
Conversation
- icon_emoji and username fields seem to not actually work for the incoming webhook bot - i imagine we may have a `slack.bot` configuration, so isolating `webhook` to its own object
it gets a bit more confusing with s3 buckets
}); | ||
}); | ||
|
||
router.get('/logos/:key', async (request, response) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so here we are essentially creating an s3 proxy so we can serve images from a private s3 bucket.
my main q is: do we want to just use a public s3 bucket here? only because it’d be nice to post award logos in automated slack messages. we may also be able to use presigned urls for sharing images from a private bucket to slack though not 100% sure
setAwardImage(reader.result?.toString() ?? ''); | ||
}; | ||
|
||
const newImage = `https://picsum.photos/100/50/?original=${random( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i got rid of the auto image generation since it doesn’t work as well with the new model, and i don’t think it’s super important
</Grid> | ||
<Grid item> | ||
<img alt="" src={awardImage} height="50" width="150" /> | ||
<img alt="" src={awardImage} height="200" width="600" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just picking an arbitrary “nice size”.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zhammer maybe we should have a big and a small image? The big one would be displayed on the awards page itself, and the small one as a badge on Slack, Backstage profile, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep i was thinking we could add image resizing, though that may be a good amount of work so was going to leave that for the future. for now showing the same image in both places shouldn't be too much trouble
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be nice to support storage backends other than S3, but given that many cloud providers offer S3-compatible storage I don't think that needs to be a blocker.
I'm fine with merging this as-is though!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm really liking how this is coming together - nicely done! I do have two questions, but nothing that would block this.
```yaml | ||
awards: | ||
storage: | ||
fs: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Optional nit) what do you think about using local
instead of fs
?
@@ -23,6 +23,7 @@ | |||
"postpack": "backstage-cli package postpack" | |||
}, | |||
"dependencies": { | |||
"@aws-sdk/client-s3": "^3.521.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this still needed?
🎉 This PR is included in version 1.0.2 🎉 The release is available on Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 2.0.0 🎉 The release is available on Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 2.0.0 🎉 The release is available on Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 1.0.0 🎉 The release is available on Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 1.0.2 🎉 The release is available on Your semantic-release bot 📦🚀 |
award logos are now stored as images in s3 or the local filesystem rather than data blobs. doesn't require a db or api schema migration. whereas before
img src={}
is the data blob, now it's the url to the uploaded image.uploading a logo works like this:
/awards/new
{ image: <new_image_url> }
, is sent to the backend