Skip to content

Release: 7.2.5 and code cleanup - #949

Merged
chrismaddalena merged 19 commits into
masterfrom
hotfix/code-cleanup
Jul 27, 2026
Merged

Release: 7.2.5 and code cleanup#949
chrismaddalena merged 19 commits into
masterfrom
hotfix/code-cleanup

Conversation

@chrismaddalena

Copy link
Copy Markdown
Collaborator

Summary

This is strictly code clean up based on GitHub's Code Quality monitor. Addressing some technical debt to resolve the open issues.

CHANGELOG

[Unreleased]

Fixed

  • Corrected the AJAX URL for deleting report observations
  • Fixed activity-log sanitization confirmation and scoped its CSRF header to its own request
  • Fixed expired API and service token feedback so the appropriate token row and empty state are updated

Changed

  • Improved logging for skipped signal imports and background task failures

Copilot AI review requested due to automatic review settings July 27, 2026 19:21
@augmentcode

augmentcode Bot commented Jul 27, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: This PR bumps Ghostwriter to 7.2.5 and addresses several GitHub Code Quality / technical-debt items.

Changes:

  • Updated VERSION, config/settings/base.py, and CHANGELOG.md for the 7.2.5 release.
  • Fixed a typo in the reporting observation-delete AJAX URL and added a small URL reverse test to prevent regressions.
  • Improved operational logging when signal imports are skipped/fail, and added exception logging for dashboard health and background task queuing failures.
  • Adjusted the activity-log sanitize confirmation modal: correct jQuery existence check and scoped CSRF header to the sanitize request.
  • Improved expired API/service token UI feedback so the correct row/table empty-state is updated and a consistent toast is displayed.
  • General cleanup: removed unused imports, replaced assertTrue(x == y) patterns with assertEqual/assertNotEqual, and cleaned up unused loop variables.
  • Minor base-class initialization cleanup (super().__init__()) in a few helper/exception classes.

Technical Notes: Several changes are test-focused/behavior-preserving, but there is one test loop update that introduces an undefined variable (see inline comment).

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread ghostwriter/shepherd/tests/test_views.py Outdated
Comment thread ghostwriter/api/apps.py

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR bumps Ghostwriter to v7.2.5 and performs targeted cleanup driven by code-quality findings, including UI fixes (token expiry/410 handling), sanitization request hardening, URL typo correction, and improved logging around optional signal imports and task failures.

Changes:

  • Fixed/report-hardened several UI/AJAX behaviors (token row removal + empty-state updates, sanitize modal CSRF scoping, corrected observation delete URL).
  • Improved operational logging (signal import failures + background task exception logging) and removed/cleaned minor code smells (unused loop vars, clearer assertions, explicit super().__init__() calls).
  • Added a URL regression test to ensure the corrected observation delete path remains stable.

Reviewed changes

Copilot reviewed 37 out of 37 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
VERSION Bumps release version/date to 7.2.5 (27 July 2026).
ghostwriter/users/templates/users/profile.html Fixes expired token UI feedback to target the correct row/table and uses displayToastTop.
ghostwriter/users/apps.py Adds logging and logs when no Users signals are configured.
ghostwriter/templates/confirm_sanitize_modal.html Scopes CSRF header to the sanitize request, fixes jQuery presence check, avoids unintended form submission.
ghostwriter/status/apps.py Adds logging and logs when no Status signals are configured.
ghostwriter/singleton/apps.py Adds logging and logs when no Singleton signals are configured.
ghostwriter/shepherd/views.py Cleans up unused loop variable in autocomplete building.
ghostwriter/shepherd/tests/test_views.py Test cleanup, but currently introduces a loop-variable bug (see comments).
ghostwriter/shepherd/tests/test_models.py Uses clearer equality assertions.
ghostwriter/shepherd/tests/test_forms.py Uses clearer equality assertions for validation error codes.
ghostwriter/shepherd/tasks.py Calls super().__init__() in a requests auth helper.
ghostwriter/shepherd/external/bloodhound/client.py Cleans up unused loop variable while processing grouped findings.
ghostwriter/shepherd/apps.py Adds logging for signal import failures with traceback.
ghostwriter/rolodex/tests/test_views.py Cleans up unused loop variable in tests.
ghostwriter/rolodex/tests/test_models.py Cleans up unused loop variable in tests.
ghostwriter/rolodex/templates/rolodex/client_detail.html Adjusts include context for project history detail modal.
ghostwriter/rolodex/apps.py Adds logging for signal import failures with traceback.
ghostwriter/reporting/urls.py Fixes typo in observation delete AJAX URL path.
ghostwriter/reporting/tests/test_views.py Adds URL regression test + additional test cleanups.
ghostwriter/reporting/tests/test_models.py Uses clearer equality assertions.
ghostwriter/reporting/tests/test_forms.py Removes unused factory import + clearer equality assertion.
ghostwriter/reporting/apps.py Adds logging for signal import failures with traceback.
ghostwriter/oplog/tests/test_views.py Cleans up unused loop variable in tests.
ghostwriter/oplog/tests/test_forms.py Uses clearer equality assertion for validation error codes.
ghostwriter/oplog/consumers.py Makes create_oplog_entry explicitly return None on failure.
ghostwriter/oplog/apps.py Adds logging for signal import failures with traceback.
ghostwriter/modules/reportwriter/base/html_rich_text.py Ensures base initializers are called in rich text helper classes.
ghostwriter/modules/reportwriter/base/init.py Calls Exception base initializer with display text.
ghostwriter/modules/custom_layout_object.py Calls base initializer; removes unused commented CSS config.
ghostwriter/modules/cloud_monitors.py Calls super().__init__() in a requests auth helper.
ghostwriter/home/views.py Adds exception logging for dashboard health + queued task failures.
ghostwriter/home/apps.py Adds logging for signal import failures with traceback.
ghostwriter/commandcenter/apps.py Adds logging and logs when no CommandCenter signals are configured.
ghostwriter/api/tests/test_forms.py Removes an unused import.
ghostwriter/api/apps.py Adds logging and logs when no GraphQL signals are configured.
config/settings/base.py Bumps __version__ and RELEASE_DATE to 7.2.5 / 27 July 2026.
CHANGELOG.md Adds the 7.2.5 release notes and links security-related notes.

Comment thread ghostwriter/shepherd/tests/test_views.py Outdated
Comment thread ghostwriter/rolodex/templates/rolodex/client_detail.html Outdated
Copilot AI review requested due to automatic review settings July 27, 2026 19:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 37 out of 37 changed files in this pull request and generated 1 comment.

Comment thread ghostwriter/users/templates/users/profile.html
@codecov

codecov Bot commented Jul 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.59459% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.17%. Comparing base (0858e7b) to head (51cc52c).

Files with missing lines Patch % Lines
ghostwriter/oplog/consumers.py 0.00% 1 Missing ⚠️
ghostwriter/shepherd/tasks.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master     #949   +/-   ##
=======================================
  Coverage   92.17%   92.17%           
=======================================
  Files         442      442           
  Lines       33794    33796    +2     
=======================================
+ Hits        31148    31150    +2     
  Misses       2646     2646           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI review requested due to automatic review settings July 27, 2026 20:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 38 out of 38 changed files in this pull request and generated 1 comment.

Comment thread ghostwriter/reporting/tests/test_views.py
@chrismaddalena
chrismaddalena merged commit 562d756 into master Jul 27, 2026
12 checks passed
@chrismaddalena
chrismaddalena deleted the hotfix/code-cleanup branch July 27, 2026 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants