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

Uploaded Source

Built Distributions

polyglot_piranha-0.3.11-cp310-cp310-macosx_11_0_arm64.whl (2.7 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

polyglot_piranha-0.3.11-cp39-cp39-manylinux_2_28_x86_64.whl (3.6 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.28+ x86-64

polyglot_piranha-0.3.11-cp38-cp38-manylinux_2_34_x86_64.whl (18.9 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.34+ x86-64

polyglot_piranha-0.3.11-cp38-cp38-macosx_10_16_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.8 macOS 10.16+ x86-64

polyglot_piranha-0.3.11-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (5.3 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.11.tar.gz.

File metadata

  • Download URL: polyglot_piranha-0.3.11.tar.gz
  • Upload date:
  • Size: 140.1 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.11.tar.gz
Algorithm Hash digest
SHA256 46cec5a44cbe253c73e9543bb6505f0635dc1345993355126a0e8eb2be720924
MD5 606a0094e7d86f1b4ad550f4ab6aaab7
BLAKE2b-256 c04422a7d95c0d094e71c7ce8109b956c404ec20511a748844805c9ef40f7db5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polyglot_piranha-0.3.11-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d0470261b6d794bed4f770129b60272eb870f438659fc2ef254b70af9d25ae64
MD5 62959cfc55f19f2d336a46e3af9d962f
BLAKE2b-256 550a9a74f582a007f4ca7967501ceee6b2e085d31efd1fbb92636bef653503c3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polyglot_piranha-0.3.11-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 44dbaae9beac34ef621cbaed6da7923c22e54d383680853a2634ce0dc64dde5d
MD5 392ee9a20258c6443aec3040e6ced3de
BLAKE2b-256 d3b9fc56432999805d2cf25a572e337fcdfab24216c05106caf765a59df1d0b1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polyglot_piranha-0.3.11-cp38-cp38-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 2b53e34fe4037848c7a6637fbad694a2bc333c4cae7d7c94814a350a421e043f
MD5 ed98dcf3187a4796f4b5a66647c90e18
BLAKE2b-256 a9f2639ea3c60e928bc205e9da550bef7ee8176bf68aef189fded0b80c3d67a3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polyglot_piranha-0.3.11-cp38-cp38-macosx_10_16_x86_64.whl
Algorithm Hash digest
SHA256 af12d07f5d7d7e9871b6f17de5dfb86de39d7919b1663a946b3a7fbec4981b1b
MD5 5f4a36353cfc8713b1a9411b5a25051c
BLAKE2b-256 1e4852a1e61df73c041f650265e445f9c7b1017663c5ee7203ff1f9eee9842df

See more details on using hashes here.

File details

Details for the file polyglot_piranha-0.3.11-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.11-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 8193ab19e722d17aead6c368cf7edacc67b36bb82b23c4ec68870ff250f88b40
MD5 e712e251b0192ad50fbb3479c19d70d7
BLAKE2b-256 a3a3648f925b0eb7226cab3286d554686f0224af39fc5230c8d20cc4023e202d

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