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 test (or a github action) to catch static files issues early #1831

Open
bmispelon opened this issue Dec 17, 2024 · 1 comment · May be fixed by #1855 or #1836
Open

Add a test (or a github action) to catch static files issues early #1831

bmispelon opened this issue Dec 17, 2024 · 1 comment · May be fixed by #1855 or #1836
Labels
help-needed Help needed

Comments

@bmispelon
Copy link
Member

I recently had to revert a commit because deploying it on the production server failed when running collectstatic, even though all the tests and github actions passed.

The issue is that the production server uses ManifestStaticFilesStorage for its static files, which adds a post-processing step the the collectstatic command and that step will crash with a ValueError if a missing static file is referenced (in my case, a minified javascript file had a comment referencing a .map file that had been deleted).

This type of issue should be caught early so we can fix it during the PR and avoid a revert.

@ontowhee
Copy link
Contributor

I'm able to reproduce this locally by deleting jquery.min.map from the project and the static root folder, and then running python manage.py collectstatic --settings djangoproject.settings.prod and gives the error described in this issue.

I was trying to reproduce the error in #1837 and was expecting the tests to fail, but it is currently passing. There must be something I'm missing. Is it not picking up the production settings file? Is DEBUG variable true? I'll need to revisit this.

SrisailamKakurala added a commit to SrisailamKakurala/djangoproject.com that referenced this issue Dec 29, 2024
SrisailamKakurala added a commit to SrisailamKakurala/djangoproject.com that referenced this issue Dec 29, 2024
SrisailamKakurala added a commit to SrisailamKakurala/djangoproject.com that referenced this issue Dec 29, 2024
SrisailamKakurala added a commit to SrisailamKakurala/djangoproject.com that referenced this issue Dec 29, 2024
SrisailamKakurala added a commit to SrisailamKakurala/djangoproject.com that referenced this issue Dec 29, 2024
SrisailamKakurala added a commit to SrisailamKakurala/djangoproject.com that referenced this issue Dec 29, 2024
SrisailamKakurala added a commit to SrisailamKakurala/djangoproject.com that referenced this issue Dec 29, 2024
SrisailamKakurala added a commit to SrisailamKakurala/djangoproject.com that referenced this issue Dec 29, 2024
SrisailamKakurala added a commit to SrisailamKakurala/djangoproject.com that referenced this issue Dec 29, 2024
SrisailamKakurala added a commit to SrisailamKakurala/djangoproject.com that referenced this issue Dec 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment