ci: add Makefile target and CI check for collectstatic#65
Merged
dwilding merged 7 commits intocanonical:mainfrom Sep 17, 2025
Merged
ci: add Makefile target and CI check for collectstatic#65dwilding merged 7 commits intocanonical:mainfrom
dwilding merged 7 commits intocanonical:mainfrom
Conversation
This commit introduces a new check in the CI pipeline to ensure that Django's collected static files are always up-to-date and committed to the repository. A new `lint` target has been added to the `dashboard/Makefile`. This target first runs `make collectstatic` and then uses `git diff` to verify that there are no uncommitted changes in the `staticfiles/` directory. If changes are detected, the build will fail. The GitHub Actions workflow has been updated to execute this new `make lint` command, automating the verification process. This prevents developers from forgetting to run `collectstatic` after modifying assets, which could lead to deploying outdated static files.
dwilding
approved these changes
Sep 16, 2025
Collaborator
dwilding
left a comment
There was a problem hiding this comment.
Thank you @Samarthegde, this is a very welcome addition!
I made some small adjustments while reviewing this:
-
Changed
linttocollectstatic-checkbecause I'd prefer to reservelintfor running code style and static analysis checks in the future -
Renamed the "Tests" workflow to "Checks", because this workflow is doing more things now
-
Added a new section in the application README about editing static files, mentioning about running
make collectstatic. (This was also prompted by a question from @AnneCYH a couple of days ago)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit introduces a new check in the CI pipeline to ensure that Django's collected static files are always up-to-date and committed to the repository.
A new
linttarget has been added to thedashboard/Makefile. This target first runsmake collectstaticand then usesgit diffto verify that there are no uncommitted changes in thestaticfiles/directory. If changes are detected, the build will fail.The GitHub Actions workflow has been updated to execute this new
make lintcommand, automating the verification process. This prevents developers from forgetting to runcollectstaticafter modifying assets, which could lead to deploying outdated static files.Manual checks
rockcraft.yaml? Remember to use the same version number inREADME.md.