Skip to content

Commit 2075a93

Browse files
committed
feat: add UpdateCLI tracking for Codespaces dependencies
- Add updatecli manifest for yq, Docker, and GitHub CLI versions - Update dependabot.yml to reference UpdateCLI for Codespaces deps - Clarify port visibility is not blocking access in README - Document that private ports work for Codespace owners UpdateCLI will now automatically create PRs when new versions of devcontainer dependencies are available.
1 parent aad8386 commit 2075a93

File tree

3 files changed

+115
-13
lines changed

3 files changed

+115
-13
lines changed

.devcontainer/README.md

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,21 @@
22

33
This directory contains the GitHub Codespaces dev container configuration.
44

5-
## Port Visibility Issue
5+
## Port Visibility
66

7-
If port 8080 shows as **private** after creating a Codespace, you need to manually change it to **public**:
7+
Port 8080 may show as **private** in the PORTS panel, but this is usually not an issue - you can still access Jenkins using the forwarded URL.
88

9-
### Manual Steps:
9+
**Note:** The port visibility label in the UI can be misleading. Even when marked as "private", the Jenkins URL provided in the welcome message will work in your browser. Only change visibility to "public" if you need to share the URL with others.
10+
11+
### Manual Steps (if needed for sharing):
1012
1. Open the **PORTS** panel at the bottom of VS Code (next to TERMINAL)
1113
2. Find port **8080** in the list
1214
3. **Right-click** on port 8080
1315
4. Select **Port Visibility****Public**
14-
5. Refresh your browser and access Jenkins
15-
16-
### Why is this needed?
1716

18-
The `devcontainer.json` includes `"visibility": "public"` for port 8080, but GitHub Codespaces may not always apply this setting automatically, especially:
19-
- On the first Codespace creation
20-
- If there's an organization policy
21-
- If the port is forwarded before the container is fully started
17+
### Technical Details
2218

23-
The setup script attempts to set the port visibility automatically using the GitHub CLI, but if that fails, manual intervention is required.
19+
The `devcontainer.json` includes `"visibility": "public"` for port 8080, but GitHub Codespaces may not always apply this setting automatically. The setup script attempts to set visibility using the GitHub CLI, but this is optional since Codespaces authentication allows private port access.
2420

2521
## Files
2622

@@ -40,9 +36,10 @@ After starting a tutorial with `docker compose --profile <name> up -d`:
4036
## Troubleshooting
4137

4238
**Port 8080 refuses connection:**
43-
- Ensure port visibility is set to **public** (see steps above)
4439
- Verify Jenkins is running: `docker compose ps`
4540
- Check logs: `docker compose logs jenkins_controller`
41+
- Wait 1-2 minutes for Jenkins to fully start
42+
- Port visibility (private/public) should not affect access for the Codespace owner
4643

4744
**Welcome message not showing:**
4845
- Run: `source ~/.bashrc` in your terminal

.github/dependabot.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
version: 2
55
# Note: GitPod support is legacy (free tier sunset). Migrated to GitHub Codespaces.
66
# Codespaces uses devcontainer.json which Dependabot cannot monitor (not a Dockerfile).
7-
# Manual updates for mcr.microsoft.com/devcontainers/base:ubuntu-24.04 as needed.
7+
# Codespaces dependencies (yq, devcontainer features) are tracked by UpdateCLI.
8+
# See updatecli/updatecli.d/codespaces.yaml for automated updates.
89

910
# Enable version updates for GitHub Actions workflows
1011
updates:
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
---
2+
name: 'deps(codespaces): bump devcontainer dependencies'
3+
4+
scms:
5+
default:
6+
kind: github
7+
spec:
8+
user: "{{ .github.user }}"
9+
email: "{{ .github.email }}"
10+
owner: "{{ .github.owner }}"
11+
repository: "{{ .github.repository }}"
12+
token: "{{ requiredEnv .github.token }}"
13+
username: "{{ .github.username }}"
14+
branch: "{{ .github.branch }}"
15+
16+
sources:
17+
yq:
18+
name: Get latest yq release
19+
kind: githubrelease
20+
spec:
21+
owner: mikefarah
22+
repository: yq
23+
token: "{{ requiredEnv .github.token }}"
24+
typefilter:
25+
latest: true
26+
transformers:
27+
- trimprefix: "v"
28+
29+
docker-version:
30+
name: Get latest Docker stable version
31+
kind: githubrelease
32+
spec:
33+
owner: moby
34+
repository: moby
35+
token: "{{ requiredEnv .github.token }}"
36+
typefilter:
37+
latest: true
38+
transformers:
39+
- trimprefix: "v"
40+
- findsubmatch:
41+
pattern: '^(\d+\.\d+)\.\d+$'
42+
captureindex: 1
43+
44+
github-cli:
45+
name: Get latest GitHub CLI release
46+
kind: githubrelease
47+
spec:
48+
owner: cli
49+
repository: cli
50+
token: "{{ requiredEnv .github.token }}"
51+
typefilter:
52+
latest: true
53+
transformers:
54+
- trimprefix: "v"
55+
56+
conditions:
57+
dockerhub-image-exists:
58+
name: Check if Docker version is available in devcontainer feature
59+
kind: dockerimage
60+
spec:
61+
# The devcontainer feature uses standard docker versions
62+
image: docker
63+
tag: '{{ source "docker-version" }}'
64+
65+
targets:
66+
yq-setup-script:
67+
name: '[.devcontainer/setup.sh] Bump yq version'
68+
kind: file
69+
scmid: default
70+
sourceid: yq
71+
spec:
72+
file: .devcontainer/setup.sh
73+
matchpattern: '(YQ_VERSION="\$\{YQ_VERSION:-v)([^"]+)(".*)'
74+
replacepattern: '${1}{{ source "yq" }}${3}'
75+
76+
docker-feature-version:
77+
name: '[.devcontainer/devcontainer.json] Bump Docker version'
78+
kind: file
79+
scmid: default
80+
sourceid: docker-version
81+
spec:
82+
file: .devcontainer/devcontainer.json
83+
matchpattern: '("ghcr\.io/devcontainers/features/docker-in-docker:2":\s*\{\s*"version":\s*")([^"]+)(".*)'
84+
replacepattern: '${1}{{ source "docker-version" }}${3}'
85+
86+
github-cli-feature-version:
87+
name: '[.devcontainer/devcontainer.json] Bump GitHub CLI version'
88+
kind: file
89+
scmid: default
90+
sourceid: github-cli
91+
spec:
92+
file: .devcontainer/devcontainer.json
93+
matchpattern: '("ghcr\.io/devcontainers/features/github-cli:1":\s*\{\s*"version":\s*")([^"]+)(".*)'
94+
replacepattern: '${1}{{ source "github-cli" }}${3}'
95+
96+
actions:
97+
default:
98+
kind: github/pullrequest
99+
scmid: default
100+
title: 'chore(deps): update Codespaces dependencies'
101+
spec:
102+
labels:
103+
- dependencies
104+
- codespaces

0 commit comments

Comments
 (0)