Skip to content
Snippets Groups Projects
Verified Commit 87409e14 authored by Jordi Gómez's avatar Jordi Gómez
Browse files

docs: applying Martin's comments to be more accurate with the flow

parent 1424f058
No related branches found
No related tags found
1 merge request!223Draft: docs: adding mermaid sequence diagram displaying the current picture
Pipeline #71755 failed
...@@ -155,91 +155,74 @@ The `Volatile` column denotes whether the property is subject to change once ini ...@@ -155,91 +155,74 @@ The `Volatile` column denotes whether the property is subject to change once ini
## Current Picture ## Current Picture
### Main Flow
```mermaid ```mermaid
sequenceDiagram sequenceDiagram
participant Git as Git Providers (GitHub/GitLab) participant Git as Git Provider
participant ECA as Git ECA Rest API participant ECA as Git ECA Rest API
participant Cache as Cache Layer participant Cache as Cache Layer
participant DB as Database participant DB as Database
participant Projects as Eclipse Projects API
participant Users as Eclipse Accounts API
participant Bots as Eclipse Bots API
Git->>ECA: Send PR/Push event alt GitHub Webhook Event
activate ECA Git->>ECA: Send webhook event with commits
activate ECA
alt GitHub PR ECA->>Git: Set commit status to pending
ECA->>Git: Fetch PR details ECA->>Git: Fetch additional commit details
Git-->>ECA: PR data Git-->>ECA: Commit details
else GitLab Push else GitLab Pre-receive Hook
ECA->>Git: Fetch repository details Git->>ECA: Send commits for validation
Git-->>ECA: Repository data activate ECA
end end
ECA->>Git: Fetch all commit details ECA->>Cache: Bulk lookup of commit validation status
Git-->>ECA: Commits data activate Cache
Cache->>DB: Query for persisted validation results
DB-->>Cache: Return persisted data
Cache-->>ECA: Return validation status
deactivate Cache
loop For each commit in PR/Push loop For each non-cached or failed commit
ECA->>Cache: Check cached validation Note over ECA: See "Commit Validation Process" diagram
activate Cache
Cache->>DB: Query if not in cache
DB-->>Cache: Return data
Cache-->>ECA: Return validation status
deactivate Cache
par Eclipse Foundation API Checks
ECA->>Projects: Validate project status
Projects-->>ECA: Project validation
and
ECA->>Users: Check ECA status
Users-->>ECA: User agreements
and
ECA->>Bots: Verify bot accounts
Bots-->>ECA: Bot validation
end
end end
ECA->>DB: Store validation results alt GitHub Webhook Event
ECA->>Git: Update PR status with results
alt GitHub PR
ECA->>Git: Update PR status with combined results
ECA->>Git: Add review comments if needed ECA->>Git: Add review comments if needed
else GitLab Push else GitLab Pre-receive Hook
ECA->>Git: Update status for each commit alt Validation Failed
ECA-->>Git: Reject push with error details
else Validation Passed
ECA-->>Git: Allow push to proceed
end
end end
ECA-->>Git: Return validation result
deactivate ECA deactivate ECA
``` ```
The git-eca service acts as a central validation gateway for Git contributions to Eclipse Foundation projects. Here's how it works: ### Commit Validation Process
```mermaid
1. **Contribution Event**: sequenceDiagram
- A developer submits a PR (GitHub) or push (GitLab) participant ECA as Git ECA Rest API
- The Git provider sends a webhook event to git-eca participant DB as Database
participant Projects as Eclipse Projects API
2. **Initial Context Gathering**: participant Users as Eclipse Accounts API
- git-eca fetches complete details about the contribution context participant Bots as Eclipse Bots API
- For PRs: gets PR metadata
- For pushes: gets repository context
- Retrieves all commits involved in the change
3. **Per-Commit Processing**:
- For each commit in the contribution:
* Checks cached results to avoid duplicate processing
* Validates against Eclipse Foundation systems in parallel:
- Projects API: Verifies project status and repository ownership
- Accounts API: Validates contributor agreements (ECA)
- Bots API: Verifies automated contribution accounts
4. **Result Aggregation**: alt Not cached or needs revalidation
- Combines validation results from all commits ECA->>Projects: Check if is project-managed
- Updates status in the Git provider Projects-->>ECA: Project management status
- Adds explanatory comments if any validation fails
5. **Response**: par Account Validation
- Returns final validation status to Git provider ECA->>Users: Validate commit author ECA
- Contribution is either approved or blocked based on combined validation results Users-->>ECA: Author agreement status
and
ECA->>Users: Validate commit committer ECA
Users-->>ECA: Committer agreement status
and
ECA->>Bots: Check if bot account
Bots-->>ECA: Bot validation status
end
The service ensures all contributions comply with Eclipse Foundation policies while maintaining a smooth developer experience through clear feedback and efficient validation processing. ECA->>DB: Store validation results
\ No newline at end of file end
```
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment