CircleCI-Public / CircleCI-Public/backstage-plugin

Cannot load build logs in browser

Open
#4 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
2
Forks
8
PR merge metrics
No merged PRs in 30d

Description

We've just added this plugin to our Backstage instance and are able to see our CircleCI jobs in Backstage but when clicking into a job the build logs fail to load.

What I believe is happening is that the request to get the build details succeeds because it goes through the backend proxy, but this request then returns a direct link to the build logs which looks something like this:

```
{
"index": 0,
"step": 99,
"allocation_id": "654cb1e089ac7d37121be7ed-0-build/ABCDEFGH",
"name": "Preparing environment variables",
"type": "test",
"start_time": "2023-11-09T10:18:13.022Z",
"truncated": false,
"parallel": true,
"bash_command": null,
"background": false,
"insignificant": false,
"has_output": true,
"continue": null,
"end_time": "2023-11-09T10:18:13.03Z",
"exit_code": null,
"run_time_millis": 8,
"output_url": "https://circleci.com/api/private/output/presigned/...",
"status": "success",
"failed": null,
"infrastructure_fail": null,
"timedout": null,
"canceled": null
}
```

This output_url is then fetched straight from the browser instead of going via the backend proxy. This then fails as the endpoint isn't CORS enabled.

![image](https://github.com/CircleCI-Public/backstage-plugin/assets/6924220/f08ee614-b5c6-4210-8595-7d2b03dba172)

This request should instead be proxied through the backend like the other API calls to avoid the CORS issue. Of course an alternative solution would be to enable CORS on that endpoint but I'm not sure if that is the best option.

Contributor guide

No contributing guide indexed for this repository

Research direction

No source file or test is named. Start by tracing the build-details response and the browser request that consumes its output_url, then locate the existing backend proxy path used by the other API calls. Done means build logs load in the Backstage UI without a browser CORS failure; add or update coverage if the project has tests for these requests.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.