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

Uploaded Source

Built Distributions

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

Uploaded CPython 3.11 macOS 11.0+ ARM64

polyglot_piranha-0.3.22-cp39-cp39-manylinux_2_28_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.28+ x86-64

polyglot_piranha-0.3.22-cp38-cp38-manylinux_2_34_x86_64.whl (19.9 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.34+ x86-64

polyglot_piranha-0.3.22-cp38-cp38-macosx_10_16_x86_64.whl (4.0 MB view details)

Uploaded CPython 3.8 macOS 10.16+ x86-64

polyglot_piranha-0.3.22-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (8.2 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.22.tar.gz.

File metadata

  • Download URL: polyglot_piranha-0.3.22.tar.gz
  • Upload date:
  • Size: 154.4 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.22.tar.gz
Algorithm Hash digest
SHA256 9362213e1c99839f24bf7f8d69250e95227a4b77c95b90185d22917ec9e083df
MD5 32f72bbece3ba68371013ab29522811d
BLAKE2b-256 76cd69fe876d7e19b090258bd97bebf8f49251fe0af32a83b09ccee8c3161fa7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polyglot_piranha-0.3.22-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c4dd0344ebb3ba8424eaef48faa8d0a1bdaf743bfe5c98f7f20a2896b27c5f2d
MD5 f7d4cd00776fc20c9a9ee756aa48b1f5
BLAKE2b-256 2f657e9c2f007717b429a0b10919eefc1613950fcd7a5791bab87e8704ccbf05

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polyglot_piranha-0.3.22-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a1c2deff3aa5bb3c1b7c4c71fd5581ac12a3a2b70755ccf39e97dc4f85055d14
MD5 86ee641ba8bc10aa34c827b252a5f06c
BLAKE2b-256 4826b2869037b8d039e90eb5ca31f9c65c6867d36730b89a726ff290f545df30

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polyglot_piranha-0.3.22-cp38-cp38-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 0b7c56817f8e5cb7b2a9495adf35f44370f004f1e7bd9917e9060dfce560458d
MD5 6c2074e688aeb652db477a600f761e64
BLAKE2b-256 4dd9795796ce0ac567360505db397edfb58aef18c388fa29586b2c4ff2644957

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polyglot_piranha-0.3.22-cp38-cp38-macosx_10_16_x86_64.whl
Algorithm Hash digest
SHA256 4d181b9297b2b9b07b45349cb2422a8b537b1e399cc4ff5ffc3cb20cf78f1420
MD5 33887f598ce141159717d9473a94040b
BLAKE2b-256 e7913055b0ea90371e933f1593c98c7f01572c3dd95c0350ea5f4599359be080

See more details on using hashes here.

File details

Details for the file polyglot_piranha-0.3.22-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.22-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 5f0b2ec1d024247f73142c140b57eac3e61fb2893ede9c7f8522b384f21c8299
MD5 a0d0b3c0391fe24774d990445444d6c5
BLAKE2b-256 e8c81cdd8969909188e69b5b16eeb74cde67bbdc9cb0fe8fe41fa8f7c4be245e

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