Visitar URL original
Ruby: align type-tracking visibility with JS/Python by asgerf · Pull Request #13615 · github/codeql · GitHub
The Wayback Machine - https://web.archive.org/web/20260324082102/https://github.com/github/codeql/pull/13615
Skip to content

Ruby: align type-tracking visibility with JS/Python#13615

Draft
asgerf wants to merge 6 commits intogithub:mainfrom
asgerf:rb/move-tt-code-internal
Draft

Ruby: align type-tracking visibility with JS/Python#13615
asgerf wants to merge 6 commits intogithub:mainfrom
asgerf:rb/move-tt-code-internal

Conversation

@asgerf
Copy link
Contributor

@asgerf asgerf commented Jun 29, 2023

This started as some prep work to share the recent API graph overhaul with Python, but some differences in type-tracking are starting to cause a lot of friction.

So in this PR I'm aligning Ruby with JS/Python in terms of where type-tracking files are stored and how they are exposed to the end-user.

The TypeTracker and TypeBackTracker classes are now exposed as DataFlow::TypeTracker and DataFlow::TypeBackTracker, as they have always been in JS and Python. The qldoc for the TypeTracker class contains example code that refers to it as DataFlow::TypeTracker and this code never worked in Ruby. Now the same example code works across languages.

Why not align in the opposite direction? Personally I find that this style makes important features more discoverable, and it's easier to write self-contained snippets of code for others when don't have to remind them to also import a certain file, and when you're typing you don't have to jump to the top of the file to add a new import (or check if it's already imported with an alias). Also there's just more code that would break if we align the other way.

Additionally, all files have moved out of the codeql.ruby.typetracking folder into either codeql.ruby.dataflow or codeql.ruby.dataflow.internal. A deprecated forwarder library has been left behind.

@asgerf asgerf changed the title Ruby: Ruby: align type-tracking visibility with JS/Python Jun 29, 2023
@asgerf asgerf force-pushed the rb/move-tt-code-internal branch from 22bd0d6 to f3ee9e2 Compare July 13, 2023 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant