Release 0.181.0#2942
Conversation
…ty] (#2752) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* feat: added django-removals and check for deprecation warnings and failure update: upgraded Django version to 5.2 feat: added django-removals in installed apps list chore: removed deprecated logout url chore: updated storage handling chore: addressed feedback from copilot chore: fixed logout issue chore: fixed logout button style and redirect issue chore: fixed logout button style and redirect issue chore: addressed feedback from copilot Upgrade to Django 5.2.12 (#2931) * Upgrade to Django 5.2.12 * Update settings test * Update Header to match Django 5 CSRF requirement * Always include CSRF cookie chore: removed redundant change chore: updated uv lock file chore: removed duplicate changeset * Revert: removed css for logout button
* chore(deps): lock file maintenance * chore: fixed type check --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Umar Hassan <umar.hassan8@gmail.com>
* Verify Google Drive are credentials are present and fix errors in management command * Improve error message by flatenning ID lists
…nt (#2940) * Add documentation on cloning data from production for local development * Fix typo and clarify running in Django shell * Incorporate suggestion to compress database before copying * Add clarifying comment about switching to production context
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request prepares for the release of version 0.181.0, bringing a suite of updates focused on enhancing developer experience, improving system stability through dependency upgrades, and introducing tools for better code quality. It includes critical documentation for local development setup and ensures the project remains current with its underlying technologies. Highlights
Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request updates the OCW Studio to release version 0.181.0, which includes documentation for cloning production data for local development, verification of Google Drive credentials, and various dependency updates. The review focuses on identifying potential issues and improvement opportunities, particularly in the areas of code correctness and maintainability, with some comments enhanced to reference established repository rules for modern testing practices.
I am having trouble creating individual review comments. Click here to see my feedback.
content_sync/serializers_test.py (112)
The settings fixture is being replaced with tmp_path. It's better to explicitly pass the fixtures that a test needs as arguments, rather than relying on implicit access via settings. This makes the test more readable and maintainable.
def test_hugo_file_serialize(tmp_path, markdown, exp_sections):
References
- When adding new tests to a file containing a mix of
unittest.TestCaseand pytest styles, prefer the modern pytest-style (fixtures, standalone functions) as it is more consistent with the rest of the codebase. Explicitly passing fixtures aligns with modern pytest-style.
content_sync/serializers_test.py (114)
The mock_aws decorator is being removed and settings.OCW_STUDIO_USE_S3 = True is being replaced with override_settings(MEDIA_ROOT=str(tmp_path)). It's better to use override_settings to mock settings within a specific context, as it ensures that the setting is properly reset after the test, preventing unintended side effects on other tests.
with override_settings(MEDIA_ROOT=str(tmp_path)):
References
- When adding new tests to a file containing a mix of
unittest.TestCaseand pytest styles, prefer the modern pytest-style (fixtures, standalone functions) as it is more consistent with the rest of the codebase. Usingoverride_settingsfor context-specific mocking aligns with robust, modern testing practices.
gdrive_sync/management/commands/create_missing_gdrive_folders.py (46-52)
The conditional check if settings.DRIVE_SHARED_ID and settings.DRIVE_SERVICE_ACCOUNT_CREDS: is being changed to if not settings.DRIVE_SHARED_ID or not settings.DRIVE_SERVICE_ACCOUNT_CREDS:. It's better to check for the inverse condition to raise the CommandError early, making the code more readable and easier to follow.
if not settings.DRIVE_SHARED_ID or not settings.DRIVE_SERVICE_ACCOUNT_CREDS:
msg = "DRIVE_SHARED_ID and DRIVE_SERVICE_ACCOUNT_CREDS must both be set"
raise CommandError(msg)
gdrive_sync/management/commands/create_missing_gdrive_folders.py (78-80)
The conditional check if set(result) != {True}: is being changed to if error_lists:. It's better to check for the existence of errors directly, rather than comparing the set of results to {True}. This makes the code more readable and easier to understand.
error_lists = [r for r in result if r is not True]
if error_lists:
failed_ids = list(chain.from_iterable(error_lists))
msg = f"Some errors occurred for sites: {failed_ids}"
raise CommandError(msg)
static/js/lib/ckeditor/turndown.ts (79)
The type of node is being cast to HTMLElement. It's better to use a more specific type if possible, to avoid potential runtime errors. In this case, it is known that the node should be an HTMLElement.
return rule.replacement?.(content, node as HTMLElement, options)
pt2302
renovate[bot]
Umar Hassan