Summary
When service container ports include a protocol suffix (e.g., 8080:80/tcp), the autocomplete for job.services.<id>.ports.* incorrectly includes the protocol suffix in the port key.
Current Behavior
Given a workflow with:
services:
redis:
image: redis
ports:
- 6379:6379
- 8080:80/tcp
Autocomplete for ${{ job.services.redis.ports.| }} shows:
Expected Behavior
Autocomplete should show:
This matches the runner's actual behavior - at runtime, job.services.redis.ports.80 returns the host port, not job.services.redis.ports.80/tcp.
Details
The port parsing logic in languageservice/src/context-providers/job.ts splits on : but doesn't strip the optional /tcp or /udp protocol suffix:
const portParts = item.toString().split(":");
const containerPort = portParts.length === 2 ? portParts[1] : portParts[0];
Suggested Fix
Strip the protocol suffix after extracting the container port:
const portParts = item.toString().split(":");
let containerPort = portParts.length === 2 ? portParts[1] : portParts[0];
containerPort = containerPort.split("/")[0]; // Strip protocol suffix
Summary
When service container ports include a protocol suffix (e.g.,
8080:80/tcp), the autocomplete forjob.services.<id>.ports.*incorrectly includes the protocol suffix in the port key.Current Behavior
Given a workflow with:
Autocomplete for
${{ job.services.redis.ports.| }}shows:637980/tcp❌Expected Behavior
Autocomplete should show:
637980✅This matches the runner's actual behavior - at runtime,
job.services.redis.ports.80returns the host port, notjob.services.redis.ports.80/tcp.Details
The port parsing logic in
languageservice/src/context-providers/job.tssplits on:but doesn't strip the optional/tcpor/udpprotocol suffix:Suggested Fix
Strip the protocol suffix after extracting the container port: