[TT-17218] Add a default branch mechanism in test-controller#128
Conversation
|
This PR introduces a fallback mechanism to the Previously, if the configuration API returned a 404 error for a given branch, the workflow would fail. This change modifies the action to first attempt fetching the configuration for the exact branch. If a 404 error occurs, it now logs a warning and retries the request using a default branch ( Files Changed Analysis
Architecture & Impact Assessment
Flow Diagramgraph TD
A[Start test-controller action] --> B{Construct API URL with `BASE_REF`};
B --> C{Request test config from TUI API};
C --> D{Get HTTP Status Code};
D --> E{Code == 200?};
E -- Yes --> F[Use response as config];
F --> G[End];
E -- No --> H{Code == 404?};
H -- Yes --> I[Log Warning & Construct URL with `DEFAULT_BRANCH`];
I --> J{Retry request with fallback branch};
J --> K{Request successful?};
K -- Yes --> F;
K -- No --> L[Fail with error];
H -- No --> M[Log HTTP Code and Body];
M --> L;
L --> G;
Scope Discovery & Context ExpansionThe change is localized to the Metadata
Powered by Visor from Probelabs Last updated: 2026-05-18T10:54:38.708Z | Triggered by: pr_opened | Commit: 04dc437 💡 TIP: You can chat with Visor using |
Security Issues (3)
Security Issues (3)
Performance Issues (2)
Powered by Visor from Probelabs Last updated: 2026-05-18T10:54:34.727Z | Triggered by: pr_opened | Commit: 04dc437 💡 TIP: You can chat with Visor using |
When a pipeline is triggered on a branch not explicitly configured in the tui.yml file in gromit, the API returns 404, causing the step and whole pipeline to fail.
This change introduces a two-attempt fallback mechanism:
Fetch config for the exact base_ref — capturing the HTTP status without failing
On 404, emit a warning annotation and retry against default_branch (defaults to master)
On any other non-200, fail as before.
A new optional input default_branch is added so callers can override the fallback target per-workflow if needed.