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

Uploaded Source

Built Distributions

polyglot_piranha-0.3.2-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.2-cp38-cp38-manylinux_2_34_x86_64.whl (16.6 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.34+ x86-64

polyglot_piranha-0.3.2-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (4.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.2.tar.gz.

File metadata

  • Download URL: polyglot_piranha-0.3.2.tar.gz
  • Upload date:
  • Size: 129.7 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.2.tar.gz
Algorithm Hash digest
SHA256 6354b899958b9b0f6eb727833301b1b0c08fb693da3f3d2589661882cc870810
MD5 bb1be7178571827c50a5a6c3a704ffde
BLAKE2b-256 a3af6ef068ac11a595f49ddc4a970517dccfa5fee279d3427085bda4e60af03c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polyglot_piranha-0.3.2-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c8652e21f710085be991847a70cfdbc72f9821553336749f6c0ad163b68957f8
MD5 4d0cf7060840e9f46cb0dae79ebd97e6
BLAKE2b-256 da6fa4567e9776b2f308ee22951c434713e796579123e1c8ba39b00d1d21886b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polyglot_piranha-0.3.2-cp38-cp38-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 16c9557f38399ad655943104904d2eddd6deb3c96e5a98fc04c2b4e8bd63cd05
MD5 638ea1a08204dcbb3d9fbe5c70a4c663
BLAKE2b-256 d704b8fe12c43e2852d85705256c1c4dbeb2cbd1f569d0ff0a56e1ce9eabd4c7

See more details on using hashes here.

File details

Details for the file polyglot_piranha-0.3.2-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.2-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 2341904d4190af0218c4856693e3deab94d0fdca9e67f7016e0ecb290779694d
MD5 201cd18131bf87f72eaf1d6f0b1c9f82
BLAKE2b-256 3ab581fcaa6a1fe5794ea3ec4654ba2370d9577c0c300eadc050b988361634a2

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