Skip to content

Add support for CI build ID for Github Actions#116

Merged
ArturT merged 5 commits intomasterfrom
github-run-id
Jun 27, 2020
Merged

Add support for CI build ID for Github Actions#116
ArturT merged 5 commits intomasterfrom
github-run-id

Conversation

@ArturT
Copy link
Copy Markdown
Member

@ArturT ArturT commented Jun 27, 2020

what

This PR adds support for CI build ID for Github Actions.

why

  • Thanks to that you can run concurrent CI builds for the same commit & branch in Knapsack Pro Queue Mode.
  • Parallel jobs that started work after Queue was already consumed won't initialize a new Queue (thanks to that you won't accidentally run tests twice).

Context

List of env variables in Github Actions.

GITHUB_RUN_ID - A unique number for each run within a repository. This number does not change if you re-run the workflow run.

problem with GITHUB_RUN_ID - breaking change

When you retry parallel jobs in Github Actions then GITHUB_RUN_ID stays the same. Because of this in Knapsack Pro Queue Mode the Knapsack Pro API will assume the queue was already consumed for the CI build ID (GITHUB_RUN_ID) and no tests will run.

WARNING: This could accidentally make CI build green because no tests will run on retried CI build on Github Actions.

This is breaking change so we need to update the major release version after merge of this PR.

Migration path for Github Actions users - required

If you use Github Actions and Knapsack Pro Queue Mode then you must set in Github Actions environment variable: KNAPSACK_PRO_FIXED_QUEUE_SPLIT=true (more info). Thanks to that when you retry CI build then tests will run based on previously recorded tests. This solves problem mentioned in the previous section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant