Skip to content

Python: Deprecate importNode#6312

Merged
RasmusWL merged 4 commits into
github:mainfrom
tausbn:python-deprecate-importnode
Sep 10, 2021
Merged

Python: Deprecate importNode#6312
RasmusWL merged 4 commits into
github:mainfrom
tausbn:python-deprecate-importnode

Conversation

@tausbn
Copy link
Copy Markdown
Contributor

@tausbn tausbn commented Jul 16, 2021

Unsurprisingly, the only thing affected by this was the import-helper
tests. These have lost all of the results relating to ImportMembers,
but apart from that the underlying behaviour should be the same.

I also limited the test to only CfgNodes, as a bunch of EssaNodes
suddenly appeared when I switched to API graphs.

Finally, I used API::moduleImport with a dotted name in the type
tracking tests. This goes against the API graphs interface, but I think
it's more correct for this use case, as these type trackers are doing
the "module attribute lookup" bit manually.

Unsurprisingly, the only thing affected by this was the `import-helper`
tests. These have lost all of the results relating to `ImportMember`s,
but apart from that the underlying behaviour should be the same.

I also limited the test to only `CfgNode`s, as a bunch of `EssaNode`s
suddenly appeared when I switched to API graphs.

Finally, I used `API::moduleImport` with a dotted name in the type
tracking tests. This goes against the API graphs interface, but I think
it's more correct for this use case, as these type trackers are doing
the "module attribute lookup" bit manually.
@tausbn tausbn requested a review from a team as a code owner July 16, 2021 11:48
Copy link
Copy Markdown
Member

@RasmusWL RasmusWL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change looks good to me overall 👍

I'm not too sure whether the import-helper tests adds any value now though. As far as I can tell, we have all these tests files in ql/test/experimental/dataflow/ApiGraphs/test5.py (with nice annotations). So I would suggest we just delete these import-helper tests. (although I certainly don't want us to delete the last copy of these carefully constructed tests).

As discussed, these are all present in the `ApiGraphs` directory
already (except for the dataflow consistency test, which has been
moved there instead).
@RasmusWL RasmusWL merged commit b45743b into github:main Sep 10, 2021
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.

2 participants