Improve code reference scan with indirect flag references
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
Research direction
Locate the Python code-reference scan and read its current regex-based implementation; no file or test path is named in the issue. Review Python's ast documentation and trace how direct flag references are reported. Done means indirect calls such as is__premium_support__enabled are found at every use while direct references remain covered.
Written by the indexing model from the issue text.
Description
While some regex'ing was all it took for a successful PoC, there are valid ways of referencing feature flags we still don't cover.
For example (thanks @khvn26 for pointing out), https://github.com/Flagsmith/flagsmith/pull/6970 introduces a function that will make flag references indirect:
def is__premium_support__enabled(organisation):
return client.is_flag_enabled("premium_support") # This is found in the scan.
def the_actual_business_function():
if is__premium_support__enabled(org): # This is a more important reference, but isn't found.
...
def another_function():
if is__premium_support__enabled(org): # Multiple uses of the flag stay hidden!
...
Acceptance criteria
- The code references scan covers for indirection such as the above.
Might be a good idea to look into ast.
- Dominant language
- Python
- Stars
- 0
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Flagsmith/ci
-
Difficulty 4/5 3-5 days Newbie friendliness 70/100
-
Add e2e testsOpen
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Similar issues
-
pydanty:is-working
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
pydantic/pydantic-ai#8843 ·
Maintainers usually reply within 1 day
-
breaking change enhancement server
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
sktime/sktime#11310 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day