From 29ef373ade6c573fb13845850fa9e010ba0c4562 Mon Sep 17 00:00:00 2001 From: "David J. Malan" Date: Sat, 5 Oct 2024 20:38:28 -0400 Subject: [PATCH 01/14] added Sysadmins profile --- devcontainer.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/devcontainer.json b/devcontainer.json index 7bc7bf51..6e17952e 100644 --- a/devcontainer.json +++ b/devcontainer.json @@ -168,7 +168,11 @@ "terminal.integrated.defaultProfile.linux": "bash", "terminal.integrated.gpuAcceleration": "off", "terminal.integrated.profiles.linux": { - "JavaScript Debug Terminal": null + "JavaScript Debug Terminal": null, + "Sysadmins": { + "args": ["bash"], + "path": "sudo" + } }, "terminal.integrated.persistentSessionReviveProcess": "never", "terminal.integrated.sendKeybindingsToShell": true, From fbd6ef18508fb0c3011d3e284b10316edfb6dde8 Mon Sep 17 00:00:00 2001 From: "David J. Malan" Date: Sat, 5 Oct 2024 20:38:42 -0400 Subject: [PATCH 02/14] added placeholder helpers --- etc/profile.d/codespace.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/etc/profile.d/codespace.sh b/etc/profile.d/codespace.sh index 2e767fad..1a554459 100644 --- a/etc/profile.d/codespace.sh +++ b/etc/profile.d/codespace.sh @@ -82,4 +82,15 @@ if [ "$(whoami)" != "root" ]; then http-server() { command http-server "$@" | _hostname | _version | uniq } + + # Helpers + function _helped() { + : # TODO + } + function _helpful() { + : # TODO + } + function _helpless() { + : # TODO + } fi From 80d147e9e1186a6947d7d1d1c92897313de2cb5a Mon Sep 17 00:00:00 2001 From: "David J. Malan" Date: Mon, 7 Oct 2024 09:20:24 -0400 Subject: [PATCH 03/14] added alerts --- etc/profile.d/codespace.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/etc/profile.d/codespace.sh b/etc/profile.d/codespace.sh index 1a554459..6f3a0637 100644 --- a/etc/profile.d/codespace.sh +++ b/etc/profile.d/codespace.sh @@ -1,5 +1,8 @@ # If not root -if [ "$(whoami)" != "root" ]; then +if [ `id -u` -ne 0 ]; then + + # Library + . /opt/cs50/lib/cli # Check if running locally and set $RepositoryName if not already set if [[ "$CODESPACES" != "true" && -z "$RepositoryName" ]]; then @@ -85,12 +88,14 @@ if [ "$(whoami)" != "root" ]; then # Helpers function _helped() { - : # TODO + : # TODO: invoke command that hides help50 button } function _helpful() { - : # TODO + _alert "🦆 Click `help50` for help" # Temporary, to introduce new feature + : # TODO: invoke command that sends $1 to ddb50 as though from duck itself } function _helpless() { - : # TODO + _alert "🦆 Click `help50` for help" # Temporary, to introduce new feature + : # TODO: invoke command that sends $1 to ddb50 as though from student } fi From d4e586ce377f32e1c33084de4a0153f98af680a2 Mon Sep 17 00:00:00 2001 From: "David J. Malan" Date: Mon, 7 Oct 2024 09:23:52 -0400 Subject: [PATCH 04/14] fixed alert --- etc/profile.d/codespace.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/profile.d/codespace.sh b/etc/profile.d/codespace.sh index 6f3a0637..e7122938 100644 --- a/etc/profile.d/codespace.sh +++ b/etc/profile.d/codespace.sh @@ -91,11 +91,11 @@ if [ `id -u` -ne 0 ]; then : # TODO: invoke command that hides help50 button } function _helpful() { - _alert "🦆 Click `help50` for help" # Temporary, to introduce new feature + $ _alert "$(_ansi "🦆 Click \`help50\` for help")" # Temporary, to introduce new feature : # TODO: invoke command that sends $1 to ddb50 as though from duck itself } function _helpless() { - _alert "🦆 Click `help50` for help" # Temporary, to introduce new feature + $ _alert "$(_ansi "🦆 Click \`help50\` for help")" # Temporary, to introduce new feature : # TODO: invoke command that sends $1 to ddb50 as though from student } fi From 23ed866267d9937cf510dfa5a1a1846029b916b9 Mon Sep 17 00:00:00 2001 From: Rongxin Liu Date: Wed, 9 Oct 2024 09:26:08 +0100 Subject: [PATCH 05/14] use cs50/cli:canary-amd64 base image for branch testing --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index eb575d97..909694a3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -68,7 +68,7 @@ jobs: - name: Build (${{ github.ref_name}}) if: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/canary' }} run: | - export TAG=amd64 + export TAG=canary-amd64 export VCS_REF=$(git rev-parse HEAD) npm install -g @devcontainers/cli devcontainer build --workspace-folder . --config devcontainer.json --image-name cs50/codespace:${{ github.sha }} --image-name cs50/codespace:${{ github.ref_name }} From f13e2ac8e7ba0799891840aedecb28087501e05e Mon Sep 17 00:00:00 2001 From: Rongxin Liu Date: Wed, 9 Oct 2024 09:44:36 +0100 Subject: [PATCH 06/14] install help50.vsix --- Dockerfile | 7 +++++++ devcontainer.json | 1 + 2 files changed, 8 insertions(+) diff --git a/Dockerfile b/Dockerfile index b7bbc499..816f90f6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -98,6 +98,13 @@ RUN npm install --global @vscode/vsce yarn && \ mv design50-1.0.0.vsix /opt/cs50/extensions && \ cd /tmp && \ rm --force --recursive design50.vsix && \ + git clone https://github.com/cs50/help50.vsix.git && \ + cd help50.vsix && \ + npm install && \ + vsce package && \ + mv help50-1.0.0.vsix /opt/cs50/extensions && \ + cd /tmp && \ + rm --force --recursive help50.vsix && \ npm uninstall --global vsce yarn diff --git a/devcontainer.json b/devcontainer.json index 213f0f22..1d58982a 100644 --- a/devcontainer.json +++ b/devcontainer.json @@ -14,6 +14,7 @@ "/opt/cs50/extensions/cs50-0.0.1.vsix", "/opt/cs50/extensions/design50-1.0.0.vsix", "/opt/cs50/extensions/ddb50-2.0.0.vsix", + "/opt/cs50/extensions/help50-0.0.1.vsix", "/opt/cs50/extensions/phpliteadmin-0.0.1.vsix", "/opt/cs50/extensions/style50-0.0.1.vsix", "cs50.extension-uninstaller", From c8e78ac20f4b835b5821f54f3d0d0c585a017a1b Mon Sep 17 00:00:00 2001 From: Rongxin Liu Date: Wed, 9 Oct 2024 09:54:59 +0100 Subject: [PATCH 07/14] correct help50.vsix version number --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 816f90f6..0fe6e35f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -102,7 +102,7 @@ RUN npm install --global @vscode/vsce yarn && \ cd help50.vsix && \ npm install && \ vsce package && \ - mv help50-1.0.0.vsix /opt/cs50/extensions && \ + mv help50-0.0.1.vsix /opt/cs50/extensions && \ cd /tmp && \ rm --force --recursive help50.vsix && \ npm uninstall --global vsce yarn From f7569a80dacc6396ca87a31adb1e36e2cbf00a0a Mon Sep 17 00:00:00 2001 From: Rongxin Liu Date: Wed, 9 Oct 2024 11:58:00 +0100 Subject: [PATCH 08/14] rebuild image (extensions updates) From 763acc55f98ab5693c804bbe34881e7449c5859c Mon Sep 17 00:00:00 2001 From: Rongxin Liu Date: Wed, 9 Oct 2024 12:29:15 +0100 Subject: [PATCH 09/14] rebuild image (extensions updates) From 39b8aaba5d16ed69789c694aac91fd90b0a8fafa Mon Sep 17 00:00:00 2001 From: Rongxin Liu Date: Wed, 9 Oct 2024 13:07:34 +0100 Subject: [PATCH 10/14] rebuild image (extensions updates) From 9e8c19105fcd78b88ba11d18a24a6a0a45a6e740 Mon Sep 17 00:00:00 2001 From: Rongxin Liu Date: Wed, 9 Oct 2024 16:52:06 +0100 Subject: [PATCH 11/14] rebuild image (extensions updates) From 5c444d76acb28f4080a4464f173615d7107e4e16 Mon Sep 17 00:00:00 2001 From: Rongxin Liu Date: Wed, 9 Oct 2024 16:59:53 +0100 Subject: [PATCH 12/14] rebuild image (extensions updates) From ebaab0bec5a45628d2759b7f66fe1591b5d244bf Mon Sep 17 00:00:00 2001 From: Rongxin Liu Date: Wed, 9 Oct 2024 21:58:59 +0100 Subject: [PATCH 13/14] rebuild image (extensions updates) From e065bd526594311a9d935c2289cb14eec0ecc83b Mon Sep 17 00:00:00 2001 From: Rongxin Liu Date: Wed, 9 Oct 2024 23:59:53 +0100 Subject: [PATCH 14/14] rebuild image (extensions updates)