Career Politics

Squirrel
Squirrel

Posted on

Weekly Recap: AI Community Bots, AdSense Integration & Org Page Revamps

Welcome to the weekly recap for the careerpolitics/careerpolitics-platform repository! Over the last 7 days, the project saw 8 merged pull requests and 19 commits. This week brings exciting new capabilities for community managers, a complete overhaul of organization pages, and essential backend optimizations.

🤖 AI Bots & Community Automation

Administrators now have much more flexibility when managing their communities. We rolled out a highly anticipated feature that enables admin-managed community bots and automations without requiring a dedicated subforum setup.

Enable admin-managed community bots and automations without subforem #81

Motivation

  • Allow site admins to create and manage community bots and scheduled automations for the main community (no subforem) from the admin UI so hosts that only use the main community can create bots and schedule automations.

Description

  • Add top-level admin routes for community_bots with nested scheduled_automations so bot management is available at /admin/customization/community_bots/... (in config/routes/admin.rb).
  • Update controllers to support both subforem-scoped and main-community flows by inferring context, centralizing scope/path helpers, and updating redirects (Admin::CommunityBotsController, Admin::ScheduledAutomationsController).
  • Make service/model/policy changes so bots may be created without a subforem by allowing subforem_id: nil in CommunityBots::CreateBot and falling back to Settings::General.app_domain for email generation, add User.community_bots_for_main_community scope, and guard deletion/authorization when onboarding_subforem_id is blank (CommunityBots::DeleteBot, CommunityBotPolicy, User model).
  • Update admin views so links, labels and form targets work for both subforem and main-community contexts, and add request specs to cover the new top-level routes (spec/requests/admin/community_bots_spec.rb and spec/requests/admin/scheduled_automations_controller_spec.rb).

Testing

  • Added request specs that exercise top-level admin_community_bots and admin_community_bot_scheduled_automations flows and assert creation, deletion, redirects and automation behavior (spec/requests/admin/community_bots_spec.rb and spec/requests/admin/scheduled_automations_controller_spec.rb).
  • Attempted to run the new specs with bundle exec rspec spec/requests/admin/community_bots_spec.rb spec/requests/admin/scheduled_automations_controller_spec.rb and bin/rspec ..., but test execution failed in this environment due to missing bundle/Ruby runtime, so automated tests were not executed here.
  • Views/routes/controllers were reviewed and smoke-checked in the patch; CI should run the added request specs in a Ruby-enabled environment to confirm full behavior.

Codex Task

Building directly on this foundation, we introduced AI post generation into the platform's scheduled automations. This allows community bots to automatically generate and publish fresh content to keep user engagement high.

Add community bot AI post generation to scheduled automations #82

Motivation

  • Enable community bots to generate context-driven posts via scheduled automations using the AI subsystem.
  • Keep the change focused and reusable by adding a dedicated AI service and wiring it into the existing ScheduledAutomations::Executor flow for draft/publish actions.

Description

  • Added a new AI service Ai::CommunityBotPostCreator that accepts ai_context and optional additional_instructions and returns a parsed PostResult with title and body.
  • Extended ScheduledAutomations::Executor to support service_name: "community_bot_post_creator" and added call_community_bot_post_creator_service which validates action_config["ai_context"] and uses the new AI service.
  • Updated admin scheduled automation forms (app/views/admin/scheduled_automations/new.html.erb and edit.html.erb) to expose the new service option and add an AI Context field for action_config["ai_context"].
  • Added regression specs: spec/services/ai/community_bot_post_creator_spec.rb and extended spec/services/scheduled_automations/executor_spec.rb to cover the new service integration and error handling.
  • Note: new UI strings were added for the service and form labels; localization entries in config/locales were not included and should be added to satisfy i18n requirements.

Testing

  • Added RSpec tests for the new service (spec/services/ai/community_bot_post_creator_spec.rb) and executor integration (spec/services/scheduled_automations/executor_spec.rb).
  • Attempted to run bundle exec rspec spec/services/ai/community_bot_post_creator_spec.rb spec/services/scheduled_automations/executor_spec.rb, but the command failed in this environment with /bin/bash: line 1: bundle: command not found; tests should pass locally or in CI where bundle/gems are available.

Codex Task

📈 Monetization Enhancements

We introduced new functionality to support ad revenue generation. Administrators can now easily add and configure Google AdSense account details directly within the platform.

FEAT: Add google adsense account details #79

What type of PR is this? (check all applicable)

  • [ ] Refactor
  • [ ] Feature
  • [ ] Bug Fix
  • [ ] Optimization
  • [ ] Documentation Update

Description

Related Tickets & Documents

  • Related Issue #
  • Closes #

QA Instructions, Screenshots, Recordings

Please replace this line with instructions on how to test your changes, a note on the devices and browsers this has been tested on, as well as any relevant images for UI changes.

UI accessibility checklist

If your PR includes UI changes, please utilize this checklist:

  • [ ] Semantic HTML implemented?
  • [ ] Keyboard operability supported?
  • [ ] Checked with axe DevTools and addressed Critical and Serious issues?
  • [ ] Color contrast tested?

For more info, check out the Forem Accessibility Docs.

Added/updated tests?

We encourage you to keep the code coverage percentage at 80% and above.

  • [ ] Yes
  • [ ] No, and this is why: please replace this line with details on why tests have not been included
  • [ ] I need help with writing tests

[optional] Are there any post deployment tasks we need to perform?

[optional] What gif best describes this PR or how it makes you feel?

alt_text

🏢 Organization Pages Revamp

Organization profiles received a massive overhaul this week. The updated organization pages now include a fully functional README editor, support for liquid tags, integrated social links, an updated header call-to-action, and a completely redesigned settings interface.

🏗 Architecture & Backend Performance

The team tackled several architectural improvements to keep the application running smoothly at scale:

  • Split response payloads into separate, dedicated endpoints for each distinct response type.
  • Implemented a cleanup job to automatically delete old user notifications before they build up.
  • Adjusted the notification cleanup retention window from 3 months to 85 days.
  • Patched a notification cleanup issue that was causing database over-indexing.
  • Updated concurrent index files to ensure more reliable deployment pipelines.

💅 UI Polishes & Routine Maintenance

In addition to major feature work, we merged several upstream updates and deployed a handful of front-end fixes to polish the user experience:

  • Fixed an issue where the mobile footer and billboard were being cut off by the fixed reaction bar.
  • Corrected styling mismatches within liquid tags.
  • Fixed maximum width constraints on the subscription icon image.
  • Added missing JavaScript build steps to the Containerfile for smoother environment setups.
  • Successfully merged multiple upstream patches to keep the core codebase synchronized.

Top comments (0)