Skip to content

Commit d1fe9e4

Browse files
authored
fixed LUCI BUILD log url for presubmit (#4977)
Fixed LUCI BUILD log url for presubmit Updated api path in docs and comments Fix: flutter/flutter#183345
1 parent 9b1fe08 commit d1fe9e4

14 files changed

Lines changed: 105 additions & 24 deletions

File tree

app_dart/lib/server.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ Server createServer({
176176
///
177177
/// Consolidates multiple [PresubmitGuard] records (one per stage) into a single response.
178178
///
179-
/// GET: /api/get-presubmit-guard
179+
/// GET: /api/public/get-presubmit-guard
180180
///
181181
/// Parameters:
182182
/// slug: (string in query) required. The repository owner/name (e.g., 'flutter/flutter').

app_dart/lib/src/request_handlers/get_presubmit_checks.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import '../service/firestore/unified_check_run.dart';
1313

1414
/// Returns all checks for a specific presubmit check run.
1515
///
16-
/// GET: /api/get-presubmit-checks
16+
/// GET: /api/public/get-presubmit-checks
1717
///
1818
/// Parameters:
1919
/// check_run_id: (int in query) mandatory. The GitHub Check Run ID.

app_dart/lib/src/request_handlers/get_presubmit_guard_summaries.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import '../service/firestore/unified_check_run.dart';
1616

1717
/// Request handler for retrieving all presubmit guards for a specific pull request.
1818
///
19-
/// GET: /api/get-presubmit-guard-summaries
19+
/// GET: /api/public/get-presubmit-guard-summaries
2020
///
2121
/// Parameters:
2222
/// repo: (string in query) required. The repository name (e.g., 'flutter').

conductor/archive/get_presubmit_check_20260205/spec.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
This track involves implementing a new API endpoint in the `app_dart` backend service to provide detailed information about a specific presubmit check. The dashboard will use this API to display the history and status of all checks for a given check run.
55

66
## Functional Requirements
7-
- **Endpoint:** `/api/get-presubmit-checks`
7+
- **Endpoint:** `/api/public/get-presubmit-checks`
88
- **Method:** GET
99
- **Parameters (Mandatory):**
1010
- `check_run_id`: The unique identifier for the GitHub Check Run.

conductor/archive/get_presubmit_guard_20260204/plan.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Implement the request handler and wire it into the `app_dart` server.
2121
- Consolidate records into the `GetPresubmitGuardResponse` format.
2222
- Handle cases with no matching records (e.g., return 404 or empty response).
2323
- [x] Task: Register Endpoint in Server [checkpoint: 8f78382]
24-
- [x] Add the new `/api/get-presubmit-guard` route to the `app_dart` server configuration (e.g., `app_dart/lib/src/server.dart` or equivalent).
24+
- [x] Add the new `/api/public/get-presubmit-guard` route to the `app_dart` server configuration (e.g., `app_dart/lib/src/server.dart` or equivalent).
2525
- [x] Task: Conductor - User Manual Verification 'Phase 2: API Endpoint Implementation' (Protocol in workflow.md)
2626

2727
## Phase 3: Verification & Documentation

conductor/archive/get_presubmit_guard_20260204/spec.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This track involves implementing a new backend API endpoint in the `app_dart` se
77
As a Flutter developer, I want to see the real-time status of my PR's presubmit checks on the Cocoon dashboard so that I can quickly identify and address failures without navigating through multiple GitHub or LUCI pages.
88

99
## Functional Requirements
10-
1. **New API Endpoint:** Create an authenticated GET endpoint in `app_dart` (e.g., `/api/get-presubmit-guard`).
10+
1. **New API Endpoint:** Create an authenticated GET endpoint in `app_dart` (e.g., `/api/public/get-presubmit-guard`).
1111
2. **Input Parameters:** The endpoint must accept a `slug` (e.g., `flutter/flutter`) and a `commit_sha` as query parameters.
1212
3. **Data Retrieval:**
1313
- Query Cloud Firestore for all `PresubmitGuard` records matching the provided slug and commit SHA.

conductor/archive/get_presubmit_guard_summaries_20260211/plan.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ This plan outlines the steps to refactor `GuardStatus` logic and implement the `
4040
- [x] Task: Conductor - User Manual Verification 'Rename Handler to GetPresubmitGuardSummaries' (Protocol in workflow.md)
4141

4242
## Phase 6: Update API URL
43-
- [x] Task: Update API URL in `app_dart/lib/server.dart` to `/api/get-presubmit-guard-summaries`.
43+
- [x] Task: Update API URL in `app_dart/lib/server.dart` to `/api/public/get-presubmit-guard-summaries`.
4444
- [x] Task: Update documentation in `GetPresubmitGuardSummaries` handler.
4545
- [x] Task: Verify all tests pass.
4646
- [x] Task: Conductor - User Manual Verification 'Update API URL' (Protocol in workflow.md)

conductor/archive/get_presubmit_guard_summaries_20260211/spec.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This track involves implementing a new request handler in the `app_dart` service
99
- Updated existing `GetPresubmitGuard` handler to use the centralized logic.
1010
- **RPC Model:**
1111
- Created `PresubmitGuardSummary` model in `packages/cocoon_common` to represent the aggregated status of guards for a single commit SHA.
12-
- **Endpoint:** Created a new GET endpoint: `/api/get-presubmit-guard-summaries`.
12+
- **Endpoint:** Created a new GET endpoint: `/api/public/get-presubmit-guard-summaries`.
1313
- **Input Parameters:**
1414
- `repo`: The GitHub repository name (required).
1515
- `pr`: The pull request number (required).
@@ -29,6 +29,6 @@ This track involves implementing a new request handler in the `app_dart` service
2929
- [x] `GetPresubmitGuard` refactored to use `GuardStatus.calculate`.
3030
- [x] `PresubmitGuardSummary` RPC model created and exported.
3131
- [x] `GetPresubmitGuardSummaries` handler implemented with grouping and aggregation logic.
32-
- [x] Endpoint registered at `/api/get-presubmit-guard-summaries`.
32+
- [x] Endpoint registered at `/api/public/get-presubmit-guard-summaries`.
3333
- [x] Unit tests cover all requirements and grouping logic.
3434
- [x] Code coverage > 95%.

conductor/archive/presubmit_view_20260209/plan.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
- [x] Write Tests: Create unit tests for the new models, ensuring correct JSON deserialization based on the Cocoon API structure. (3c968d9)
66
- [x] Implement: Reuse model classes from `cocoon_common`. (3c968d9)
77
- [x] Task: Integrate the new endpoints into `CocoonService`. (3c968d9)
8-
- [x] Write Tests: Mock the `/dashboard/api/get-presubmit-guard` and `/dashboard/api/get-presubmit-checks` endpoints and verify the service correctly fetches and parses the data. (3c968d9)
8+
- [x] Write Tests: Mock the `/dashboard/api/public/get-presubmit-guard` and `/dashboard/api/public/get-presubmit-checks` endpoints and verify the service correctly fetches and parses the data. (3c968d9)
99
- [x] Implement: Add `fetchPresubmitGuard` and `fetchPresubmitCheckDetails` methods to `CocoonService` and its implementations. (3c968d9)
1010
- [x] Task: Conductor - User Manual Verification 'Phase 1: Infrastructure & Data Model' (Protocol in workflow.md) (085b744)
1111

conductor/archive/presubmit_view_20260209/spec.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Implement a detailed monitoring view for a specific Pull Request (PR) in the Flu
99
- `?repo=<repo>&pr=<prNumber>`: **Mocked Route**. Displays placeholder data based on the provided layout.
1010
- **Data Integration (Checks Sidebar):**
1111
- For the functional `sha` route, the sidebar MUST be populated by calling the Cocoon API:
12-
`GET /api/get-presubmit-guard?slug=flutter/<repo>&sha=<commitSha>`
12+
`GET /api/public/get-presubmit-guard?slug=flutter/<repo>&sha=<commitSha>`
1313
- **API Response Handling:** The UI must parse the `PresubmitGuardResponse` and map it to the sidebar:
1414
- `stages`: Map each stage to a sidebar section (e.g., Engine, Framework).
1515
- `builds` (within stages): Map each build entry to an individual check item with its name and status.
@@ -23,7 +23,7 @@ Implement a detailed monitoring view for a specific Pull Request (PR) in the Flu
2323
- **Log Viewer Pane:**
2424
- Display the "Execution Log" for the selected check in the sidebar.
2525
- For the functional `sha` route, fetch the check details using the Cocoon API:
26-
`GET /api/get-presubmit-checks?check_run_id=<check_run_id>&build_name=<build_name>`
26+
`GET /api/public/get-presubmit-checks?check_run_id=<check_run_id>&build_name=<build_name>`
2727
- **Handling Multiple Attempts (Tabs):**
2828
- If the API returns multiple `PresubmitCheckResponse` objects for a build, display them as tabs in the log viewer (as shown in the layout).
2929
- **Tab Naming:** Use the `attemptNumber` prefixed with a hash as the tab label (e.g., `#1`, `#2`).
@@ -38,9 +38,9 @@ Implement a detailed monitoring view for a specific Pull Request (PR) in the Flu
3838
- **Accessibility:** Adhere to WCAG 2.1 Level AA standards for new UI components.
3939

4040
## Acceptance Criteria
41-
- [ ] Navigating to `?repo=flutter&sha=<sha>` correctly calls the `/api/get-presubmit-guard` endpoint and renders the sidebar.
41+
- [ ] Navigating to `?repo=flutter&sha=<sha>` correctly calls the `/api/public/get-presubmit-guard` endpoint and renders the sidebar.
4242
- [ ] Navigating to `?repo=flutter&pr=<pr>` displays the mocked dashboard layout.
43-
- [ ] Selecting a check in the sidebar correctly calls the `/api/get-presubmit-checks` endpoint (for functional SHA routes).
43+
- [ ] Selecting a check in the sidebar correctly calls the `/api/public/get-presubmit-checks` endpoint (for functional SHA routes).
4444
- [ ] Multiple attempts for a check are displayed as clickable tabs labeled by their attempt number.
4545
- [ ] The UI supports both Light and Dark modes.
4646

0 commit comments

Comments
 (0)