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

Draft: Generate s3 file listing after each upload #1980

Open
wants to merge 8 commits into
base: 4.x
Choose a base branch
from

Conversation

nknapp
Copy link
Collaborator

@nknapp nknapp commented Aug 4, 2023

This PR is not ready yet. I am currently playing with the S3 api.

In order to fix the builds page we should statically generate a file-index on each upload, so that we do not have to rely on the s3-api being available from the browser.

Since we are also relying on an old version of the aws-sdk, this will probably also include an update to the newest version.

@nknapp
Copy link
Collaborator Author

nknapp commented Aug 5, 2023

@jaylinski if you like, you can have a look at this already. If have extracted the s3-logic to grunt-independent functions and added an s3-listing function. With this, we should be able to generate some kind of listing-file, be it json, or, using Handlebars, directly a static html.

@nknapp
Copy link
Collaborator Author

nknapp commented Aug 5, 2023

@jaylinski I have manually generated and deployed a static file-list to the s3-bucket using the code from this PR. This means we have a file-list now, but it will be outdated on the next build.

I have also fixed the link from the docs to the file-list.

The HTML file-list is generated via Handlebars, but the template and the JavaScript inside (fileList.hbs) is rather hacky. (i.e. no tests or so).

The tests for the generation and upload-code must be run manually. I think this is better than before (where there were no tests at all), but maybe we should use "mocha" or so. I don't think we should run these tests on every build.

With the deployed "index.json" file, we can integrate the file-list directly into the docs.

Please have a look and let me know what you think.

Copy link
Member

@jaylinski jaylinski left a comment

Choose a reason for hiding this comment

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

LGTM!

@@ -0,0 +1,127 @@
<!doctype html>
Copy link
Member

Choose a reason for hiding this comment

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

Maybe activate prettier formatting for this file?

Copy link
Member

Choose a reason for hiding this comment

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

Did you update all deps? Seems to have lots of changes...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants