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

Add a step in our CI to check the list of pre-cached files for the PWA-ServiceWorker #772

Closed
mossroy opened this issue Oct 30, 2021 · 3 comments · Fixed by #774
Closed
Labels
build Code relating to building, publishing, or maintaining the app tests
Milestone

Comments

@mossroy
Copy link
Contributor

mossroy commented Oct 30, 2021

It should be possible to compare the list of files that exist in www directory, and the list of pre-cached files in service-worker.js file.

If one file is missing, it should break the CI

@Jaifroid
Copy link
Member

I'm wondering how this would work. Wouldn't we need to provide a list of files needed by the app for the testing engine. In which case, how is that different from providing the list of files in service-worker.js? We would then have to maintain two lists of files instead of one?

I did think maybe we could use Node APIs to read the contents of the www directory, because we probably (though not necessarily) need all the files that are in that directory and subdirectories. However, we also need some files that are not in that directory, but not all of the files. The needed files are listed in our dockerfile, but I'm not sure how easily it translates into a format Node APIs can use.

@mossroy
Copy link
Contributor Author

mossroy commented Nov 21, 2021

My idea was to read the list of files in the www directory, apply some additions/exclusions if necessary, then compare this list with the hard-coded list of cached files.
In the CI, we are free to use the technology we want to do that (not necessarily javascript). It might be a bash script for example

@Jaifroid
Copy link
Member

Jaifroid commented Dec 3, 2021

#774 is implemented and working. However, it can't be reviewed or merged until #771 is merged (and then it may need to be rebased on master).

@Jaifroid Jaifroid added tests build Code relating to building, publishing, or maintaining the app labels Dec 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Code relating to building, publishing, or maintaining the app tests
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants