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

ADM-1001 [docs]: fix the dc issues #1586

Merged
merged 2 commits into from
Aug 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ participant GitHubClient as GitHubClient
frontend -> backend: call POST /source/{sourceType}/organizations to get all organizations
backend -> GitHubClient: get all organizations for user
GitHubClient --> backend: return all organizations info
backend --> frontend: all organization names and avatars(thinking)
backend --> frontend: all organization names
frontend -> frontend: select organization
frontend -> backend: call POST /source/{sourceType}/repos to get all repos
backend -> GitHubClient: get all repos for organization
Expand All @@ -42,21 +42,21 @@ GitHubClient --> backend: return all branches
backend --> frontend: all branch names
frontend -> frontend: select branch
frontend -> backend: call POST /source/{sourceType}/crews to get all crews
loop until pull request not in time period
backend -> GitHubClient: get pull requests by base branch and desc
loop pull request in time period
backend -> GitHubClient: get pull requests by base branch and sort by desc
GitHubClient --> backend: return pull requests
backend -> backend: filter pull requests by time period
end
backend -> backend: get all crews
backend -> backend: aggregate crews with pull requests
backend --> frontend: return all crews

== Calculate PR lead time in the report page ==
frontend -> backend: call POST /reports/{report-id} to get lead time for changes
backend -> GitHubClient: get all pull requests by base branch
GitHubClient -> backend: return all pull requests
GitHubClient --> backend: return all pull requests
backend -> backend: filter pull requests by time period and crews
backend -> backend: calculate pr lead time
backend -> frontend: return pr lead time
backend --> frontend: return pr lead time
@enduml
```

Expand All @@ -67,7 +67,7 @@ backend -> frontend: return pr lead time
##### 1.1. API

```shell
POST /source/{sourceType}/organizations
POST /source-control/{sourceType}/organizations
```

##### 1.2. Request body
Expand All @@ -84,24 +84,22 @@ backend -> frontend: return pr lead time
|-------------|-------------------------|
| 200 | OK |
| 401 | Requires authentication |
| 403 | Forbidden |

##### 1.4. Response body

```json
[
{
"id": 1,
"name": "organization name"
}
]
{
"name": ["organization name"]
}
```

#### 2. Get all repositories

##### 2.1. API

```shell
POST /source/{sourceType}/repos
POST /source-control/{sourceType}/repos
```

##### 2.2. Request body
Expand All @@ -119,24 +117,22 @@ backend -> frontend: return pr lead time
|-------------|-------------------------|
| 200 | OK |
| 401 | Requires authentication |
| 403 | Forbidden |

##### 2.4. Response body

```json
[
{
"id": 1,
"name": "repo name"
}
]
{
"name": ["repo name"]
}
```

#### 3. Get all branches

##### 3.1. API

```shell
POST /source/{sourceType}/branches
POST /source-control/{sourceType}/branches
```

##### 3.2. Request body
Expand All @@ -155,24 +151,23 @@ backend -> frontend: return pr lead time
|-------------|-------------------------|
| 200 | OK |
| 401 | Requires authentication |
| 403 | Forbidden |


##### 3.4. Response body

```json
[
{
"id": 1,
"name": "branch name"
}
]
{
"name": ["branch name"]
}
```

#### 4. Get all crews

##### 4.1. API

```shell
POST /source/{sourceType}/crews
POST /source-control/{sourceType}/crews
```

##### 4.2. Request body
Expand All @@ -182,7 +177,7 @@ backend -> frontend: return pr lead time
"token": "GitHub token",
"organization": "organization name",
"repo": "repo name",
"branch": ["branch name"],
"branch": "branch name",
"startTime": "1717171200000",
"endTime": "1717171200000"
}
Expand All @@ -194,6 +189,7 @@ backend -> frontend: return pr lead time
|-------------|-------------------------|
| 200 | OK |
| 401 | Requires authentication |
| 403 | Forbidden |

##### 4.4. Response body

Expand All @@ -215,9 +211,9 @@ backend -> frontend: return pr lead time
"codebaseSetting": {
...
"pipelineCrews": ["zhou-yinyuan"], // new added
"codebaseList": [ // new added
"codebases": [ // new added
{
"branch": ["branch name"],
"branches": ["branch name"],
"repo": "repo name",
"organization": "organization name"
}
Expand Down
Loading