Skip to main content

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.

Metadata

Release files for polyglot-piranha 0.3.11

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for polyglot-piranha 0.3.11
File Size Uploaded
polyglot_piranha-0.3.11.tar.gz 140.1 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for polyglot-piranha 0.3.11
File
polyglot_piranha-0.3.11-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details
polyglot_piranha-0.3.11-cp39-cp39-manylinux_2_28_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.28+ x86-64 Details
polyglot_piranha-0.3.11-cp38-cp38-manylinux_2_34_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.34+ x86-64 Details
polyglot_piranha-0.3.11-cp38-cp38-macosx_10_16_x86_64.whl CPython 3.8 CPython 3.8 macOS 10.16+ x86-64 Details
polyglot_piranha-0.3.11-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl CPython 3.8 CPython 3.8 macOS 10.9+ universal2 (ARM64, x86-64), macOS 10.9+ x86-64, macOS 11.0+ ARM64 Details

Total release size: 33.1 MB

Release files / polyglot_piranha-0.3.11.tar.gz

Download URL polyglot_piranha-0.3.11.tar.gz
Size 140.1 kB
Tags Source
SHA-256 checksum
How to use checksums
46cec5a44cbe253c73e9543bb6505f0635dc1345993355126a0e8eb2be720924
BLAKE2b-256 checksum
How to use checksums
c04422a7d95c0d094e71c7ce8109b956c404ec20511a748844805c9ef40f7db5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.17

Release files / polyglot_piranha-0.3.11-cp310-cp310-macosx_11_0_arm64.whl

Download URL polyglot_piranha-0.3.11-cp310-cp310-macosx_11_0_arm64.whl
Size 2.7 MB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
d0470261b6d794bed4f770129b60272eb870f438659fc2ef254b70af9d25ae64
BLAKE2b-256 checksum
How to use checksums
550a9a74f582a007f4ca7967501ceee6b2e085d31efd1fbb92636bef653503c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.11

Release files / polyglot_piranha-0.3.11-cp39-cp39-manylinux_2_28_x86_64.whl

Download URL polyglot_piranha-0.3.11-cp39-cp39-manylinux_2_28_x86_64.whl
Size 3.6 MB
Tags CPython 3.9 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
44dbaae9beac34ef621cbaed6da7923c22e54d383680853a2634ce0dc64dde5d
BLAKE2b-256 checksum
How to use checksums
d3b9fc56432999805d2cf25a572e337fcdfab24216c05106caf765a59df1d0b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.2

Release files / polyglot_piranha-0.3.11-cp38-cp38-manylinux_2_34_x86_64.whl

Download URL polyglot_piranha-0.3.11-cp38-cp38-manylinux_2_34_x86_64.whl
Size 18.9 MB
Tags CPython 3.8 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
2b53e34fe4037848c7a6637fbad694a2bc333c4cae7d7c94814a350a421e043f
BLAKE2b-256 checksum
How to use checksums
a9f2639ea3c60e928bc205e9da550bef7ee8176bf68aef189fded0b80c3d67a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.17

Release files / polyglot_piranha-0.3.11-cp38-cp38-macosx_10_16_x86_64.whl

Download URL polyglot_piranha-0.3.11-cp38-cp38-macosx_10_16_x86_64.whl
Size 2.6 MB
Tags CPython 3.8 macOS 10.16+ x86-64
SHA-256 checksum
How to use checksums
af12d07f5d7d7e9871b6f17de5dfb86de39d7919b1663a946b3a7fbec4981b1b
BLAKE2b-256 checksum
How to use checksums
1e4852a1e61df73c041f650265e445f9c7b1017663c5ee7203ff1f9eee9842df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.17

Release files / polyglot_piranha-0.3.11-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl

Download URL polyglot_piranha-0.3.11-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Size 5.3 MB
Tags CPython 3.8 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
8193ab19e722d17aead6c368cf7edacc67b36bb82b23c4ec68870ff250f88b40
BLAKE2b-256 checksum
How to use checksums
a3a3648f925b0eb7226cab3286d554686f0224af39fc5230c8d20cc4023e202d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.17

Release history Release notifications | RSS feed

0.4.4

13 release files

0.4.3

13 release files

0.4.2

13 release files

0.3.22

6 release files

0.3.20

6 release files

0.3.19

4 release files

0.3.18

6 release files

0.3.17

6 release files

0.3.14

6 release files

0.3.13

5 release files

0.3.12

6 release files

This release

0.3.11 This release

6 release files

0.3.10

6 release files

0.3.9

4 release files

0.3.8

5 release files

0.3.7

5 release files

0.3.5

4 release files

0.3.4

5 release files

0.3.3

4 release files

0.3.2

4 release files

0.3.1

5 release files

0.3.0

6 release files

0.2.1

2 release files

0.2.0

6 release files

0.1.2

5 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page