Skip to content

JS: Deprecations and related refactorings #18132

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

Merged
merged 34 commits into from
Dec 6, 2024

Conversation

asgerf
Copy link
Contributor

@asgerf asgerf commented Nov 27, 2024

Deprecates a lot of stuff and refactors a few things to avoid depending on deprecated predicates ourselves.

Deprecations

Deprecates the old data flow library and some related classes.

  • DataFlow::
    • Configuration
    • BarrierGuardNode
    • LabeledBarrierGuardNode
    • AdditionalBarrierGuardNode
  • TaintTracking::
    • Configuration
    • SanitizerGuardNode
    • LabeledSanitizerGuardNode
    • AdditionalSanitizerGuardNode

A couple of refactorings were needed to actually remove our own uses of the guard-related classes.

Also adds a new class called TaintTracking::AdditionalBarrierGuard for built-in taint barriers.

More deprecations and migration docs will likely follow in later PRs.

Documentation

Also beefs up the qldoc for SummarizedCallable in preparation of using it as the replacement for some of our step-related APIs, and we'll likely need to reference it in an upcoming data flow migration article.

We now have plenty of articles/tutorials that refer to the deprecated APIs, but I've factored updates to .rst files into a separate documentation PR.

Evaluations

Evaluation shows a a nice little speed-up of 1% average and 3% median, resulting from the refactorings mentioned.

@asgerf asgerf added the no-change-note-required This PR does not need a change note label Nov 27, 2024
@asgerf asgerf force-pushed the jss/deprecation branch 4 times, most recently from d198347 to 2cdc1de Compare December 2, 2024 09:51
asgerf added 20 commits December 3, 2024 14:30
We're deprecating the class through an alias, but it is still the base class for a non-deprecated class, for backwards compatibility. For this reason we're also deprecating all of its member predicates so we can remove those in the future.
Also avoid the term "analysis-specific" because it's not a term we use anywhere else.
Mainly adds 'deprecated' in front of a bunch of tests for deprecated APIs.
The tests show a new (source, sink) pair for an already-flagged sink.

Not sure why it was not flagged originally since the data flow path seems valid, given the steps provided by our models.
asgerf added 14 commits December 3, 2024 14:30
Unlike most other references to this class, we're not subclassing it here, we're
just trying to reuse some standard barrier guards but with a different flow state.
Drive-by bugfix: Rename sanitizes -> blocksExpr.
This fixes a bug that caused the sanitizer guard not to work in df2.

The test output reflects the fact that the barrier guard works now.
…rdNode

Previously our barrier guard classes were direct descendents of SanitizerGuardNode which made it hard to deprecate that class.

Now our barrier guards are not descending from any shared class. Instead they are contributed to SanitizerGuardNode via a private helper class we can remove in the future.
Makes a quick effort attempt to restore the original behaviour, though
it is not exactly the same due to lack of recursion.
@asgerf asgerf marked this pull request as ready for review December 3, 2024 14:04
@asgerf asgerf requested a review from a team as a code owner December 3, 2024 14:04
Copy link
Contributor

@erik-krogh erik-krogh left a comment

Choose a reason for hiding this comment

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

Nice 👍

@asgerf asgerf merged commit b8d652c into github:js/shared-dataflow-branch Dec 6, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
JS no-change-note-required This PR does not need a change note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants