Fix GitHub security and code quality findings - #14
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR focuses on addressing GitHub security/code-quality findings by preventing sensitive file paths from being emitted to operation logs, cleaning up dead/unused code paths, and adding regression tests to ensure logging remains path-safe.
Changes:
- Sanitizes file-operation logging to avoid emitting source/destination paths; adds regression tests asserting logs contain only managed-file IDs.
- Performs repo-wide quality cleanups (remove unused imports/variables, unreachable branches, dead assignments) and documents intentionally ignored exception cases.
- Aligns test doubles / overrides with updated interfaces and exports the workflow builder for admin bootstrap usage.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/test_workflow_engine.py | Makes on_commit test callback explicitly callable/typed for clearer patching. |
| tests/test_views.py | Updates payment provider test override signature to match the expected interface. |
| tests/test_file_handler.py | Adds regression coverage to ensure file operations don’t log private paths. |
| manage_dev.py | Removes unused import to satisfy lint/code-quality checks. |
| example_project/example/settings.py | Removes unused import to satisfy lint/code-quality checks. |
| django_forms_workflows/workflow_engine.py | Removes dead assignments in name lookup logic. |
| django_forms_workflows/workflow_builder_views.py | Removes dead assignment in sub-workflow config handling. |
| django_forms_workflows/views.py | Adds clarifying comments for intentionally ignored JSON parse errors; removes unused local import / dead branches. |
| django_forms_workflows/utils.py | Replaces placeholder LDAP backend instantiation with clearer “available but not configured” logging. |
| django_forms_workflows/tasks.py | Documents intentionally ignored missing-task cases during notification rendering. |
| django_forms_workflows/static/django_forms_workflows/js/workflow-builder.js | Removes unused locals and explicitly exports WorkflowBuilder to window for admin bootstrap usage. |
| django_forms_workflows/static/django_forms_workflows/js/form-builder-property-editor.js | Removes unused dropdown-building code paths. |
| django_forms_workflows/migrations/0064_add_reviewer_groups.py | Removes unused import/whitespace in migration. |
| django_forms_workflows/handlers/file_handler.py | Replaces path-containing log messages with managed-file ID logs for file operations. |
| django_forms_workflows/forms.py | Removes unused imports/variables and simplifies approval-step field creation path. |
| django_forms_workflows/email_backends/gmail_api.py | Adds clarifying comment for intentionally ignored malformed Gmail error payloads. |
| django_forms_workflows/admin.py | Removes unused local imports where module-level json is already used. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
1432
to
+1436
| if task_id: | ||
| try: | ||
| task = ApprovalTask.objects.select_related("workflow_stage").get(id=task_id) | ||
| except ApprovalTask.DoesNotExist: | ||
| # A concurrently deleted task simply leaves notification context unscoped. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Quality cleanup
Verification