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

Uploaded Source

Built Distributions

polyglot_piranha-0.3.0-cp310-cp310-macosx_11_0_arm64.whl (2.3 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

polyglot_piranha-0.3.0-cp39-cp39-manylinux_2_34_x86_64.whl (15.4 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.34+ x86-64

polyglot_piranha-0.3.0-cp39-cp39-manylinux_2_28_x86_64.whl (3.3 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.28+ x86-64

polyglot_piranha-0.3.0-cp39-cp39-macosx_10_7_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.9 macOS 10.7+ x86-64

polyglot_piranha-0.3.0-cp38-cp38-macosx_10_16_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.8 macOS 10.16+ x86-64

File details

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

File metadata

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

File hashes

Hashes for polyglot_piranha-0.3.0.tar.gz
Algorithm Hash digest
SHA256 a4aafb97ec6227b99d96111dba1d497ebd98b55d6ba69ef6515aa500baed72ba
MD5 8a86bfe3e50563f6adfd7f67f4abe815
BLAKE2b-256 8350d47057312f35ed053a47fdef20b3127284a7ebcf1fbda9fd7e7aa2a4b78d

See more details on using hashes here.

File details

Details for the file polyglot_piranha-0.3.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for polyglot_piranha-0.3.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2507fc5e480f3b1e61a9eed3d157e62b4427c4931eed57fdfeaf068b0ea2b58f
MD5 78c1263fac26a5cb1081c3f585f5b14d
BLAKE2b-256 957f9761569e69aff07729c7bbb63bf4dbc16871ab877ab6b5185103b088bf5e

See more details on using hashes here.

File details

Details for the file polyglot_piranha-0.3.0-cp39-cp39-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for polyglot_piranha-0.3.0-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 e0d00bdadcf900e38136ae3d678f484f53cac0dd6bef593dca3f66e512b9a796
MD5 22c82a0dadd465cbcca64801f3b3479d
BLAKE2b-256 b2aa089b054514404a9db9dcec904935b553e1b99a26d27b693a01f09abadfc0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polyglot_piranha-0.3.0-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 03229b229b1876850c87e9c12760b9b906a69d58a5c86879c2c73ee300e5e495
MD5 f9fee29fd3bd8794bbb57e36d83ba233
BLAKE2b-256 dc399879bc9602d77a108770f44bbea344931e3f6dea542b8e34d3fa95b6e203

See more details on using hashes here.

File details

Details for the file polyglot_piranha-0.3.0-cp39-cp39-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for polyglot_piranha-0.3.0-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 cecf5fa25e638bbd86cc4033371b8a5f947424ba8fb89ce8ea4f48efbb2debe4
MD5 e01dcf73e9857f2cfba8539c8647aa45
BLAKE2b-256 6f1b9ff4ee3bd32483fe851971e8d8edfa4ab4f0622ce7b1ad51b124a879c44b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polyglot_piranha-0.3.0-cp38-cp38-macosx_10_16_x86_64.whl
Algorithm Hash digest
SHA256 8a6cd0c67aeb7dec91c46376dd2bfbde4355dd92baab777ef817e508bd4b73c1
MD5 4961ed2173eaf7c6c87dd3e7df7322e8
BLAKE2b-256 7a8bd116bdafa3233e6dff41d758303e3bd30a9eeecfcf6c4d012cfafad12ec5

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