KnapsackPro / knapsack-pro-js

Run your 1-hour test suite in 2 minutes with optimal parallelisation on your existing CI infrastructure
https://knapsackpro.com
MIT License
3 stars 0 forks source link

Add test files/branch name encryption #23

Open ArturT opened 3 years ago

ArturT commented 3 years ago

about the feature

Allow user to enable encryption of sensitive data like:

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:

story

https://trello.com/c/f494kFmB

ArturT commented 3 years ago

Here are some tips on how to implement this feature. It might be helpful if someone would like to help us develop this feature.

Here are a few tips on what places in code @knapsack-pro/core would need to have encryption and decryption added.

Encryption:

Decryption:

It's up to you if encrypt/decrypt function takes array or string. Feel free to figure out what would be a good enough way:

summary

If you would like to help us with this feature feel free to do it. I can answer any questions and help later one with the documentation, code review, and final testing and releasing new versions of all libraries like @knapsack-pro/core, @knapsack-pro/jest, @knapsack-pro/cypress.

Please add me rights to push to your PR code so I can help :)