Skip to content

🐛(back) add missing color option for project colors#341

Open
providenz wants to merge 1 commit intomainfrom
providenz/add-missing-color
Open

🐛(back) add missing color option for project colors#341
providenz wants to merge 1 commit intomainfrom
providenz/add-missing-color

Conversation

@providenz
Copy link
Collaborator

@providenz providenz commented Mar 19, 2026

Purpose

Backend only defined 9 project colors but the frontend expects 10

NB: an existing migration is edited (entry added to choices)

Summary by CodeRabbit

  • Bug Fixes

    • Added a missing project color option that was previously unavailable to users.
  • Tests

    • Added comprehensive test coverage for all project color options to ensure functionality.

Signed-off-by: Laurent Paoletti <lp@providenz.fr>
@coderabbitai
Copy link

coderabbitai bot commented Mar 19, 2026

Walkthrough

This PR adds a new color option ("Color 10") to the ChatProject model by extending the ChatProjectColor enum, updating a Django migration, and adding a parametrized test to verify all project colors work correctly.

Changes

Cohort / File(s) Summary
Documentation
CHANGELOG.md
Added entry under [Unreleased] documenting the new color option fix.
Model Definitions
src/backend/chat/models.py, src/backend/chat/migrations/0006_chatproject_chatconversation_project.py
Extended ChatProjectColor enum with COLOR_10 = "color_10" choice and updated migration's model field choices accordingly.
Test Coverage
src/backend/chat/tests/views/projects/test_create.py
Added parametrized test test_create_project_with_each_color to verify the create endpoint accepts all ChatProjectColor values and persists them correctly.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding a missing 10th color option to the backend project colors to align with frontend expectations.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch providenz/add-missing-color

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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/backend/chat/migrations/0006_chatproject_chatconversation_project.py`:
- Line 90: The migration 0006_chatproject_chatconversation_project.py was
modified to add the missing "color_10" choice in the CreateModel choices tuple,
but you must first verify this migration has not been applied anywhere; check
all environments (dev/staging/prod) for migration 0006 applied status and if it
has been applied, do NOT alter this migration file. If 0006 has been applied
anywhere, instead revert this change and create a new migration that uses
AlterField on the ChatProject/ChatConversation field (the field with the choices
tuple that previously missed "color_10") to add the missing choice; if 0006 has
not been applied anywhere, it's safe to keep the edited CreateModel choices
including ("color_10", "Color 10").

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: ec40ed46-77d0-4b73-8319-8c9e795c476d

📥 Commits

Reviewing files that changed from the base of the PR and between 6dd41e8 and 5207a94.

📒 Files selected for processing (4)
  • CHANGELOG.md
  • src/backend/chat/migrations/0006_chatproject_chatconversation_project.py
  • src/backend/chat/models.py
  • src/backend/chat/tests/views/projects/test_create.py

@sonarqubecloud
Copy link

Copy link
Member

@qbey qbey left a comment

Choose a reason for hiding this comment

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

I wonder if the number of colors should be a setting ? no need to change it, keep it simple for now

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