forked from coldfront/coldfront
-
Notifications
You must be signed in to change notification settings - Fork 1
refactor frontend - pr911 #155
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
Open
dahyehayley
wants to merge
3
commits into
main
Choose a base branch
from
frontend_refactor
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| pull_request: | ||
| branches: | ||
| - main | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| python-version: ["3.10", "3.11", "3.12", "3.13"] | ||
| node-version: ["24.x"] | ||
| env: | ||
| PLUGIN_API: true | ||
| DJANGO_VITE_DEV_MODE: true | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Install uv and set the python version | ||
| uses: astral-sh/setup-uv@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
|
|
||
| - name: Install Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ matrix.node-version }} | ||
|
|
||
| - name: Install the project | ||
| run: uv sync --locked --dev | ||
|
|
||
| - name: Install frontend packages | ||
| run: npm --prefix coldfront/static install | ||
|
|
||
| - name: Check for lint violations | ||
| run: uv run ruff check | ||
|
|
||
| - name: Check formatting | ||
| run: uv run ruff format --check | ||
|
|
||
| - name: Check frontend with eslint and prettier | ||
| run: npm --prefix coldfront/static run check | ||
|
|
||
| - name: Compile and bundle frontend static assets | ||
| run: npm --prefix coldfront/static run build | ||
|
|
||
| - name: Check bundled frontend static assets have been commited | ||
| run: | | ||
| if [[ `git status --porcelain` ]]; then | ||
| echo "Error: pre-compiled bundled frontend static assets have not been committed" | ||
| git status | ||
| exit 1 | ||
| else | ||
| echo "Bundled frontend static assets check passed." | ||
| fi | ||
|
|
||
| - name: Check licence with reuse | ||
| run: uv run reuse lint | ||
|
|
||
| - name: Run tests | ||
| run: uv run coldfront test | ||
|
|
||
| - name: Check for migrations | ||
| run: uv run coldfront makemigrations --check | ||
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Copilot Autofix
AI 5 days ago
To fix the problem, explicitly declare minimal
permissionsfor this workflow so that the automatically providedGITHUB_TOKENcannot perform unnecessary write operations. For a CI workflow that only checks out code and runs build/test/lint commands,contents: read(and optionallypackages: readif private packages are ever used) is typically sufficient.The best fix without changing existing functionality is to add a workflow-level
permissionsblock near the top of.github/workflows/ci.yml. This will apply to all jobs (there is onlybuildright now) that don’t override permissions. No steps in the shown job require write access to the repository or other resources, so we can safely setcontents: read. If you know this workflow needs to read GitHub Packages, you could also includepackages: read, but based solely on the snippet we will only addcontents: read.Concretely: in
.github/workflows/ci.yml, after thename: CIline and before theon:block, insert:No imports or additional methods are required because this is purely a configuration change in the GitHub Actions workflow file.