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

Uploaded Source

Built Distributions

polyglot_piranha-0.3.13-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.13-cp38-cp38-manylinux_2_34_x86_64.whl (19.1 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.34+ x86-64

polyglot_piranha-0.3.13-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.13-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.13.tar.gz.

File metadata

  • Download URL: polyglot_piranha-0.3.13.tar.gz
  • Upload date:
  • Size: 145.8 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.13.tar.gz
Algorithm Hash digest
SHA256 56d1ba8d36c580f929627add35a5e61a5122c1a0e2fcf799609bb6e8c11ab4b3
MD5 2d6ffeacb3b3f49e117ee86a0d458bfe
BLAKE2b-256 dcdc2a86ca0e714ca9ac46d5dcb696373f208af4c985391ef4ad2692b41e3a0b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polyglot_piranha-0.3.13-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 783fb0ec998004caf0ffa1441eb141b8e7ce708ed936cb66c827acd480834245
MD5 9ea1a0d6b66ee6e6b8498e10792873ba
BLAKE2b-256 2b49f75610a77f371c657eb1fb4cd9642a0b90b865d526ef0d991abd4f724e51

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polyglot_piranha-0.3.13-cp38-cp38-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 c03dbe94e6639db590cba71e7a285a7c3d535c10167a025e72f3f674f1b3f261
MD5 50d8555cc7257ce0a827cf8362832b57
BLAKE2b-256 c8cf54e37579050d5146855e13eeb863c4d11db631b9ad2247a4df4b4814f66c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polyglot_piranha-0.3.13-cp38-cp38-macosx_10_16_x86_64.whl
Algorithm Hash digest
SHA256 1b7b49144780945202e4d47fd981a5f51bfa236c6ad4d069a5ed5045a3b34535
MD5 433ce8824eab0eb8e56c387b6d980ef0
BLAKE2b-256 44cd1eca53769746b24884f163da491b764459a2d725ac873970613089bb0103

See more details on using hashes here.

File details

Details for the file polyglot_piranha-0.3.13-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.13-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 0d219e5a5f62daa17ec11dbd5205bcac6643e58e934a5a103a154e8ce6ec10a6
MD5 e362ee42969cd48db85fd5a02e3f06d3
BLAKE2b-256 e9da4cdc7b9a9d1d623139d79f8938669c7a32cb4b3c8bd23cc281c4a11c8dd4

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