Skip to content

Commit ed436fa

Browse files
authored
Add graphical representation of backtracking-algorithm (#279)
1 parent 8d7e744 commit ed436fa

File tree

2 files changed

+133
-92
lines changed

2 files changed

+133
-92
lines changed

README.md

+41
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,47 @@ This option is implemented by `skip-duplicate-actions`.
363363
An advantage is that this works regardless of whether you are using PRs or raw feature-branches, and of course it also works for "required" checks.
364364
Internally, `skip-duplicate-actions` uses the [Repos Commit API](https://docs.github.com/en/rest/reference/repos#get-a-commit) to perform an efficient backtracking-algorithm for paths-skipping-detection.
365365

366+
This is how the algorithm works approximately:
367+
368+
```mermaid
369+
stateDiagram-v2
370+
Check_Commit: Check Commit
371+
[*] --> Check_Commit: Current commit
372+
373+
state Path_Ignored <<choice>>
374+
Check_Commit --> Path_Ignored: Do all changed files match against "paths_ignore"?
375+
Ignored_Yes: Yes
376+
Ignored_No: No
377+
Path_Ignored --> Ignored_Yes
378+
Path_Ignored --> Ignored_No
379+
380+
state Path_Skipped <<choice>>
381+
Ignored_No --> Path_Skipped: Do none of the changed files match against "paths"?
382+
Skipped_Yes: Yes
383+
Skipped_No: No
384+
Path_Skipped --> Skipped_Yes: No matches
385+
Path_Skipped --> Skipped_No: Some matches
386+
387+
Parent_Commit: Fetch Parent Commit
388+
Ignored_Yes --> Parent_Commit
389+
Skipped_Yes --> Parent_Commit
390+
391+
state Successful_Run <<choice>>
392+
Parent_Commit --> Successful_Run: Is there a successful run for this commit?
393+
Run_Yes: Yes
394+
Run_No: No
395+
Successful_Run --> Run_Yes
396+
Successful_Run --> Run_No
397+
398+
Run_No --> Check_Commit: Parent commit
399+
400+
Skip: Skip!
401+
Run_Yes --> Skip: (Because all changes since this run are in ignored or skipped paths)
402+
403+
Dont_Skip: Don't Skip!
404+
Skipped_No --> Dont_Skip: (Because changed files needs to be "tested")
405+
```
406+
366407
## Maintainers
367408

368409
- [@paescuj](https://github.com/paescuj)

package-lock.json

+92-92
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)