Skip to content

Add test files/branch name encryption #23

Description

@ArturT

about the feature

Allow user to enable encryption of sensitive data like:

  • test file paths
  • branch names

why we need this feature?

Some of the customers requested encryption for Jest.

idea how to implement it

Let's keep it simple.

Here is some info about the existing encryption feature for Ruby which might be too complex. We could do it simpler for Knapsack Pro in JavaScript (feature should be implemented in @knapsack-pro/core npm package so other packages like @knapsack-pro/jest or @knapsack-pro/cypress could use it).

In knapsack_pro ruby gem there is an encryption feature but it is a bit overcomplicated. It allows encrypting separately test file paths and branch names. It does not allow decryption so that's a downside for the development and performance of some of the features like RSpec split by examples because there is no simple way to decrypt test files on CI without encrypting all test files first to get SHA2 key (SHA2 value is used to compare SHA2 values from API response to identify test file paths).

In case of @knapsack-pro/core library I would recommend:

  • use some JS library (TODO: research what library would be a good fit) that allows to encrypt and decrypt string based on a key. If env var likeKNAPSACK_PRO_ENCRYPTION_KEY has value then it could mean encryption is enabled and the key will be used to encrypt and decrypt string like test file path & branch names.
  • There are some branch names that are exceptions and they should not be encrypted because Knapsack Pro API uses them to better split tests in some edge cases situation. Here is list of branch names that should never be encrypted.

story

https://trello.com/c/f494kFmB

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions