diff --git a/docs/statusreport-controller.md b/docs/statusreport-controller.md new file mode 100644 index 000000000..5fc7440e0 --- /dev/null +++ b/docs/statusreport-controller.md @@ -0,0 +1,66 @@ +

StatusReport Controller

+ +```mermaid +%%{init: {'theme':'forest'}}%% +flowchart TD + %% Defining the styles + classDef Amber fill:#FFDEAD; + + predicate((PREDICATE:
Snapshot has annotation
test.appstudio.openshift.io/status
changed)) + + %%%%%%%%%%%%%%%%%%%%%%% Drawing EnsureSnapshotTestStatusReported() function + + %% Node definitions + ensure(Process further if: Snapshot has label
pac.test.appstudio.openshift.io/git-provider:github
defined) + get_annotation_value(Get integration test status from annotation
test.appstudio.openshift.io/status
from Snapshot) + is_snapshot_from_PR_event{"Is the
Snapshot from
push request event?"} + collect_commit_info(Collect commit owner, repo and SHA from Snapshot) + + is_installation_defined{Is annotation
pac.test.appstudio.openshift.io/installation-id
defined?} + + create_appInstallation_token(Create github application installation token) + get_all_checkRuns_from_gh(Get all checkruns from github
according to
commit owner, repo and SHA) + create_checkRunAdapter(Create checkRun adapter according to
commit owner, repo, SHA
and integration test status) + does_checkRun_exist{Does checkRun exist
on github already?} + create_new_checkRun_on_gh(Create new checkrun on github) + is_checkRun_update_needed{Does existing checkRun
has older CompletedAt?} + update_existing_checkRun_on_gh(Update existing checkRun on github) + + set_oAuth_token(Get token from Snapshot and set oAuth token) + get_all_commitStatuses_from_gh(Get all commitStatuses from github
according to commit owner, repo and SHA) + create_commitStatusAdapter(Create commitStatusAdapter according to
commit owner, repo, SHA
and integration test status) + does_commitStatus_exist{Does commitStatus exist
on github already?} + create_new_commitStatus_on_gh(Create new commitStatus on github) + + continue_processing(Controller continues processing) + + %% Node connections + predicate ----> |"EnsureSnapshotTestStatusReported()"|ensure + ensure --> get_annotation_value + get_annotation_value --> is_snapshot_from_PR_event + is_snapshot_from_PR_event --Yes--> collect_commit_info + is_snapshot_from_PR_event --No--> continue_processing + collect_commit_info --> is_installation_defined + is_installation_defined --Yes--> create_appInstallation_token + is_installation_defined --No--> set_oAuth_token + + create_appInstallation_token --> get_all_checkRuns_from_gh + get_all_checkRuns_from_gh --> create_checkRunAdapter + create_checkRunAdapter --> does_checkRun_exist + does_checkRun_exist --Yes--> is_checkRun_update_needed + does_checkRun_exist --No--> create_new_checkRun_on_gh + create_new_checkRun_on_gh --> continue_processing + is_checkRun_update_needed --Yes--> update_existing_checkRun_on_gh + is_checkRun_update_needed --No--> continue_processing + update_existing_checkRun_on_gh --> continue_processing + + set_oAuth_token --> get_all_commitStatuses_from_gh + get_all_commitStatuses_from_gh --> create_commitStatusAdapter + create_commitStatusAdapter --> does_commitStatus_exist + does_commitStatus_exist --Yes--> continue_processing + does_commitStatus_exist --No--> create_new_commitStatus_on_gh + create_new_commitStatus_on_gh --> continue_processing + + %% Assigning styles to nodes + class predicate Amber; +``` \ No newline at end of file