Skip to content

Commit

Permalink
added architecture diagram (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
beliaev-maksim authored Dec 17, 2024
1 parent 46eb32e commit d0380ae
Showing 1 changed file with 76 additions and 0 deletions.
76 changes: 76 additions & 0 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# General workflow

```mermaid
sequenceDiagram
actor User
participant repo as GitHub Repo
participant GH as GitHub Backend
participant App as Application
User->>repo: Creates/modifies <br>issue or comments
repo->>GH: Notifies backend
GH->>App: Sends Webhook
App->>App: Validates the webhook hash
App->>App: Validates webhook's trigger
App->>repo: Reads ".github/.jira_sync_config.yaml" file
App->>Jira: Searches for existing Jira issues
Jira->>App: Provides list of existing issues if any
App->>Jira: Creates/updates Jira issue
App->>repo: (Optional) Adds a comment on the Issue
App->>GH: Returns web response
```

# Issue created from template (with labels)

This diagram illustrates a corner case scenario when issue is created from GitHub issue template that contains Labels.
In this case GitHub sends two webhooks in parallel that causes issues in the asynchronous (stateless) service.

```mermaid
sequenceDiagram
actor User
participant repo as GitHub Repo
participant GH as GitHub Backend
participant App1 as Application (Unit 1)
participant App2 as Application (Unit 2)
User->>repo: Creates an issue with a label <br>applied directly from the template
repo->>GH: Notifies backend
par
GH->>App1: Sends Webhook (issue labeled)
GH->>App2: Sends Webhook (issue opened)
end
par
App1->>App1: Validates the webhook hash
App1->>App1: Validates webhook's trigger
App2->>App2: Validates the webhook hash
App2->>App2: Validates webhook's trigger
App1->>repo: Reads ".github/.jira_sync_config.yaml" file
App2->>repo: Reads ".github/.jira_sync_config.yaml" file
end
par
App1->>Jira: Searches for existing Jira issues
App2->>Jira: Searches for existing Jira issues
end
par
Jira->>App1: Returns None, as there is no Jira issue
Jira->>App2: Returns None, as there is no Jira issue
end
par
App1->>Jira: Creates/updates Jira issue
App2->>Jira: Creates/updates Jira issue
end
par
App1->>repo: (Optional) Adds a comment on the Issue
App2->>repo: (Optional) Adds a comment on the Issue
end
par
App1->>GH: Returns web response
App2->>GH: Returns web response
end
```

0 comments on commit d0380ae

Please sign in to comment.