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.18.tar.gz (153.5 kB view details)

Uploaded Source

Built Distributions

polyglot_piranha-0.3.18-cp311-cp311-macosx_11_0_arm64.whl (3.2 MB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

polyglot_piranha-0.3.18-cp39-cp39-manylinux_2_28_x86_64.whl (4.1 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.28+ x86-64

polyglot_piranha-0.3.18-cp38-cp38-manylinux_2_34_x86_64.whl (19.8 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.34+ x86-64

polyglot_piranha-0.3.18-cp38-cp38-macosx_10_16_x86_64.whl (3.2 MB view details)

Uploaded CPython 3.8 macOS 10.16+ x86-64

polyglot_piranha-0.3.18-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (6.6 MB view details)

Uploaded CPython 3.8 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for polyglot_piranha-0.3.18.tar.gz
Algorithm Hash digest
SHA256 aa6dec774314239cb98464abe79c5ebbef5868d084006941df686e220a73501e
MD5 f025beb11d612005366e386ae34f8391
BLAKE2b-256 1684c8c8db503d705e54f93669414d7c15c03165365723d0d1bce85c7d5176de

See more details on using hashes here.

File details

Details for the file polyglot_piranha-0.3.18-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for polyglot_piranha-0.3.18-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 613a0b60cc83061591d972a4d93261bdf7c5a7a1115318bd2a72fe6967833cba
MD5 ad224be8ac2f89dd66d91901dad5e8bb
BLAKE2b-256 399b4eadb0ab9a5a0bf692700e983070c19c2d4848ac10dd8c874dfcfab98cc6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polyglot_piranha-0.3.18-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a9a0d309d4712464eb64f916625ead0309837f41d6e761c271d7ed5a2fb55819
MD5 4041037466f6963c568258c4e7fab511
BLAKE2b-256 7c6c14703e1d99dfbae4b1289babbb12146e59e79786be285f05851d14881576

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polyglot_piranha-0.3.18-cp38-cp38-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 d9112369c44a060345f9ac5a83f2e6fdf2a0c15744bcb1e887f3dc86824fef03
MD5 9dd0f91059ca0ab3bba84d77409d91cd
BLAKE2b-256 e1fc141b7372a0f64aa9b7991db13c95a5659e4c6545e356fca9f25307f45485

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polyglot_piranha-0.3.18-cp38-cp38-macosx_10_16_x86_64.whl
Algorithm Hash digest
SHA256 7e4c76bd9323b1882470e3739eb9d3d48624763037ff39ac3fd34fb08f4e2fc4
MD5 b5b5c621c6a2a945c89f32c9287d62e0
BLAKE2b-256 087f5a937f16cd9e0e87305371926e40d66c903576979cc8c100560411c49df8

See more details on using hashes here.

File details

Details for the file polyglot_piranha-0.3.18-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for polyglot_piranha-0.3.18-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 e3db14a47c32d1509560d6aea0fe88963ec5f0ea5ba0411d49a129e8058a2fb3
MD5 204d7b38c35e5ac86c1a46fda4a0f2dc
BLAKE2b-256 d7ed6321ee0c01417b23eb15125594c2507bf5f50f8d9065fddb060b27670369

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