Skip to main content

Polyglot Piranha is a library for performing structural find and replace with deep cleanup.

Project description

Piranha

Join the chat at https://gitter.im/uber/piranha

Feature flags are commonly used to enable gradual rollout or experiment with new features. In a few cases, even after the purpose of the flag is accomplished, the code pertaining to the feature flag is not removed. We refer to such flags as stale flags. The presence of code pertaining to stale flags can have the following drawbacks:

  • Unnecessary code clutter increases the overall complexity w.r.t maintenance resulting in reduced developer productivity
  • The flags can interfere with other experimental flags (e.g., due to nesting under a flag that is always false)
  • Presence of unused code in the source as well as the binary
  • Stale flags can also cause bugs

Piranha is a tool to automatically refactor code related to stale flags. At a higher level, the input to the tool is the name of the flag and the expected behavior, after specifying a list of APIs related to flags in a properties file. Piranha will use these inputs to automatically refactor the code according to the expected behavior.

This repository contains four independent versions of Piranha, one for each of the four supported languages: Java, JavaScript, Objective-C and Swift. It also contains a redesigned variant of Piranha (as of May 2022) that is a common refactoring tool to support multiple languages and feature flag APIs. If interested in this polyglot variant, goto Polyglot Piranha.

To use/build each version, look under the corresponding [lang]/ directory and follow instructions in the corresponding [lang]/README.md file. Make sure to cd into that directory to build any related code following the instructions in the README.

A few additional links on Piranha:

  • A technical report detailing our experiences with using Piranha at Uber.
  • A blogpost presenting more information on Piranha.
  • 6 minute video overview of Piranha.

Support

If you have any questions on how to use Piranha, please feel free to reach out to us on the gitter channel. For bugs and enhancement requests, open a GitHub issue.

Contributors

We'd love for you to contribute to Piranha! Please note that once you create a pull request, you will be asked to sign our Uber Contributor License Agreement.

We are also looking for contributions to extend Piranha to other languages (C++, C#, Kotlin).

License

Piranha is licensed under the Apache 2.0 license. See the LICENSE file for more information.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

polyglot_piranha-0.3.5.tar.gz (134.8 kB view details)

Uploaded Source

Built Distributions

polyglot_piranha-0.3.5-cp39-cp39-manylinux_2_28_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.28+ x86-64

polyglot_piranha-0.3.5-cp38-cp38-manylinux_2_34_x86_64.whl (17.5 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.34+ x86-64

polyglot_piranha-0.3.5-cp38-cp38-macosx_10_16_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.8 macOS 10.16+ x86-64

File details

Details for the file polyglot_piranha-0.3.5.tar.gz.

File metadata

  • Download URL: polyglot_piranha-0.3.5.tar.gz
  • Upload date:
  • Size: 134.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.16

File hashes

Hashes for polyglot_piranha-0.3.5.tar.gz
Algorithm Hash digest
SHA256 81cfd4b11a4f4ef5bd38d84c48995c9ff5133924ebef86534e8b8432d55c0597
MD5 48e41dec3037d9597a405dda3d7daba7
BLAKE2b-256 df4e6da715c4314adf9c3ab40e02eb576001bc02524973978b1a234a3398d959

See more details on using hashes here.

File details

Details for the file polyglot_piranha-0.3.5-cp39-cp39-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for polyglot_piranha-0.3.5-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7a0b2a67bf109dc4eb07af329e9030bb37deb31d649aee177c58d64df59a9742
MD5 14686730ecc90ab9e047718ab4b4eb07
BLAKE2b-256 fb59d6e68dcb724115407982611aadac506d909ea26db57ce3e14554d892df38

See more details on using hashes here.

File details

Details for the file polyglot_piranha-0.3.5-cp38-cp38-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for polyglot_piranha-0.3.5-cp38-cp38-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 e8407759c0512a5dd0bbc0ea6233ce3c166bc055db8b1a00c97e139c1fe02f6d
MD5 ba5d3e8cd9dd66fed57eb25772013b96
BLAKE2b-256 eccf6c65224a22679148647f368064092045b4ee1d394fc26086356af88d3fee

See more details on using hashes here.

File details

Details for the file polyglot_piranha-0.3.5-cp38-cp38-macosx_10_16_x86_64.whl.

File metadata

File hashes

Hashes for polyglot_piranha-0.3.5-cp38-cp38-macosx_10_16_x86_64.whl
Algorithm Hash digest
SHA256 112ce7c5443d71a9436c84a2d4c2b1aecbbdb96631b424d6040112f3eeaadfcb
MD5 9cea9fe25896adc084583694d72adc50
BLAKE2b-256 d62d0995d9e79cc28045f73bb79e2c64a0175c7ac5d856901815a74861f8e289

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page