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

Redesign codebase prep #13546

Draft
wants to merge 40 commits into
base: main
Choose a base branch
from
Draft

Conversation

robdivincenzo
Copy link
Collaborator

@robdivincenzo robdivincenzo commented Feb 27, 2025

Description

This PR re-organizes the codebase to prep for redesign. The goal is to organize the "upstream" main branch without interruption of the site. At a high level, it does the following:

  1. Turns network-api into a useful Django project directory named foundation_cms
    1. This is now the home base for the cms apps, settings, config code, etc. and is renamed as such.
  2. Turns networkapi into a simple "namespace" directory named legacy_apps to house the legacy apps
    1. With the instance-level and settings code moved out into foundation_cms, this is simply a home for the legacy apps' code.
  3. Flattens the project a layer.
    1. Moves manage.py to the root directory
      1. Simplifies all manage.py commands by no longer requiring cd into network-api to run (or appending network-api to the python command like in Heroku Scheduler (i.e. python network-api/manage.py sync_locale_trees)
    2. Surfaces the apps layer up one level
      1. Instead of having the apps in root/network-api/networkapi/app1, it will be root/foundation_cms/app1
    3. Resembles something more conventional to wagtail
  4. Moves settings.py into a settings app.
    1. On the surface it does nothing yet, but we have the ability to have different settings for dev, staging, and live. Currently though, all settings.py was moved to a base.py to serve as the base settings. In the longrun, this could help us to better simplify and distribute settings for various environments, instead of having everything in one file with several conditional if statements.
    2. Also, a closer wagtail convention
  5. Move front end /source/ and frontend/ (compiled files) into relevant Django project folders (foundation_cms/static/ for new files) and (foundation_cms/legacy_apps/static/ for the legacy files). This should streamline development because the static assets are closer to where developers are modifying templates, whereas there was a large separation previously. Organizing the frontend assets into a static/ directory is also a Django convention and should make more sense in general.
    1. /foundation_cms/legacy_apps/static/ is the new directory for legacy source files (formerly /source/).
    2. /foundation_cms/legacy_apps/static/compiled is the new directory for those compiled source files (formerly network-api/networkapi/frontend).
    3. The same convention will follow for redesign in /foundation_cms/static/
  6. /media/ and /staticfiles/ are collected in the project root folder now, alongside manage.py.
  7. Beginnings of breaking down package.json scripts into separate commands for legacy and main.
  8. A lot of find and replace

Link to sample test page: https://foundation-s-tp1-1991-r-v2rggk.mofostaging.net/en/
Related PRs/issues: #

Launch Notes

  1. Will need to update Heroku Scheduler path since network-api is no longer needed to run manage.py commands.
  2. Will need to work with the localization string repo (https://github.com/mozilla-l10n/fomo-l10n) to re-align on directories.

Checklist

Tests

  • Is the code I'm adding covered by tests?

Changes in Models:

  • Did I update or add new fake data?
  • Did I squash my migration?
  • Are my changes backward-compatible. If not, did I schedule a deploy with the rest of the team?

Documentation:

  • Is my code documented?
  • Did I update the READMEs or wagtail documentation?

Merge Method
💡❗Remember to use squash merge when merging non-feature branches into main

┆Issue is synchronized with this Jira Story

@robdivincenzo robdivincenzo force-pushed the TP1-1991-redesign-codebase-prep branch from ed0f4e9 to 3ed8f7e Compare March 4, 2025 14:25
@robdivincenzo robdivincenzo temporarily deployed to foundation-s-tp1-1991-r-wnyyn2 March 5, 2025 18:49 Inactive
@mofodevops mofodevops temporarily deployed to foundation-s-tp1-1991-r-v2rggk March 5, 2025 19:06 Inactive
@robdivincenzo robdivincenzo temporarily deployed to foundation-s-tp1-1991-r-v2rggk March 5, 2025 19:53 Inactive
@robdivincenzo robdivincenzo temporarily deployed to foundation-s-tp1-1991-r-v2rggk March 5, 2025 20:39 Inactive
@robdivincenzo robdivincenzo temporarily deployed to foundation-s-tp1-1991-r-v2rggk March 6, 2025 14:19 Inactive
@mergify mergify bot mentioned this pull request Mar 6, 2025
@robdivincenzo robdivincenzo temporarily deployed to foundation-s-tp1-1991-r-v2rggk March 6, 2025 18:10 Inactive
@robdivincenzo robdivincenzo had a problem deploying to foundation-s-tp1-1991-r-v2rggk March 7, 2025 16:01 Failure
@robdivincenzo robdivincenzo had a problem deploying to foundation-s-tp1-1991-r-v2rggk March 7, 2025 19:21 Failure
@robdivincenzo robdivincenzo had a problem deploying to foundation-s-tp1-1991-r-v2rggk March 7, 2025 19:56 Failure
@robdivincenzo robdivincenzo had a problem deploying to foundation-s-tp1-1991-r-v2rggk March 7, 2025 20:20 Failure
@robdivincenzo robdivincenzo had a problem deploying to foundation-s-tp1-1991-r-v2rggk March 7, 2025 20:35 Failure
@robdivincenzo robdivincenzo temporarily deployed to foundation-s-tp1-1991-r-v2rggk March 7, 2025 20:41 Inactive
@robdivincenzo robdivincenzo temporarily deployed to foundation-s-tp1-1991-r-v2rggk March 7, 2025 20:42 Inactive
@robdivincenzo robdivincenzo temporarily deployed to foundation-s-tp1-1991-r-v2rggk March 7, 2025 20:51 Inactive
@robdivincenzo robdivincenzo force-pushed the TP1-1991-redesign-codebase-prep branch from 4ba864a to 848df91 Compare March 7, 2025 21:00
@robdivincenzo robdivincenzo temporarily deployed to foundation-s-tp1-1991-r-v2rggk March 7, 2025 21:00 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants