Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Allow Knapsack Pro Fallback Mode for retried nodes for forked repositories #3637

Merged
merged 1 commit into from
Jun 2, 2023

Conversation

ArturT
Copy link
Contributor

@ArturT ArturT commented Jun 2, 2023

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.

Allow Knapsack Pro Fallback Mode for retried nodes for a forked repositories.
@ArturT ArturT changed the title Allow Knapsack Pro Fallback Mode for retried nodes for forked repositories Fix: Allow Knapsack Pro Fallback Mode for retried nodes for forked repositories Jun 2, 2023
Copy link
Collaborator

@dorner dorner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hope this works - thanks so much for your help!

@dorner dorner merged commit 8d9aa3f into rubyforgood:main Jun 2, 2023
@ArturT ArturT deleted the patch-1 branch June 2, 2023 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants