forked from coldfront/coldfront
-
Notifications
You must be signed in to change notification settings - Fork 1
Pr 919 - Bootstrap5 migration #146
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
215
commits into
main
Choose a base branch
from
pr-919
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
Show all changes
215 commits
Select commit
Hold shift + click to select a range
5194a15
Fixed allocation bug in views.py
QuanMPhm 1e59faa
docs: Add note about django ldap auth and certs to config.md
ec98385
Fixes ubccr#647
matthew-kusz 79e9f10
Added a signal for when allocation change requests are created
QuanMPhm ed62660
Merge pull request #651 from ds-04/ldap.py-docs
aebruno 8af400e
OIDC config: set MOKEY_OIDC_PI_GROUP from env var
s-sajid-ali a2d73d3
Merge pull request #645 from NYU-RTS/oidc_pi_fix
aebruno 06fc716
Merge pull request #652 from matthew-kusz/renewal_date_fix
aebruno fefbb7b
Update mkdocs and fix broken links.
aebruno 7aeded9
Merge pull request #658 from ubccr/doc-updates
aebruno 253fa95
Added ProjectCreationForm and changed associated view class.
co505 622dcfc
Adds allocation limits for a resource
matthew-kusz e077daa
Merge pull request #667 from matthew-kusz/allocation_limits
aebruno d9e44d6
Merge pull request #656 from QuanMPhm/add_change_requested_created_si…
aebruno d7a0e12
Merge pull request #596 from QuanMPhm/main
aebruno d25acb8
Merge pull request #665 from co505/project_form
aebruno 59dac17
Use email sender for account upgrade notifications.
aebruno 59a27e6
Merge pull request #678 from ubccr/fix-599-user-upgrade-email
aebruno 0703f0d
Add project signals to core/project views.py , signals.py
3119793
Merge pull request #664 from ds-04/project_signals
aebruno 15ebb47
add api
claire-peters 3beb4a2
Implemented project code feature. Project view, model, utils, admin, …
co505 8e555c1
Merge pull request #646 from co505/project_code
aebruno 527d1cd
Squashed commit of the following:
jrlagrone c51c8c2
Merge pull request #632 from claire-peters/cp_api
aebruno 0a5a917
Reposition project_new signal (to end) in core/views.py
c766ee4
Merge pull request #681 from ds-04/reposition-project_new-signal
aebruno aeaaa8d
Updates to support TLS in ldap_user_search plugin
payerle ccf475f
Merge pull request #683 from payerle/TLS-ldap-fix2
aebruno 1889d70
Migrate to uv
aebruno 50c0ac7
Merge pull request #677 from ubccr/uv-pyproject
aebruno c50f216
Remove setup.py
aebruno da04c23
Merge pull request #671 from SouthernMethodistUniversity/rebased_add_…
aebruno d5a92cf
Fix linting, formatting, reuse compliant.
aebruno bccc653
Merge pull request #689 from ubccr/linting-fixes
aebruno 4a304cd
Add reuse lint to workflow
aebruno 83c7baa
Merge pull request #690 from ubccr/add-reuse-check
aebruno f9273ac
Wrote CONTRIBUTING.md
Eric-Butcher 0523b3d
Changed the version to type: input
Eric-Butcher 99a4441
Fixed phrasing and passive voice
Eric-Butcher c761899
Added SECURITY.md
Eric-Butcher 6435e82
Merge pull request #692 from Eric-Butcher/chore/contributing-md
aebruno 2f05f75
Merge pull request #693 from Eric-Butcher/chore/issue-691-issue-templ…
aebruno dda5c29
Merge pull request #695 from Eric-Butcher/chore/security-md
aebruno 0bedaa0
Adds auto_compute_allocation plugin
30eb7a1
Tests for the Allocation model clean method.
Eric-Butcher e1c274c
Replaced all occurences of logging.WARN with logging.WARNING and log…
Eric-Butcher c5784ca
Update dockerfile to use uv
aebruno e9f2314
Merge pull request #715 from ubccr/dockerfile-update
aebruno a23e951
Merge pull request #698 from ds-04/auto_compute_allocation_iii
aebruno 73e2020
Adds project_openldap plugin
9df349d
Merge pull request #696 from ds-04/project_openldap
aebruno 36a46f7
Implemented institution feature.
co505 783db50
Merge pull request #670 from co505/institutions_refactor
aebruno 96f1c90
Merge pull request #703 from Eric-Butcher/feature/allocation-model-cl…
aebruno 1fe30db
Merge pull request #711 from Eric-Butcher/feature/refactor-logging-warn
aebruno 12f4af7
Update README.md
c504d0f
minor improvements to project_openldap README.md
549ffb1
Refactored django management commands to use self.stdout.write() inst…
Eric-Butcher a5abae7
Tests for the Allocation __str__ method.
Eric-Butcher 26e18a7
Merge pull request #713 from Eric-Butcher/feature/refactor-management…
aebruno 11b6a10
Reorganized the tests into seperate directories for each core app.
Eric-Butcher 5523ef0
Update doc theme and branding
aebruno d2dc2e3
Merge pull request #726 from ubccr/doc-brand-updates
aebruno aa9eedb
Created containers.md docs.
Eric-Butcher 62f0a6c
Merge pull request #725 from Eric-Butcher/chore/container-docs
aebruno 763515b
Patched Dockerfile to work with podman. This was minimally tested.
Eric-Butcher 421871c
Merge pull request #720 from Eric-Butcher/chore/reorganize-test-dirs
aebruno 147c95e
Merge pull request #719 from Eric-Butcher/feature/allocation-model-str
aebruno 41619d5
Tests for the expires_in property of the Allocation model.
Eric-Butcher dbab3ea
Merge pull request #705 from Eric-Butcher/feature/allocation-model-ex…
aebruno f3d7265
Remediated mark_safe calls to prevent XSS attacks.
Eric-Butcher 3f40289
Bump version
aebruno 50c7577
Merge pull request #735 from ubccr/bump-version
aebruno ed76d6a
Add allocation attribute edit page
cecilialau6776 2433844
Removed '| safe' usages in templates.
Eric-Butcher 94a7eae
Update deploy docs to list Redis requirement
cecilialau6776 eec0687
Merge pull request #717 from ds-04/improve_project_openldap_readme
aebruno 0657a07
Merge pull request #716 from ds-04/improve_auto_compute_alloc_readme
aebruno 19ef4e5
add project_openldap to docs
simonLeary42 6c9468b
show how to find project root
simonLeary42 4a1b49c
document project_code max length
simonLeary42 109215f
hide invoice from navbar when not INVOICE_ENABLED
simonLeary42 aa7be52
Merge pull request #734 from Eric-Butcher/feature/allocation-xss-reme…
aebruno 97f085e
Merge pull request #675 from cecilialau6776/edit_alloc_attrs_3.12
aebruno cdac751
Merge pull request #772 from simonLeary42/patch-2
aebruno f72d52e
Merge pull request #766 from cecilialau6776/deploy_docs
aebruno acfb6d2
Merge pull request #779 from simonLeary42/project-root
aebruno 9d1f9eb
Merge pull request #781 from simonLeary42/patch-3
aebruno ec73baf
Merge pull request #789 from simonLeary42/patch-4
aebruno ec56d25
don't display project review link when project review is disabled
simonLeary42 c1bb57d
Adjust add project user to allocation form and create a formset to di…
matthew-kusz c39d8a1
Merge pull request #790 from simonLeary42/patch-5
aebruno 35f2c8a
Merge pull request #751 from Eric-Butcher/bugfix/script-template-safe
aebruno 72dbd32
Merge pull request #733 from Eric-Butcher/bugfix/podman-python-user-b…
aebruno eaab236
add local_urls to match local_settings
simonLeary42 250a1f0
cast "total_amount_awarded" to FloatField before Sum applied
csbarnet 2e76b9e
Fix exception handling in OpenLDAP sync command
simonLeary42 81a61bb
Adds accelerator hours, slurm attrs, slurm account and fairshare nami…
6f09a38
remove "Inactive (Renewed)" status
simonLeary42 627e9ea
Merge pull request #821 from simonLeary42/remove-inactive-renewed-status
aebruno 9f2a9ff
project_openldap: fix log message
simonLeary42 4613f8e
Merge pull request #786 from simonLeary42/local-urls
aebruno 57d0cd5
Merge pull request #794 from Tufts-Technology-Services/bug-fix-grant-…
aebruno cefa1bd
Merge pull request #803 from IUResearchApplications/better-allocation…
aebruno 75d7927
rename functions
simonLeary42 961ac5d
use SETTINGS_EXPORT
simonLeary42 fc4aa72
Merge pull request #806 from simonLeary42/patch-6
aebruno 5d1cf59
Merge pull request #807 from simonLeary42/project-openldap-rename
aebruno 86d6603
Add PI to posixgroup on creation of project
4ce8fb4
resource description in form
simonLeary42 34edfd3
remove unnecessary connection in project_openldap utils.py
f286f3f
Fix project note permission wording
matthew-kusz 345363e
Fix when the allocation activate user signal is sent
matthew-kusz 2b90777
Fix #831
matthew-kusz e03f3f0
Merge pull request #787 from ds-04/auto_compute_allocation_september_…
aebruno 8cac93e
Merge pull request #836 from IUResearchApplications/fix-wording
aebruno 9518c43
Merge pull request #837 from IUResearchApplications/fix-allocation-ac…
aebruno 53a4b3d
Merge pull request #839 from IUResearchApplications/fix-is-unique-error
aebruno e40db00
Merge pull request #826 from ds-04/project_openldap_add_pi_to_new_pro…
aebruno 860fe96
Merge pull request #823 from simonLeary42/patch-10
aebruno 146c9e6
Merge pull request #810 from ds-04/project_openldap_fix_connection_i
aebruno 55364cb
Fix Tests
cecilialau6776 a4b6b4c
Merge pull request #808 from cecilialau6776/test_fixes
aebruno 99fcd60
update new_project_review email
cecilialau6776 9b8f075
allow for allocation/project attributes to be queried
cecilialau6776 83a396f
add tests
cecilialau6776 f9f3163
add more to allocation attribute type admin list display
simonLeary42 4225b62
bugfix: replaces outdated request.is_ajax with header test
csbarnet 9a80fe2
add workflow_dispatch to CI action so that it can be easily run on ot…
csbarnet 4d40b27
Merge pull request #833 from simonLeary42/resource-description-in-form
aebruno 309e582
catch SyntaxError from literal_eval
simonLeary42 6dcb241
Merge pull request #792 from Tufts-Technology-Services/bug-fix-alloca…
aebruno 916346e
Merge pull request #842 from simonLeary42/allocation-type-admin-list-…
aebruno 8a138c3
Merge pull request #822 from cecilialau6776/rest_api_attributes
aebruno 425fc12
Merge pull request #845 from simonLeary42/literal-eval-syntax-error
aebruno 38c1558
Merge pull request #841 from cecilialau6776/project_review_email
aebruno 46d0eba
Merge pull request #828 from simonLeary42/settings-export
aebruno 3136749
bugfix
simonLeary42 5af86e0
Merge pull request #847 from simonLeary42/bugfix-allocation-pk
aebruno 3344d00
run tests on all supported python versions
simonLeary42 692b9d7
Merge pull request #829 from simonLeary42/patch-11
aebruno a5caea6
remove bad django_get_or_create
simonLeary42 9aa84ce
Merge pull request #866 from simonLeary42/fix-flaky-tests
aebruno 156ed7f
history migrations
simonLeary42 ebac7e6
add more properties to the allocation type defaults
simonLeary42 7c9b662
check status.name instead of status_id PK
simonLeary42 90b6c43
add tests, improve tests
simonLeary42 f9552c4
Update github repo url
aebruno 5d866d4
Merge pull request #870 from coldfront/update-docs
aebruno 9b0d542
show allocation in allocation change request
simonLeary42 02c73b7
Reduce database queries on various pages
matthew-kusz 126b81e
fix plural of "match"
simonLeary42 41aa10d
Add additional access checks for existing project tests and fix comments
matthew-kusz 825be7c
add missing allocation statuses
simonLeary42 ce51c2e
Merge pull request #834 from simonLeary42/history-migrations
aebruno c1a2575
Merge pull request #849 from simonLeary42/add-more-properties-allocat…
aebruno 0cc6c8e
Merge pull request #850 from simonLeary42/project-sync-status-prettier
aebruno 6140de2
Merge pull request #875 from IUResearchApplications/db-query-reductions
aebruno 6a9d5a8
Merge pull request #891 from simonLeary42/patch-14
aebruno dfe9267
Merge pull request #881 from simonLeary42/patch-13
aebruno e3dd25c
Merge pull request #873 from simonLeary42/show-alloc-in-alloc-change-…
aebruno 93bc471
Merge pull request #855 from simonLeary42/allocation-tests
aebruno 2836daf
Add add_user(), remove_user(), and get_absolute_url() to models
cecilialau6776 2f179f7
Merge pull request #883 from cecilialau6776/allocation_model_funcs
aebruno 44a8ceb
make use of AttributeValidator class
simonLeary42 0e23f94
Upgrade uv.lock, deps, and pin packages.
aebruno a24f637
Merge pull request #893 from coldfront/uv-upgrade-deps
aebruno 81a1cd3
Add slurm help text on the home page and allocation page
matthew-kusz 5da5387
Use ModelForm for AllocationForm and CreateView for AllocationCreateView
cecilialau6776 d450fa7
Fix incorrect values being saved to edited allocation attributes
matthew-kusz bf7d54e
bump django version
simonLeary42 7e9661b
Merge pull request #896 from IUResearchApplications/fix-allocation-at…
aebruno de92f18
add migration check to CI
simonLeary42 a09a9ed
Merge pull request #894 from simonLeary42/migration-ci
aebruno 4c726db
Merge pull request #897 from simonLeary42/bump-django
aebruno eaf47e6
Fix invalid operand types
cecilialau6776 ee48772
Use django's aggregations
cecilialau6776 d62fa26
Merge pull request #902 from cecilialau6776/center_summary_bugfix
aebruno 3d64020
Fix deprecation warnings for Django5.
aebruno ce006aa
Merge pull request #901 from coldfront/fix-deprecation-warnings
aebruno 136ff86
document undocumented options
simonLeary42 bcf999b
Merge pull request #818 from simonLeary42/config-missing-docs
aebruno 473ca2c
Batch commands when syncing FreeIPA.
aebruno bc47f02
Fix aggregation to be compatible with postgres.
aebruno 4be1cf1
Merge pull request #910 from coldfront/fix-center-summary
aebruno 23c9b16
Upgrade to Django 5.2
aebruno 5d03595
Merge pull request #903 from coldfront/django5-upgrade
aebruno 3ddafc0
Merge pull request #907 from coldfront/freeipa-batch
aebruno 4616b2c
add coldfront core setting for PROJECT_UPDATE_FIELDS
cecilialau6776 d714149
Merge pull request #737 from cecilialau6776/proj_update_fields_setting
aebruno 907885b
UI Fixes
cecilialau6776 13be14a
Add more email notifications and cleanup email code
cecilialau6776 fa201ed
Merge pull request #743 from cecilialau6776/ui_fixes
aebruno f4d09df
Merge pull request #895 from IUResearchApplications/expand-project-ac…
aebruno 3e27ee9
Merge pull request #878 from IUResearchApplications/slurm-help-text
aebruno 2270c0a
fix HTML
simonLeary42 f440bf1
make use of f-strings
simonLeary42 4111c2e
Merge pull request #877 from simonLeary42/template-linter-fixes
aebruno c462bd2
Add new Slurm config options to documentation
matthew-kusz 149c145
Merge pull request #912 from simonLeary42/fstrings
aebruno ba1afff
Merge pull request #914 from IUResearchApplications/update-slurm-doc
aebruno f48278d
Merge pull request #860 from cecilialau6776/new_email_notifications
aebruno 8fda40a
Merge pull request #892 from cecilialau6776/allocationform_modelform
aebruno 4bcfa57
Merge pull request #863 from simonLeary42/attribute-validator-boilerp…
aebruno e799065
Merge pull request #846 from Tufts-Technology-Services/feature-run-ci…
aebruno 1046620
project managers should be able to see allocations &
s-sajid-ali c6f8832
Merge pull request #913 from s-sajid-ali/manager-view-allocs
aebruno 1d8290f
Refactor frontend css/javascript assets.
aebruno 4538fbf
Merge pull request #911 from coldfront/webui-bundle-vite
aebruno 6921edd
Refactor center summary and update charting libs.
aebruno d549814
Merge pull request #916 from coldfront/refactor-charts
aebruno 1e2e92e
Fixes #917.
aebruno e8eeb3d
Merge pull request #918 from coldfront/fix-gauge-chart
aebruno e836190
Upgrade to bootstrap5
aebruno File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
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,31 @@ | ||
| **/.DS_Store | ||
| **/__pycache__ | ||
| **/.venv | ||
| **/.classpath | ||
| **/.dockerignore | ||
| **/.env | ||
| **/.git | ||
| **/.gitignore | ||
| **/.project | ||
| **/.settings | ||
| **/.toolstarget | ||
| **/.vs | ||
| **/.vscode | ||
| **/*.*proj.user | ||
| **/*.dbmdl | ||
| **/*.jfm | ||
| **/bin | ||
| **/charts | ||
| **/docker-compose* | ||
| **/compose.y*ml | ||
| **/Dockerfile* | ||
| **/node_modules | ||
| **/npm-debug.log | ||
| **/obj | ||
| **/secrets.dev.yaml | ||
| **/values.dev.yaml | ||
| */.*_cache | ||
| **/.github | ||
| */docs | ||
| .readthedocs.y*ml | ||
| **/*.db |
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
| 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 3.12 |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,3 +31,7 @@ | |
| - Cecilia Lau | ||
| - Ria Gupta | ||
| - Shreyas Sridhar | ||
| - David Simpson | ||
| - Eric Butcher | ||
| - Matthew Kusz | ||
| - John LaGrone | ||
Large diffs are not rendered by default.
Oops, something went wrong.
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,67 @@ | ||
| # Contributing to ColdFront | ||
|
|
||
| Before we start, thank you for considering contributing to ColdFront! | ||
|
|
||
| Every contribution no matter how small is welcome here! Whether you are adding a whole new feature, improving the aesthetics of the webpage, adding some tests cases, or just fixing a typo your contributions are appreciated. | ||
|
|
||
| In this document you will find a set a guidelines for contributing to the ColdFront project, not hard rules. However, sticking to the advice contained in this document will help you to make better contributions, save time, and increase the chances of your contributions getting accepted. | ||
|
|
||
| This project abides by a [Code of Conduct](CODE_OF_CONDUCT.md) that all contributors are required to uphold. Please read this document before interacting with the project. | ||
|
|
||
| In addition, you must sign off on all commits using `git commit -s`, acknowledging you agree to the Developer Certificate of Origin. | ||
|
|
||
| ## Contributor's Agreement | ||
|
|
||
| You are under no obligation whatsoever to provide any bug fixes, patches, or upgrades to the features, functionality or performance of the source code ("Enhancements") to anyone; however, if you choose to make your Enhancements available either publicly, or directly to the project, without imposing a separate written license agreement for such Enhancements, then you hereby grant the following license: a non-exclusive, royalty-free perpetual license to install, use, modify, prepare derivative works, incorporate into other computer software, distribute, and sublicense such enhancements or derivative works thereof, in binary and source code form. | ||
|
|
||
| ## Contribution Workflow | ||
|
|
||
| For most contributions, you will start by opening up an issue, discussing changes with maintainers and the community, and then opening a pull request. It is perfectly acceptable to provide a pull request without opening an issue first. However, we recommend you open an issue if the changes you suggest are significant to ensure your changes can be successfully merged. | ||
|
|
||
| ### Issues | ||
|
|
||
| We track requested changes using GitHub issues. These include bugs, feature requests, and general concerns. | ||
|
|
||
| Before making an issue, please look at current and previous issues to make sure that your concern has not already been raised by someone else. It is also advised to read through the [current documentation](https://coldfront.readthedocs.io/en/stable/). If an issue with your concern is already opened you are encouraged to comment further on it. The `Search Issues` feature is great to check to see if someone has already raised your issue before. | ||
|
|
||
| If, after searching pre-existing issues, your concern has not been raised (or you are unsure if a previous issue covers your concern) please open a new issue with any labels you believe are relevant. Please include any relevant images, links, and syntax-highlighted text snippets to help maintainers understand your concerns better. It is also helpful to include any debugging steps you have attempted or ideas on how to fix your issue. | ||
|
|
||
| ### Pull Requests | ||
|
|
||
| To create a pull request: | ||
|
|
||
| 1. Fork this repository. | ||
| 2. Create a branch off the `main` branch. | ||
| 3. Make commits to your branch. Make sure your additions include [testing](#testing) for any new functionality. Make sure that you run the full test suite on your PR before submitting. If your changes necessitate removing or changing previous tests, please state this explicitly in your PR. Also ensure that your changes pass the [linter and formatter](#formatting-and-linting). | ||
| 4. Create a pull request back to this main repository. | ||
| 5. Wait for a maintainer to review your code and request any changes. Don't worry if the maintainer asks for changes! This feedback is perfectly normal and ensures a more maintainable project for everyone. | ||
|
|
||
| ## Conventions and Style Guide | ||
|
|
||
| #### Spelling and Naming | ||
|
|
||
| Please use a spell-checker when modifying the codebase to reduce the prevalence of typos. You should avoid writing names in code that use jargon or abbreviations that are not directly relevant to ColdFront or tools used in its development. | ||
|
|
||
| #### Annotations | ||
|
|
||
| You are encouraged to use Python's type annotations to improve code readability and maintainability. Whenever possible, use the most recent annotation syntax available for the minimum version of Python supported by ColdFront. | ||
|
|
||
| > The minimum Python version supported can be found in the `pyproject.toml` file. | ||
|
|
||
| #### Testing | ||
|
|
||
| All new and changed features must include unit tests to verify that they work correctly. Every non-trivial function should have at least as many test cases as its cyclomatic complexity to verify all independent code paths in the function operate correctly. | ||
|
|
||
| When using [uv](https://docs.astral.sh/uv/), the full test suite can be run using the command `uv run coldfront test`. | ||
|
|
||
| #### Formatting and Linting | ||
|
|
||
| This project is formatted and linted using [ruff](https://docs.astral.sh/ruff/). | ||
|
|
||
| You can use Ruff to check for any linting errors in proposed Python code using `uv run ruff check`. Ruff can also fix many linting errors automatically with `uv run ruff check --fix` when using [uv](https://docs.astral.sh/uv/). | ||
|
|
||
| If your code is failing linting checks but you you have a valid reason to leave it unchanged, you can suppress warnings using a `# noqa: <warning-error-code>` comment on the line(s) in question | ||
|
|
||
| You can also use Ruff to check formatting using `uv run ruff format --check` and automatically fix formatting errors with `uv run ruff format`. | ||
|
|
||
| If your code is failing formatting checks but you have a valid reason to leave it unchanged, you can suppress warnings for a specific block of code by enclosing it with the comments `# fmt: off` and `# fmt: on`. These comments work at the statement level so placing them inside of expressions will not have any effect. |
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 |
|---|---|---|
| @@ -1,18 +1,74 @@ | ||
| FROM python:3.8 | ||
| FROM ubuntu:24.04 AS base | ||
|
|
||
| RUN apt-get update \ | ||
| && apt-get install -y --no-install-recommends \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
| FROM base AS cfimage | ||
|
|
||
| WORKDIR /usr/src/app | ||
| COPY requirements.txt ./ | ||
| RUN pip3 install -r requirements.txt | ||
| COPY . . | ||
| RUN apt update && DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends \ | ||
| sqlite3 \ | ||
| freeipa-client \ | ||
| mariadb-client \ | ||
| postgresql-client | ||
|
|
||
| RUN python3 ./manage.py initial_setup | ||
| RUN python3 ./manage.py load_test_data | ||
| FROM cfimage AS builder | ||
|
|
||
| ENV DEBUG=True | ||
| RUN DEBIAN_FRONTEND=noninteractive apt install -y \ | ||
| gcc \ | ||
| cmake \ | ||
| pkg-config \ | ||
| build-essential \ | ||
| libmariadb-dev \ | ||
| libpq-dev \ | ||
| libssl-dev \ | ||
| libdbus-1-dev \ | ||
| libldap2-dev \ | ||
| libkrb5-dev \ | ||
| libglib2.0-dev \ | ||
| libsasl2-dev | ||
|
|
||
| COPY --from=ghcr.io/astral-sh/uv:0.7 /uv /bin/uv | ||
| ENV UV_COMPILE_BYTECODE=1 | ||
| ENV UV_LINK_MODE=copy | ||
| ENV UV_PYTHON_INSTALL_DIR=/python | ||
| ENV UV_PYTHON_PREFERENCE=only-managed | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| # Install Python before the project for caching | ||
| RUN --mount=type=bind,source=.python-version,target=.python-version \ | ||
| uv python install | ||
|
|
||
| RUN --mount=type=cache,target=/root/.cache/uv \ | ||
| --mount=type=bind,source=uv.lock,target=uv.lock \ | ||
| --mount=type=bind,source=.python-version,target=.python-version \ | ||
| --mount=type=bind,source=pyproject.toml,target=pyproject.toml \ | ||
| uv sync \ | ||
| --locked \ | ||
| --no-install-project \ | ||
| --no-dev \ | ||
| --extra ldap \ | ||
| --extra freeipa \ | ||
| --extra iquota \ | ||
| --extra oidc \ | ||
| --extra mysql \ | ||
| --extra pg | ||
| COPY . /app | ||
| RUN --mount=type=cache,target=/root/.cache/uv \ | ||
| uv sync \ | ||
| --locked \ | ||
| --no-dev \ | ||
| --extra ldap \ | ||
| --extra freeipa \ | ||
| --extra iquota \ | ||
| --extra oidc \ | ||
| --extra mysql \ | ||
| --extra pg | ||
|
|
||
|
|
||
| FROM cfimage | ||
|
|
||
| RUN apt-get clean && rm -rf /var/lib/apt/lists/* | ||
| RUN groupadd -r python && useradd -r -g python python | ||
| COPY --from=builder --chown=python:python /python /python | ||
| COPY --from=builder /app /app | ||
| ENV PATH="/app/.venv/bin:$PATH" | ||
| EXPOSE 8000 | ||
| CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"] | ||
| CMD ["gunicorn", "--workers", "3", "--bind", ":8000", "coldfront.config.wsgi"] |
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 28 days ago
In general, you fix this by explicitly defining a
permissionsblock in the workflow (root level, applying to all jobs) or on the specific job, setting it to the least privilege necessary. For a typical CI job that only checks out and reads code,contents: readis sufficient.For this specific workflow in
.github/workflows/ci.yml, the simplest, non‑breaking fix is to add a root‑levelpermissionsblock directly under the workflowname:(beforeon:). This will apply to all jobs (here:build) that do not define their own permissions. Set it to:No other changes are required: all existing steps (checkout, installs, tests, builds,
git status) work with read-onlycontentspermissions because they do not attempt to write to the repository or modify GitHub resources.