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

Uploaded Source

Built Distributions

polyglot_piranha-0.3.4-cp311-cp311-macosx_11_0_arm64.whl (2.4 MB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

polyglot_piranha-0.3.4-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.4-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.4-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.4.tar.gz.

File metadata

  • Download URL: polyglot_piranha-0.3.4.tar.gz
  • Upload date:
  • Size: 134.5 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.4.tar.gz
Algorithm Hash digest
SHA256 caa949ff36daa708868e490bcfc82ceda4dbd3862883b6464e731f6abe7585c1
MD5 4f19bc98b01ecab9e545aadd146a4d0f
BLAKE2b-256 222ebb20ed2d4a130202ef189828dbaa5e6356d416afc1f9ed6ae64b3c6e4424

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polyglot_piranha-0.3.4-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a063f4a4cb6e338aebaffc9c0f5344b3a88404c8ede11bb2ec969dd9f04841e4
MD5 0f4f396f634b197bf9984862a3544f18
BLAKE2b-256 fb49ef2a56d291d982dcbf4c9500cff89002d5830a3ab5fd5f476db25af91d85

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polyglot_piranha-0.3.4-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9e82702dc12ff3e80eae22614750ebfe535f5ee6762e9367abf59937b5db5acc
MD5 6b559e0233d4806d20108fe6cbd50069
BLAKE2b-256 7b5d0bfcdbe5fd09bf6a3b8eca6588abfefe585238f6bf13027e40dcac13b2b4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polyglot_piranha-0.3.4-cp38-cp38-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 877f0ad62f976bccf02c13a56b3d1b4be638bc9bbe3451d82869e5786d216693
MD5 e711ba0920f64b97fad2fec2d0d4bd41
BLAKE2b-256 ef384a4f8f70a31141f659b47e6f438083011fb6fdb1fa7d39c843d7a40e5eb7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polyglot_piranha-0.3.4-cp38-cp38-macosx_10_16_x86_64.whl
Algorithm Hash digest
SHA256 6e5b89b6386fecdd247eb1c87cd9b2642e1894f0de5282355c8b1012786e7cb3
MD5 3287eaba5d2c7f927239b03666137727
BLAKE2b-256 3274d441ae163afe92538fca27ff0c8a66713f641fedd1908bd87be69e50dcd5

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