Skip to content

Commit

Permalink
Removed changelogs
Browse files Browse the repository at this point in the history
These predate the auto-generated TODO comments and are no longer necessary.
  • Loading branch information
orangejenny committed Sep 18, 2024
1 parent 027be8e commit 3b93a01
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 47 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import time
from pathlib import Path

from django.conf import settings
from django.core.management import BaseCommand

from corehq.apps.hqwebapp.utils.bootstrap import BOOTSTRAP_3, BOOTSTRAP_5
Expand Down Expand Up @@ -88,14 +86,6 @@ def add_arguments(self, parser):
)

def handle(self, app_name, **options):
if not settings.BOOTSTRAP_MIGRATION_LOGS_DIR:
self.stderr.write("\nPlease make sure BOOTSTRAP_MIGRATION_LOGS_DIR is "
"set in your localsettings.py before continuing...\n\n")
self.stdout.write(self.style.MIGRATE_LABEL(
"TIP: path should be outside of this repository\n\n"
))
return

selected_filename = options.get('filename')

is_app_migration_complete = is_app_completed(app_name)
Expand Down Expand Up @@ -329,7 +319,6 @@ def migrate_single_file(self, app_name, file_path, spec, is_template, review_cha
self.stdout.write(self.style.WARNING(
self.format_header(f"Finalizing changes for {short_path}...")
))
self.record_file_changes(file_path, app_name, file_changelog, is_template)
if self.no_split:
self.migrate_file_in_place(app_name, file_path, new_lines, is_template)
if is_template:
Expand Down Expand Up @@ -404,31 +393,6 @@ def display_rename_summary(self, changelog):
self.stdout.write("\n\n\nAnswering 'y' below will automatically make this change "
"in the Bootstrap 5 version of this file.\n\n")

def record_file_changes(self, template_path, app_name, changelog, is_template):
if is_split_path(template_path):
parent_dir = template_path.parent.parent
else:
parent_dir = template_path.parent
short_path = get_short_path(app_name, parent_dir, is_template)
readme_directory = Path(settings.BOOTSTRAP_MIGRATION_LOGS_DIR) / short_path
readme_directory.mkdir(parents=True, exist_ok=True)
extension = '.html' if is_template else '.js'
readme_filename = template_path.name.replace(extension, '.md')
readme_path = readme_directory / readme_filename
with open(readme_path, 'w') as readme_file:
readme_file.writelines(changelog)
self.show_information_about_readme(readme_path)

def show_information_about_readme(self, readme_path):
if self.no_split:
self.stdout.write("\nThe changelog summarizing the "
"migration changes can be found here:\n")
else:
self.stdout.write("\nThe changelog for all changes to the Bootstrap 5 "
"version of this file can be found here:\n")
self.stdout.write(f"\n{readme_path}\n\n")
self.stdout.write("** Please make a note of this for reviewing later.\n\n\n")

def migrate_file_in_place(self, app_name, file_path, bootstrap5_lines, is_template):
short_path = get_short_path(app_name, file_path, is_template)
confirm = get_confirmation(f"Apply changes to '{short_path}'?", default='y')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ <h2 id="overview">
To support this approach, we have tooling that facilitates "splitting" and "unsplitting" files:
copying files, moving them, and updating references to them. This tooling also performs the simpler migration
updates, such as renaming CSS classes. For updates that it cannot handle automatically, it adds a TODO comment
to the relevant code and writes out a changelog.
to the relevant code.
</p>
<p>
Once the entire platform is fully migrated to Bootstrap 5, any remaining Bootstrap 3 code can be removed:
Expand All @@ -121,10 +121,6 @@ <h2 id="prepare-local-environment" class="pt-4">
<code>scss</code> files. The recommended method is with homebrew <code>brew install sass/sass/sass</code>,
as described in <code>DEV_SETUP.md</code>.
</p>
<p>
Next, you will need to specify <code>BOOTSTRAP_MIGRATION_LOGS_DIR</code> in <code>localsettings.py</code>. This
will be where the migration management command will leave longer notes for each migrated file.
</p>

<h2 id="announce-migration" class="pt-3">
Step 1: Announce Migration
Expand Down Expand Up @@ -282,10 +278,6 @@ <h3 id="large-apps" class="pt-3">
<a href="https://github.com/dimagi/commcare-hq/tree/master/corehq/apps/hqwebapp/utils/bootstrap/changes_guide"
target="_blank">changes_guide</a> directory.
</p>
<p>
In addition, a changelog for each file will be saved to a markdown file in
<code>BOOTSTRAP_MIGRATION_LOGS_DIR</code> (ouside of repository).
</p>
<div class="alert alert-primary">
<p>
If templates or javascript files have several nested dependencies, you may need to run this split files step
Expand Down
2 changes: 0 additions & 2 deletions settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -933,8 +933,6 @@ def _pkce_required(client_id):
'mixins': '../../../hqwebapp/less/_hq/includes/mixins',
}

BOOTSTRAP_MIGRATION_LOGS_DIR = None

USER_AGENTS_CACHE = 'default'

# Invoicing
Expand Down

0 comments on commit 3b93a01

Please sign in to comment.