Skip to content

Link queued Testing Farm runs to the Testing Farm API - #551

Open
thrix wants to merge 1 commit into
packit:mainfrom
thrix:tf-queued-api-link
Open

thrix wants to merge 1 commit into
packit:mainfrom
thrix:tf-queued-api-link

Conversation

@thrix

@thrix thrix commented Oct 22, 2026

Copy link
Copy Markdown

Packit gets the results URL of a Testing Farm run only after Testing Farm reports back. Until then, the run detail page and the runs table show the pipeline ID with no link.

This adds getTestingFarmResultsUrl(), which falls back to https://api.dev.testing-farm.io/v0.1/requests/<pipeline_id> when web_url is missing. The status label on the run detail page and the pipeline ID link in the runs table use it. A run without a pipeline ID (not submitted yet) gets no link.

web_url is now typed as string | null, since packit-service stores None until the results arrive.

The API URL matches the TESTING_FARM_API_URL default in packit-service. If a deployment submits to another Testing Farm instance, this constant needs to follow.

Fixes #527

Generated-by: Claude Code

Packit gets the results URL of a Testing Farm run only after Testing
Farm reports back. Until then, the run detail page and the runs table
show the pipeline ID with no link.

Add `getTestingFarmResultsUrl()`, which falls back to
`https://api.dev.testing-farm.io/v0.1/requests/<pipeline_id>` when
`web_url` is missing, so you can check the current state of the
request. The status label on the run detail page and the pipeline ID
link in the runs table use it. Mark `web_url` as nullable, since
packit-service stores `None` until the results arrive.

Fixes packit#527

Assisted-by: Claude Code
Signed-off-by: Miroslav Vadkerti <mvadkert@redhat.com>
@centosinfra-prod-github-app

Copy link
Copy Markdown

@betulependule betulependule left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally prefer this version over fullsend's #552.

It's overall more consistent, includes tests and has a guard for the possibillity of <pipeline_id> not being defined. This can happen when the Testing Farm job is new doesn't have an ID assigned just yet, and this PR makes sure to check that it is defined before adding a link constructed based on the value of the ID. If this check weren't present, it would add a broken link.

This implementation makes it so that when the status field is clicked (fedora-43-x86_64), it redirects to https://api.dev.testing-farm.io/v0.1/requests/<pipeline_id> when the job is still queued.

Image

I personally didn't find anything that looks broken. Perhaps it would make sense to also change pipeline_id: string; to pipeline_id: string | null; in frontend/src/apiDefinitions.ts, but that's a nitpick.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

Point testing-farm jobs in queued state to api reporting the state

3 participants