Skip to content

fix: strip leading slash from Docker container names#423

Merged
CybotTM merged 1 commit intomainfrom
fix/422-container-name-leading-slash
Dec 23, 2025
Merged

fix: strip leading slash from Docker container names#423
CybotTM merged 1 commit intomainfrom
fix/422-container-name-leading-slash

Conversation

@CybotTM
Copy link
Member

@CybotTM CybotTM commented Dec 23, 2025

Summary

  • Strip leading / from container names returned by Docker API
  • Fixes web UI job history returning 404 due to malformed URLs

Root Cause

Docker API returns container names with a leading slash (e.g., /my-container). When used in job names, this caused web UI history requests to fail:

Container name from API: /my-container
Job name: /my-container.job-name
History URL: /api/jobs//my-container.job-name/history  ← Double slash causes 404

Fix

In core/adapters/docker/convert.go, strip the leading slash when converting from Docker API container summary.

Test plan

  • Added regression tests that fail without the fix
  • Tests pass with fix applied
  • Full test suite passes
  • Linting passes

Fixes #422

Docker API returns container names with a leading slash (e.g., "/my-container").
When used in job names, this caused web UI history requests to fail with 404
because URLs like "/api/jobs//container.job-name/history" have a double slash.

Fixes #422
Copilot AI review requested due to automatic review settings December 23, 2025 12:58
@CybotTM CybotTM enabled auto-merge December 23, 2025 12:58
@github-actions
Copy link

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@github-actions
Copy link

⚠️ Mutation Testing Results

Mutation Score: 0.00% (threshold: 60%)

⚠️ Score is below threshold. Consider improving test coverage or test quality.

What is mutation testing?

Mutation testing measures test quality by introducing small changes (mutations) to the code and checking if tests detect them. A higher score means better test effectiveness.

  • Killed mutants: Tests caught the mutation (good!)
  • Survived mutants: Tests missed the mutation (needs improvement)

@CybotTM CybotTM added this pull request to the merge queue Dec 23, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a bug where Docker container names with leading slashes caused malformed URLs in the web UI, resulting in 404 errors when accessing job history. The fix strips the leading slash from container names returned by the Docker API's ContainerList endpoint.

Key Changes

  • Strip leading / from container names in convertFromAPIContainer function
  • Update tests to expect container names without leading slashes
  • Add comprehensive regression test comments referencing issue #422

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
core/adapters/docker/convert.go Added strings import and modified convertFromAPIContainer to strip leading slash from container names using strings.TrimPrefix
core/adapters/docker/convert_test.go Updated all test cases to expect container names without leading slashes and added clear regression test comments

Merged via the queue into main with commit 709c5b9 Dec 23, 2025
33 checks passed
@CybotTM CybotTM deleted the fix/422-container-name-leading-slash branch December 23, 2025 13:03
@CybotTM CybotTM added the released:v0.17.1 Released in v0.17.1 label Dec 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released:v0.17.1 Released in v0.17.1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

job history in web ui not working

2 participants