Skip to content

Fix broken post URL helper and remove dead code#233

Merged
DogukanUrker merged 1 commit intomainfrom
chore/remove-dead-code-and-fix-url-id
Feb 6, 2026
Merged

Fix broken post URL helper and remove dead code#233
DogukanUrker merged 1 commit intomainfrom
chore/remove-dead-code-and-fix-url-id

Conversation

@DogukanUrker
Copy link
Copy Markdown
Owner

@DogukanUrker DogukanUrker commented Feb 6, 2026

Summary

  • fix the url_id context helper to pass the correct argument shape to get_post_url_id_from_post
  • remove unused runtime code (post_config.js, unused time helpers, unused BREAKER_TEXT setting)
  • drop unused legacy admin aliases (/admin-panel/*) and keep canonical /admin/* routes
  • remove unused E2E helper/data/page-object methods to reduce maintenance surface

Validation

  • make ci
  • make test (62 passed)

Notes

  • This intentionally removes legacy /admin-panel/* route aliases; /admin/* routes remain unchanged.

Summary by CodeRabbit

  • Chores
    • Consolidated admin panel URLs to use single route pattern; old alternate URL paths have been deprecated.
    • Removed unused configuration files and deprecated utility functions.
    • Cleaned up test infrastructure and removed obsolete testing helpers.

@DogukanUrker DogukanUrker self-assigned this Feb 6, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Feb 6, 2026

📝 Walkthrough

Walkthrough

This pull request removes deprecated route aliases from admin panel endpoints, eliminates unused utility functions and settings, and strips test helper methods and data structures. The "/admin-panel/" URL routes are removed while keeping "/admin/" routes intact; utility functions are refactored or deleted; and test page objects are simplified by removing numerous interaction helpers.

Changes

Cohort / File(s) Summary
Admin Panel Routes Simplification
app/routes/admin_panel_comments.py, app/routes/admin_panel_posts.py, app/routes/admin_panel_users.py
Removed alternate route decorators that mapped to "/admin-panel/*" endpoints; only "/admin/*" routes remain active.
Settings and Static Asset Cleanup
app/settings.py, app/static/js/post_config.js
Removed BREAKER_TEXT setting attribute and deleted empty post_config.js file containing only comments.
Utility Functions Refactoring
app/utils/context_processor/return_post_url_id.py, app/utils/time.py
Refactored url_id helper to accept single post_id parameter instead of (title, content); removed current_time_zone(), current_date(), and current_time() functions.
Test Data and Helpers Cleanup
tests/e2e/helpers/__init__.py, tests/e2e/helpers/test_data.py, tests/e2e/helpers/database_helpers.py
Removed PostData class, admin() method from UserData, test constants (INVALID_USERNAMES, INVALID_PASSWORDS, DEFAULT_ADMIN_CREDENTIALS, TEST_TIMEOUT, SLOW_TEST_TIMEOUT), and database helper functions (delete_user, user_exists, get_user_count, email_exists).
Test Page Object Cleanup
tests/e2e/pages/base_page.py, tests/e2e/pages/login_page.py, tests/e2e/pages/navbar_component.py, tests/e2e/pages/signup_page.py
Removed flash message handlers, navigation helpers, form interaction methods, and UI element selectors across multiple page objects; kept core assertion and login functionality.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • PR #220: Directly removes many of the same e2e test modules, helpers, and page-object symbols that were previously introduced
  • PR #199: Related code-level changes to admin_panel route files and context_processor utilities previously refactored in the same codebase
  • PR #210: Overlapping modifications to admin_panel routes and post URL/id utility functions

Poem

🐰 Old paths and helpers must say goodbye,
Cleaning the warren as we optimize,
Admin routes streamlined, test clutter shed,
A tidier burrow, simpler and well-fed! 🌱

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The description covers the key changes with a summary section and validation steps, but is missing the required 'Fixes #' issue reference at the top of the template. Add the issue number reference (e.g., 'Fixes #123') at the beginning of the description to complete the template structure.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main changes: fixing the post URL helper and removing dead code, which are the central objectives of this PR.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/remove-dead-code-and-fix-url-id

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@DogukanUrker DogukanUrker merged commit fe7a05a into main Feb 6, 2026
2 of 3 checks passed
@DogukanUrker DogukanUrker deleted the chore/remove-dead-code-and-fix-url-id branch February 6, 2026 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant