feat: feature config flag for import billable tooltip dismissal#933
Conversation
Diff Coverage
|
📝 WalkthroughWalkthroughThis pull request extends the workspace feature configuration capability by adding a new boolean field to track tooltip dismissal state for billable imports. The Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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. Comment |
There was a problem hiding this comment.
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 `@apps/workspaces/models.py`:
- Line 273: The cache_key_map in FeatureConfig.get_feature_config is missing the
import_billable_tooltip_dismissed entry which causes AttributeError when
FeatureConfig.get_feature_config(workspace_id,
'import_billable_tooltip_dismissed') returns None and the code tries to access
.value; fix by adding the 'import_billable_tooltip_dismissed' mapping to
cache_key_map (the same pattern used for other boolean fields) or alternatively
make get_feature_config safe for unknown keys by returning a default
FeatureConfig-like object or checking for None before accessing .value in
FeatureConfig.get_feature_config.
ℹ️ Review info
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (3)
apps/workspaces/migrations/0061_featureconfig_import_billable_tooltip_dismissed.pyis excluded by!**/migrations/**tests/sql_fixtures/reset_db_fixtures/reset_db.sqlis excluded by!**/tests/**tests/test_workspaces/test_views.pyis excluded by!**/tests/**
📒 Files selected for processing (3)
apps/workspaces/models.pyapps/workspaces/serializers.pyapps/workspaces/views.py
| fyle_webhook_sync_enabled = models.BooleanField(default=True, help_text='Enable fyle attribute webhook sync') | ||
| migrated_to_rest_api = models.BooleanField(default=False, help_text='Migrated to using rest api') | ||
| import_billable_field_for_projects = models.BooleanField(default=False, help_text='Import billable field for projects') | ||
| import_billable_tooltip_dismissed = models.BooleanField(default=False, help_text='Import billable tooltip dismissed') |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
# Check for get_feature_config usage and imports
rg -n "get_feature_config" apps/workspaces/models.py -C 5Repository: fylein/fyle-intacct-api
Length of output: 757
🏁 Script executed:
# Check for import_billable_tooltip_dismissed references
rg -rn "import_billable_tooltip_dismissed" apps/Repository: fylein/fyle-intacct-api
Length of output: 287
🏁 Script executed:
# Look for cache_key_map definition
rg -n "cache_key_map" apps/workspaces/models.py -C 5Repository: fylein/fyle-intacct-api
Length of output: 1073
🏁 Script executed:
# Check for feature flag enums
rg -n "FEATURE_CONFIG|class.*Feature" apps/workspaces/models.py -C 2Repository: fylein/fyle-intacct-api
Length of output: 647
🏁 Script executed:
# Check if import_billable_tooltip_dismissed is accessed via get_feature_config
rg -rn "get_feature_config.*import_billable" apps/ --type pyRepository: fylein/fyle-intacct-api
Length of output: 169
🏁 Script executed:
# Check all calls to get_feature_config to see what keys are used
rg -rn "get_feature_config" apps/ --type py -A 1 | grep -E "(get_feature_config|\.get_feature_config)" | head -20Repository: fylein/fyle-intacct-api
Length of output: 49
🏁 Script executed:
# Search more broadly for how FeatureConfig fields are accessed
rg -rn "FeatureConfig\." apps/ --type py | grep -v "migration" | head -20Repository: fylein/fyle-intacct-api
Length of output: 2549
🏁 Script executed:
# Check the actual field name in the model - was it 'n' or full name?
cat -n apps/workspaces/models.py | sed -n '270,295p'Repository: fylein/fyle-intacct-api
Length of output: 1905
import_billable_tooltip_dismissed missing from cache_key_map in get_feature_config method.
If this field is accessed via FeatureConfig.get_feature_config(workspace_id, 'import_billable_tooltip_dismissed'), it will raise AttributeError at line 294 when trying to call .value on None. Add the missing cache key entry to cache_key_map (lines 286–291) or handle unknown keys safely.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@apps/workspaces/models.py` at line 273, The cache_key_map in
FeatureConfig.get_feature_config is missing the
import_billable_tooltip_dismissed entry which causes AttributeError when
FeatureConfig.get_feature_config(workspace_id,
'import_billable_tooltip_dismissed') returns None and the code tries to access
.value; fix by adding the 'import_billable_tooltip_dismissed' mapping to
cache_key_map (the same pattern used for other boolean fields) or alternatively
make get_feature_config safe for unknown keys by returning a default
FeatureConfig-like object or checking for None before accessing .value in
FeatureConfig.get_feature_config.
(cherry picked from commit f47a7d2)
(cherry picked from commit f47a7d2)
Clickup
app.clickup.com
https://fylein.slack.com/archives/C0A6AA874T1/p1772098660797649