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

Uploaded Source

Built Distributions

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

Uploaded CPython 3.11 macOS 11.0+ ARM64

polyglot_piranha-0.3.21-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.21-cp38-cp38-manylinux_2_34_x86_64.whl (19.3 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.34+ x86-64

polyglot_piranha-0.3.21-cp38-cp38-macosx_10_16_x86_64.whl (3.3 MB view details)

Uploaded CPython 3.8 macOS 10.16+ x86-64

polyglot_piranha-0.3.21-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (6.7 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.21.tar.gz.

File metadata

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

File hashes

Hashes for polyglot_piranha-0.3.21.tar.gz
Algorithm Hash digest
SHA256 2b46ad57dea41fc65a2d79c73ae4ca03b9bf6acf43eed3d2c10a7ae579e6cef9
MD5 386dc4d9f7c7b728106967ade85ddf78
BLAKE2b-256 0b63c15443d6f004642ab83a19a24317daad4924266d77316e76dc4702c91890

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polyglot_piranha-0.3.21-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 84e5dcfc4d132075ad66197b903fddeaa58d1d759e14af0e0acade946f7435fe
MD5 a942b90ea9b1df07a5305ba899852670
BLAKE2b-256 330cbdc07e8a538a37c75bb6a2055bf7462921b0509dbe3f236602c020f6f289

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polyglot_piranha-0.3.21-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 19c819b54c2b9ea34bcdc5c84595439268001e45ba57a296e49d39d61171dd2e
MD5 51e2dbd9779c41faafd458251ab1431f
BLAKE2b-256 ca1a0756ef4a6eb29563876993b48a8a61879f8be82c00bbc44e1ef9303b2f3e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polyglot_piranha-0.3.21-cp38-cp38-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 8499a8521da112982cae4151e25b4decff13cddbcb62ee581671e7aad261e41d
MD5 481f5f906df9791eaaed4b625a25ad12
BLAKE2b-256 1db2b9abe5fd4d653932e10c53d12537aaa369a19d4a02741368117e990255b7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polyglot_piranha-0.3.21-cp38-cp38-macosx_10_16_x86_64.whl
Algorithm Hash digest
SHA256 69fe90bfa7a8cad05e32476e46e7d88fa37ebf8d982943d8c36261c964152289
MD5 72752137da9e15929a3aed575ceb27ac
BLAKE2b-256 f635f981ba7e55ae2d7e3e82b87cf9fe221294d92049e1ea3c9dd9dc6267a438

See more details on using hashes here.

File details

Details for the file polyglot_piranha-0.3.21-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.21-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 11b51b0ef305cf5617cf47dcd22ae551e2e0c171d364f00d86cfe87410de7ed3
MD5 897f260b387b39fbff06a62b777e11ee
BLAKE2b-256 3f10f6f72931036724aedd5ea0fc85673785c30b96db5784a5426bf3d6cc294c

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