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

Refactor: Django admin always enabled #1881

Merged
merged 19 commits into from Feb 23, 2024
Merged

Conversation

angela-tran
Copy link
Member

@angela-tran angela-tran commented Feb 8, 2024

Prerequisite of finishing #1856

@angela-tran angela-tran self-assigned this Feb 8, 2024
Copy link

github-actions bot commented Feb 8, 2024

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  benefits
  settings.py
  urls.py
  benefits/core
  admin.py
Project Total  

This report was generated by python-coverage-comment-action

@github-actions github-actions bot added back-end Django views, sessions, middleware, models, migrations etc. documentation [auto] Improvements or additions to documentation deployment-dev [auto] Changes that will trigger a deploy if merged to dev tests Related to automated testing (unit, UI, integration, etc.) infrastructure Terraform, Azure, etc. and removed deployment-dev [auto] Changes that will trigger a deploy if merged to dev labels Feb 8, 2024
Copy link

github-actions bot commented Feb 8, 2024

1 similar comment
Copy link

github-actions bot commented Feb 8, 2024

Copy link

github-actions bot commented Feb 8, 2024

@thekaveman thekaveman added this to the Admin tool: foundation milestone Feb 12, 2024
@thekaveman thekaveman self-assigned this Feb 12, 2024
@thekaveman thekaveman force-pushed the refactor/always-django-admin branch 2 times, most recently from f20faf3 to 0eebbd3 Compare February 14, 2024 00:20
Copy link

1 similar comment
Copy link

angela-tran and others added 11 commits February 13, 2024 16:21
remove duplicate django.contrib.messages.context_processors.messages
these have to be present in the .env file to reset the DB locally
reset_db.sh reuses the existing init.sh for other initialization
dumped the existing (prior to this deletion) data using Django manage.py,
excluding some model types that are defined and recreated by other migrations:

   python manage.py dumpdata \
    --exclude auth.permission \
    --exclude auth.user \
    --exclude contenttypes.contenttype > fixtures.json

then cleaned up the labels/names of our sample data for consistency

updates db_reset.sh to load these fixtures after migrations are run

updates the Cypress tests to use the new fixture location for sample data
Copy link

these are no longer relevant as we'll use the admin interface directly
to configure
Copy link

@thekaveman thekaveman marked this pull request as ready for review February 15, 2024 22:41
@thekaveman thekaveman requested a review from a team as a code owner February 15, 2024 22:41
@thekaveman
Copy link
Member

@angela-tran @machikoyasuda this is ready for review.

@angela-tran I know you opened the original PR but I'd still like your review since I made a ton of changes.

The full list of post-merge steps (and other things I did) is outlined in #1856

Copy link

* devs may or may not want to reset their local DB
* devs may want to change which DB file is targeted
* devs may want to change which fixture file is loaded

update docs to reflect these changes
Copy link

machikoyasuda
machikoyasuda previously approved these changes Feb 16, 2024
Copy link
Member

@machikoyasuda machikoyasuda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got admin up and running on my machine

Copy link
Member Author

@angela-tran angela-tran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @thekaveman for finishing out this PR. The code changes look good to me.

I noticed some documentation that is out-of-date:
docs/deployment/README.md

no external database...
...loaded via data migrations

and

docs/development/models-migrations.md

note the use of Key Vault for secrets, Django admin for non-secrets
now that we have the Admin interface, we don't want to regrenerate the existing migration
rather, we need to generate new migrations each time to reflect model changes into the DB
Copy link

@thekaveman
Copy link
Member

@angela-tran thanks for those notes. You reminded me that we also need to update the bin/makemigrations.sh helper to account for not having the data migration anymore, and needing to generate new schema migrations each time, rather than updating the existing.

Copy link

Copy link
Member Author

@angela-tran angela-tran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch on the migrations helper script, and thanks for the documentation updates.

I noticed one typo to be fixed, but other than that this PR is approved ✅

docs/development/i18n.md Outdated Show resolved Hide resolved
Co-authored-by: Angela Tran <angela@compiler.la>
Copy link

@thekaveman thekaveman merged commit 6d0a87c into dev Feb 23, 2024
13 checks passed
@thekaveman thekaveman deleted the refactor/always-django-admin branch February 23, 2024 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
back-end Django views, sessions, middleware, models, migrations etc. documentation [auto] Improvements or additions to documentation infrastructure Terraform, Azure, etc. tests Related to automated testing (unit, UI, integration, etc.)
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants