Fix: Allow Knapsack Pro Fallback Mode for retried nodes for forked repositories #3637
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes the bug with tests not running for forked repositories.
Allow Knapsack Pro Fallback Mode for retried Github Actions jobs for forked repositories.
Github Actions does not share secrets with forked repositories so you can't connect to Knapsack Pro API due to missing API token.
For a fork repositories we use a fake API endpoint and a fake API token to trigger the Fallback Mode in Knapsack Pro to run tests.
https://docs.knapsackpro.com/ruby/troubleshooting/#knapsack-pro-does-not-work-on-a-forked-repository
When you rerun workflow on Github Actions then knapsack_pro 4.1.0 does not allow running tests in Fallback Mode to prevent running a wrong set of tests for a retried node (this could happen when some nodes connected to API and others do not).
But in our case for forked repositories, we run fallback mode always for all parallel jobs so it's safe to run tests in Fallback Mode.
Let's override the Github Actions attempts count (retry jobs count) so that Knapsack Pro assumes you run tests for the first time and it allows running in Fallback Mode.
related
Changes introduced in the knapsack_pro gem 4.1.0 version.