Title: Python: deprecate AstNode.getAFlowNode() and rewrite callers by yoff · Pull Request #21919 · github/codeql · GitHub
Open Graph Title: Python: deprecate AstNode.getAFlowNode() and rewrite callers by yoff · Pull Request #21919 · github/codeql
X Title: Python: deprecate AstNode.getAFlowNode() and rewrite callers by yoff · Pull Request #21919 · github/codeql
Description: Summary Preparatory refactor for the shared-CFG dataflow migration (#21894). Deprecates the AstNode.getAFlowNode() cached predicate on the public Python QL API and rewrites all ~140 internal callers across lib/, src/, test/, and tools/ from expr.getAFlowNode() = cfgNode to cfgNode.getNode() = expr, using ControlFlowNode.getNode() which already exists in Flow.qll. Follow-up commit does the same for Function.getAReturnValueFlowNode() (11 internal call sites). (Previously this PR removed both predicates outright; based on review feedback it now keeps them as deprecated so external users can migrate at their own pace.) Why The dataflow library is being migrated to the shared CFG. In the new world there is no AST → CFG predicate (analogous to Java, Ruby, Swift, etc.) — the bridge only goes from CFG → AST via ControlFlowNode.getNode(). This PR factors out the call-site rewrite so that the bigger migration PR contains only genuinely new logic, while leaving the deprecated wrappers in place to avoid churn for external users. Semantic effect None. The two forms are exact equivalents in the legacy CFG: e.getAFlowNode() = n <==> n.getNode() = e Verified by: All 362 lib/ + src/ queries compile clean. All 123 ControlFlow + PointsTo library-tests pass. All 64 dataflow library-tests pass. All 113 Variables/Exceptions/Expressions/Statements/Functions/Imports/Security/CWE-798/ModificationOfParameterWithDefault query-tests pass. Notes for reviewers AstNode.getAFlowNode() in python/ql/lib/semmle/python/AstExtended.qll and Function.getAReturnValueFlowNode() in Function.qll are now marked deprecated with a docstring pointing at the recommended replacement. A handful of Exprs.qll / Import.qll classes had override XxxNode getAFlowNode() { result = super.getAFlowNode() } redeclarations that become dangling under the deprecation; removed to keep the API surface tidy. Two deprecated change-notes are included. Stacked under #21930.
Open Graph Description: Summary Preparatory refactor for the shared-CFG dataflow migration (#21894). Deprecates the AstNode.getAFlowNode() cached predicate on the public Python QL API and rewrites all ~140 internal caller...
X Description: Summary Preparatory refactor for the shared-CFG dataflow migration (#21894). Deprecates the AstNode.getAFlowNode() cached predicate on the public Python QL API and rewrites all ~140 internal caller...
Opengraph URL: https://github.com/github/codeql/pull/21919
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:5f70a9bc-b6bc-77af-a813-80c89f2f9ea1 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | D194:5CEA4:430337:5F7A43:6A4E6E54 |
| html-safe-nonce | e8fffad08335344c1038293afb036fe71c628c156b8b4013e27031e88138a0d7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMTk0OjVDRUE0OjQzMDMzNzo1RjdBNDM6NkE0RTZFNTQiLCJ2aXNpdG9yX2lkIjoiMzU2MDM0MDMwMzE3NTkwNDg1MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 49dc456e48294cf401f9353bbfe2ea2bd87aaff34c108b7fef0c5aab7213cfcf |
| hovercard-subject-tag | pull_request:3780392460 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/github/codeql/pull/21919/files |
| twitter:image | https://avatars.githubusercontent.com/u/647347?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/647347?s=400&v=4 |
| og:image:alt | Summary Preparatory refactor for the shared-CFG dataflow migration (#21894). Deprecates the AstNode.getAFlowNode() cached predicate on the public Python QL API and rewrites all ~140 internal caller... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 41b6ab3ba6d20a71766ac245b5a4a94c6fc672a9cd4da7d44c1b33ab8bf6a21c |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/github/codeql git https://github.com/github/codeql.git |
| octolytics-dimension-user_id | 9919 |
| octolytics-dimension-user_login | github |
| octolytics-dimension-repository_id | 143040428 |
| octolytics-dimension-repository_nwo | github/codeql |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 143040428 |
| octolytics-dimension-repository_network_root_nwo | github/codeql |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | e6a744804e8e70f97b4d5a18a94dcc63db22f97a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width