From 72b2b298a3e6f31001b1753d1bfdc44dae55f625 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 21 Mar 2026 16:54:10 +0000 Subject: [PATCH 1/3] Initial plan From a3afe554f8ef4924e8576a4b008133d04bfe02fa Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 21 Mar 2026 16:59:49 +0000 Subject: [PATCH 2/3] Add critique.work feature Co-authored-by: sebst <592313+sebst@users.noreply.github.com> Agent-Logs-Url: https://github.com/devcontainer-community/devcontainer-features/sessions/4c501d49-0ccb-464e-8c31-8cc0db8d2815 --- .github/workflows/test.yaml | 2 + src/critique.work/devcontainer-feature.json | 17 ++++++ src/critique.work/install.sh | 57 +++++++++++++++++++++ test/critique.work/test.sh | 19 +++++++ 4 files changed, 95 insertions(+) create mode 100644 src/critique.work/devcontainer-feature.json create mode 100755 src/critique.work/install.sh create mode 100644 test/critique.work/test.sh diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 9070303..47011ee 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -18,6 +18,7 @@ jobs: - atuin.sh - aws-cli - bat + - critique.work - biomejs.dev - btop - bun.sh @@ -82,6 +83,7 @@ jobs: - atuin.sh - bat - biomejs.dev + - critique.work - btop - bun.sh - charmbracelet-gum diff --git a/src/critique.work/devcontainer-feature.json b/src/critique.work/devcontainer-feature.json new file mode 100644 index 0000000..341caba --- /dev/null +++ b/src/critique.work/devcontainer-feature.json @@ -0,0 +1,17 @@ +{ + "name": "critique.work", + "id": "critique.work", + "version": "1.0.0", + "description": "Install \"critique\" binary", + "documentationURL": "https://github.com/devcontainer-community/devcontainer-features/tree/main/src/critique.work", + "options": { + "version": { + "type": "string", + "default": "latest", + "proposals": [ + "latest" + ], + "description": "Version of \"critique\" to install." + } + } +} diff --git a/src/critique.work/install.sh b/src/critique.work/install.sh new file mode 100755 index 0000000..9e54ade --- /dev/null +++ b/src/critique.work/install.sh @@ -0,0 +1,57 @@ +#!/bin/bash +set -o errexit +set -o pipefail +set -o noclobber +set -o nounset +set -o allexport +readonly binaryName='critique' +readonly binaryTargetFolder='/usr/local/bin' +apt_get_update() { + if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then + echo "Running apt-get update..." + apt-get update -y + fi +} +apt_get_checkinstall() { + if ! dpkg -s "$@" >/dev/null 2>&1; then + apt_get_update + DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends --no-install-suggests --option 'Debug::pkgProblemResolver=true' --option 'Debug::pkgAcquire::Worker=1' "$@" + fi +} +apt_get_cleanup() { + apt-get clean + rm -rf /var/lib/apt/lists/* +} +echo_banner() { + local text="$1" + echo -e "\e[1m\e[97m\e[41m$text\e[0m" +} +utils_check_version() { + local version=$1 + if ! [[ "${version:-}" =~ ^(latest|[0-9]+\.[0-9]+\.[0-9]+)$ ]]; then + printf >&2 '=== [ERROR] Option "version" (value: "%s") is not "latest" or valid semantic version format "X.Y.Z" !\n' \ + "$version" + exit 1 + fi +} +bun_ensure_installed() { + if ! command -v bun >/dev/null 2>&1; then + echo "Bun is not installed. Installing bun to /usr/local..." + apt_get_checkinstall unzip curl ca-certificates + BUN_INSTALL=/usr/local curl -fsSL https://bun.sh/install | bash + fi +} +install() { + utils_check_version "$VERSION" + bun_ensure_installed + if [ "$VERSION" == 'latest' ] || [ -z "$VERSION" ]; then + BUN_INSTALL=/usr/local bun install -g critique + else + BUN_INSTALL=/usr/local bun install -g "critique@${VERSION}" + fi + apt_get_cleanup +} +echo_banner "devcontainer.community" +echo "Installing $binaryName..." +install "$@" +echo "(*) Done!" diff --git a/test/critique.work/test.sh b/test/critique.work/test.sh new file mode 100644 index 0000000..c43190b --- /dev/null +++ b/test/critique.work/test.sh @@ -0,0 +1,19 @@ +#!/bin/bash + + +set -e + +# Optional: Import test library bundled with the devcontainer CLI +# See https://github.com/devcontainers/cli/blob/HEAD/docs/features/test.md#dev-container-features-test-lib +# Provides the 'check' and 'reportResults' commands. +source dev-container-features-test-lib + +# Feature-specific tests +# The 'check' command comes from the dev-container-features-test-lib. Syntax is... +# check