question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[PiranhaJava] Does not not clean up properly after removing feature flag

See original GitHub issue

The un-referenced methods inside the code Piranha cleaned up is not removed. I was hoping the code which is no more referenced after clean up (dummyMethod in below example) will also be removed and hence a deep cleanup.

Before:

  public void bar() {
    if (expt.flagDisabled(TestExperimentName.SAMPLE_STALE_FLAG)) {
      System.out.println("Hi World");
      dummyMethod();
    }
  }

  private void dummyMethod() {
    System.out.println("Dummy Method");
  }

After:

  public void bar() {
    
  }

  private void dummyMethod() {
    System.out.println("Dummy Method");
  }

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mkr-plsecommented, Jun 29, 2021

Other variants of Piranha (Swift, JS) have already implemented some form of deep cleaning. AFAIK, Proguard may be able to delete the deadcode from bytecode but not from source. We expect to add this feature to PiranhaJava. Unfortunately, we haven’t yet gotten to this milestone yet.

0reactions
mkr-plsecommented, May 9, 2022

@NikitashP We are working on making this much easier with a newer implementation of Piranha. See here. Please check it out as we expect it to be very customizable and adaptable for various use cases. cc @ketkarameya

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues · uber/piranha - GitHub
A tool for refactoring code related to feature flag APIs - Issues ... [PiranhaJava] Does not not clean up properly after removing feature...
Read more >
Piranha: Reducing Feature Flag Debt at Uber - Manu Sridharan
Therefore, even when flags are completely rolled out, they may not necessarily be stale. • Flag ownership: Since flags were not cleaned up...
Read more >
Introducing Piranha: An Open Source Tool to Automatically ...
Uber developed Piranha to seamlessly delete code related to obsolete feature flags, leading to improved developer productivity and a cleaner ...
Read more >
Cleaning Up Unused Flags - DevCycle Docs
Cleaning Up Unused Flags. Overview​. This article outlines practices to help minimize technical debt from feature flags.
Read more >
How to Manage Outdated Feature Flags - Optimizely
Not cleaning up feature flags can introduce risk to your code base. Learn how Feature Flag Removal Day can lead to better feature...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found