-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Data flow: Replace hasLocationInfo
with getLocation
#15853
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
0dc9f0c
to
da423bb
Compare
I just want to call out that this change will add more friction for the JS data flow migration, since JS data flow nodes have locations that don't correspond to any |
da423bb
to
80be65f
Compare
802e254
to
fe212db
Compare
fe212db
to
1c19b09
Compare
555e907
to
01c1cca
Compare
01c1cca
to
73a59de
Compare
bfdafa8
to
b0e5bd2
Compare
As discussed offline, we agreed to go ahead with this change. The issue with missing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Meant to say: the Go changes look good to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. One suggestion for the TLocation
type for go.
b0e5bd2
to
6c0ed28
Compare
shared/dataflow/codeql/dataflow/internal/DataFlowImplCommon.qll
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly LGTM, but I wonder whether the change to source- and sink-groups is intentional? They now have no location instead of having the empty location.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't looked at the Go changes, but everything else LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Python 👍
This PR changes the API of the shared data flow library from using
hasLocationInfo
, to instead usegetLocation
via the existingLocationSig
signature for locations. In addition to having a nicer API, it also makes for a small performance improvement, as the 5-columnhasLocationInfo
predicate no longer needs to be materialized for all (Path
)Node
s arising from instantiating the data flow library, we only ever need to materializeLocation.hasLocationInfo
.The transformation is mostly straightforward, except for Go, where we need to account for the fact that not all existing tuples in
Node.hasLocationInfo
may correspond to an extracted location. This is handled by backingLocation
up by anewtype
, which can represent both extracted and synthetic locations. In order to avoid a dependency onNode.hasLocationInfo
inLocatable.getLocation
,Locatable.getLocation
returns not aLocation
, but instead aDbLocation
, which can be cast to aLocation
, but does not extendLocation
.