plane icon indicating copy to clipboard operation
plane copied to clipboard

migration: added webhook version, navigation related fields and allowed_rate_limit for APIToken

Open sangeethailango opened this issue 2 weeks ago β€’ 2 comments

Description

This pull request contains model changes :

  • version field has been added in the webhook,
  • feature_tours in WorkspaceUserProperties
  • is_navigation_tour_completed in the Profile model
  • allowed_rate_limit in APIToken

Summary by CodeRabbit

  • New Features
    • Webhooks now store a persistent version (default "v1") for clearer versioning.
    • Profiles record whether the navigation tour has been completed.
    • Per-user workspace settings include product-tour flags; existing users are auto-populated with default values.
    • API tokens gain a configurable allowed rate limit (default "60/min").

✏️ Tip: You can customize this high-level summary in your review settings.

sangeethailango avatar Dec 15 '25 10:12 sangeethailango

πŸ“ Walkthrough

Walkthrough

Adds four new model fields via a Django migration and bulk-populates one JSON field: Webhook.version (CharField, default "v1"), Profile.is_navigation_tour_completed (BooleanField, default False), WorkspaceUserProperties.product_tour (JSONField, default generator), and APIToken.allowed_rate_limit (CharField, default "60/min").

Changes

Cohort / File(s) Summary
Migration
apps/api/plane/db/migrations/0113_webhook_version.py
New migration (depends on ('db', '0112_auto_20251124_0603')) adding Webhook.version, Profile.is_navigation_tour_completed, WorkspaceUserProperties.product_tour, and APIToken.allowed_rate_limit; defines get_default_product_tour() and populate_product_tour() and runs RunPython(populate_product_tour, reverse_code=migrations.RunPython.noop).
Webhook model
apps/api/plane/db/models/webhook.py
Adds version = models.CharField(default="v1", max_length=50) to Webhook.
User/Profile model
apps/api/plane/db/models/user.py
Adds is_navigation_tour_completed = models.BooleanField(default=False) to Profile.
Workspace models / defaults
apps/api/plane/db/models/workspace.py
Adds get_default_product_tour() (returns {"work_items": True, "cycles": True, "modules": True, "intake": True, "pages": True}) and product_tour = models.JSONField(default=get_default_product_tour) on WorkspaceUserProperties.
API token model
apps/api/plane/db/models/api.py
Adds allowed_rate_limit = models.CharField(max_length=255, default="60/min") to APIToken.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

"I hopped through migrations, leaves in a whirl,
New fields I planted β€” version, tour, and rate,
A product_tour sprouted for each workspace girl,
Tokens now pace at sixty per minute's gait,
A tiny rabbit applause for this tidy update πŸ‡"

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers the key model changes but lacks required sections like Type of Change, Test Scenarios, and References from the template. Only the Description section is partially filled. Add missing template sections: specify the Type of Change (likely Feature), describe Test Scenarios for validating the new fields, and add any related issue references.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
βœ… Passed checks (1 passed)
Check name Status Explanation
Title check βœ… Passed The title accurately reflects the main changes: adding webhook version field, navigation-related fields, and allowed_rate_limit for APIToken, all present in the changeset.
✨ 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 migration-webhook

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.

coderabbitai[bot] avatar Dec 15 '25 10:12 coderabbitai[bot]

You have run out of free Bugbot PR reviews for this billing cycle. This will reset on January 20.

To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

cursor[bot] avatar Dec 23 '25 13:12 cursor[bot]