feat: Add possibility to allowlist integrations in toxgen - #6996
Conversation
| parser.add_argument( | ||
| "--only-update", | ||
| nargs="*", | ||
| default=[], | ||
| help="Only update versions for these integrations (all others will be skipped).", | ||
| ) |
There was a problem hiding this comment.
Bug: Using the --only-update flag without any integration names causes all integrations to be updated, which is counter-intuitive and the opposite of the flag's intent.
Severity: LOW
Suggested Fix
Add a check after parsing arguments to ensure that if the --only-update flag was provided, its corresponding list of integrations is not empty. If it is empty, print an error message informing the user that they must provide at least one integration name and exit.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: scripts/populate_tox/populate_tox.py#L1218-L1223
Potential issue: When the `--only-update` flag is used without any integration names, it
is parsed as an empty list. This empty list is treated as a falsy value in the script's
logic. Consequently, the condition `only_update and integration not in only_update` in
the skip logic always evaluates to `False`. This causes the script to bypass the
intended filtering and proceed to update all integrations, which is the opposite of the
flag's purpose and happens without any warning to the user.
Also affects:
scripts/populate_tox/populate_tox.py:1286~1288scripts/populate_tox/populate_tox.py:1306~1308
Did we get this right? 👍 / 👎 to inform future reviews.
Codecov Results 📊✅ 94982 passed | ⏭️ 6343 skipped | Total: 101325 | Pass Rate: 93.74% | Execution Time: 341m 6s 📊 Comparison with Base Branch
All tests are passing successfully. ✅ Patch coverage is 100.00%. Project has 2511 uncovered lines. Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 37.77% 89.89% +52.12%
==========================================
Files 193 193 —
Lines 24832 24832 —
Branches 8912 8912 —
==========================================
+ Hits 9378 22321 +12943
- Misses 15454 2511 -12943
- Partials 496 1415 +919Generated by Codecov Action |
…6996) We can already skip specific integrations. Add the opposite, too -- only updating specific integrations and skipping everything else.
We can already skip specific integrations. Add the opposite, too -- only updating specific integrations and skipping everything else.