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

Uploaded Source

Built Distributions

polyglot_piranha-0.3.10-cp311-cp311-macosx_11_0_arm64.whl (2.5 MB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

polyglot_piranha-0.3.10-cp39-cp39-manylinux_2_28_x86_64.whl (3.5 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.28+ x86-64

polyglot_piranha-0.3.10-cp38-cp38-manylinux_2_34_x86_64.whl (17.8 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.34+ x86-64

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

Uploaded CPython 3.8 macOS 10.16+ x86-64

polyglot_piranha-0.3.10-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (5.0 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.10.tar.gz.

File metadata

  • Download URL: polyglot_piranha-0.3.10.tar.gz
  • Upload date:
  • Size: 138.0 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.10.tar.gz
Algorithm Hash digest
SHA256 af43d4d300b1beba8845169c7331539ed46f5b65fdc5ec3bb946a172a77df156
MD5 b67fe0ed2eb79eb15adcd350f977f90c
BLAKE2b-256 3e7adbb720afba29dadcd336396c4748377d7bfcd30eedbf74274a224000e7ec

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polyglot_piranha-0.3.10-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9e8e90de029e728640c83fa5e57865d3aed3ed7ae58b4b473553e8b1451f9724
MD5 28d335e4600628e7328bbcdeb513c353
BLAKE2b-256 89b22aecc62c30c429b0bd2bb2b96453a24e558b9a77d93c3c21c999fdfb8e46

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polyglot_piranha-0.3.10-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 22513e8bb0dbf4199166f7541e335af46500c4b64ba25aacb1faacc558c2baa0
MD5 f2509b3d71d3e7b68848e719b940fef1
BLAKE2b-256 72820fd4b54d27de5725cafb8062978a0630947fe9986241e58f6a8639ff83ee

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polyglot_piranha-0.3.10-cp38-cp38-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 e6bdbc6fc623014359d5b2693d56f061b44c95c4865b51dc5cfae4d5cd637408
MD5 84cec4f9e6b3e78e09e16bca4fe631f5
BLAKE2b-256 d0de32af9b23a1e6b3e40502270cb4a9f051d9540ab79a28d14be6e4535826c3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polyglot_piranha-0.3.10-cp38-cp38-macosx_10_16_x86_64.whl
Algorithm Hash digest
SHA256 ad4ad38fc310e9daab3141c0f0b119dc8b417ad6274d4676b8e7d28558b8152d
MD5 525bc465f4c889398443d518e720545f
BLAKE2b-256 8462d07adadce9703575c0c784327c09f8c65a253df403026c60a488bd650322

See more details on using hashes here.

File details

Details for the file polyglot_piranha-0.3.10-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.10-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 53d1d33c9fa6797787dd9d2702a52b07ad3b66bf88703e2a2132343e45321efa
MD5 30617e4a256e31a5ff0b51b9f5f8a968
BLAKE2b-256 8cc1cff2c8a2f67c4f7a09837bf310490858724328beb38c1909a4a93fe1aa03

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