Commit
Message
Changed Files (7)
-
modified .mise/plugins/abbaye/bin/install
diff --git a/.mise/plugins/abbaye/bin/install b/.mise/plugins/abbaye/bin/install index 38f8d72..306e206 100755 --- a/.mise/plugins/abbaye/bin/install +++ b/.mise/plugins/abbaye/bin/install @@ -1,10 +1,16 @@ #!/usr/bin/env bash # Downloads and installs a specific abbaye version. -# Called by mise as: install <tool> <version> <install_dir> +# Compatible with both asdf (positional args) and mise (env vars). set -euo pipefail -VERSION="$2" -INSTALL_DIR="$3" +VERSION="${ASDF_INSTALL_VERSION:-${2:-}}" +INSTALL_DIR="${ASDF_INSTALL_PATH:-${3:-}}" + +if [ -z "$VERSION" ] || [ -z "$INSTALL_DIR" ]; then + echo "Usage: install <tool> <version> <install_dir>" + echo "Or set ASDF_INSTALL_VERSION and ASDF_INSTALL_PATH env vars." + exit 1 +fi # Map current platform to the target-triple naming used in releases. ARCH=$(uname -m) -
modified CHANGELOG.md
diff --git a/CHANGELOG.md b/CHANGELOG.md index 3bedba3..2e98607 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## [unreleased] +### 🚀 Features + +- *(git_ui)* Raw file download and ref-based browse URLs + ### 🐛 Bug Fixes - Re-add aarch64 musl target -
modified mise.toml
diff --git a/mise.toml b/mise.toml index e55e432..1ee723f 100644 --- a/mise.toml +++ b/mise.toml @@ -126,6 +126,10 @@ run = [ "watchexec -w src -w abbaye.toml -w Cargo.lock -r 'mise run abbaye && python -m http.server 4000 --directory public'", ] +[tasks.test-mise-plugin] +description = "test the abbaye mise plugin in a Docker container" +run = ["bash scripts/test-mise-plugin.sh"] + [tasks.deploy-docs] description = "deploys documentation to https://vit.am/~ololduck/abbaye" depends = ["abbaye"] -
modified scripts/release.sh
diff --git a/scripts/release.sh b/scripts/release.sh index 88692e6..36d5fe8 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -79,6 +79,14 @@ git add CHANGELOG.md # this version is already released. We run hooks explicitly next. git commit --amend --no-edit -n +# ── Mise plugin test ──────────────────────────────────────────────────────── + +echo "=== Testing mise plugin ===" +LATEST=$(bash .mise/plugins/abbaye/bin/list-all | tail -1) +echo " Testing against latest published version: $LATEST" +bash scripts/test-mise-plugin.sh "$LATEST" alpine:latest +echo "=== Mise plugin OK ===" + # ── Pre-commit hooks ─────────────────────────────────────────────────────── echo "=== Running pre-commit hooks ===" -
added scripts/test-mise-plugin.sh
diff --git a/scripts/test-mise-plugin.sh b/scripts/test-mise-plugin.sh new file mode 100755 index 0000000..87a002e --- /dev/null +++ b/scripts/test-mise-plugin.sh @@ -0,0 +1,78 @@ +#!/usr/bin/env bash +# Integration test for the abbaye mise plugin. +# Spins up a Docker container, installs mise, registers the plugin, +# lists versions, installs a given version, and verifies the binary works. +# +# Usage: ./scripts/test-mise-plugin.sh [version] [base-image] +# version - abbaye version to install (default: 0.9.1) +# base-image - Docker image (default: alpine:latest) + +set -euo pipefail + +VERSION="${1:-0.9.1}" +BASE_IMAGE="${2:-alpine:latest}" + +REPO_DIR="$(cd "$(dirname "$0")/.." && pwd)" +PLUGIN_DIR="$REPO_DIR/.mise/plugins/abbaye" + +if [ ! -d "$PLUGIN_DIR/bin" ]; then + echo "ERROR: plugin directory not found at $PLUGIN_DIR" + exit 1 +fi + +echo "=== Testing abbaye mise plugin ===" +echo " Version: $VERSION" +echo " Base image: $BASE_IMAGE" +echo " Plugin dir: $PLUGIN_DIR" +echo "" + +CONTAINER_NAME="abbaye-mise-test-$$" + +cleanup() { + docker rm -f "$CONTAINER_NAME" >/dev/null 2>&1 || true +} +trap cleanup EXIT + +# Build a temporary image with the plugin baked in +docker build --quiet -t "$CONTAINER_NAME" -f- "$REPO_DIR" >/dev/null <<DOCKERFILE +FROM $BASE_IMAGE + +# Install dependencies +RUN case "$BASE_IMAGE" in \ + alpine*) \ + apk add --no-cache bash curl xz sudo ;;\ + debian*) \ + apt-get update -qq && apt-get install -y -qq curl xz-utils bash && rm -rf /var/lib/apt/lists/* ;;\ + fedora*) \ + dnf install -y curl xz bash sudo && dnf clean all ;;\ + *) \ + echo "Unknown base image: $BASE_IMAGE" && exit 1 ;;\ + esac + +# Install mise +RUN curl -fsSL https://mise.jdx.dev/install.sh | sh +ENV PATH="/root/.local/bin:/root/.local/share/mise/shims:\${PATH}" + +# Copy the abbaye plugin into mise's plugin directory +COPY .mise/plugins/abbaye /root/.local/share/mise/plugins/abbaye + +# Accept the mise activation +RUN echo "yes" | mise activate --yes 2>/dev/null || true + +# Test: list-all +RUN echo "=== list-all ===" && mise list-all abbaye + +# Test: install the requested version +RUN echo "=== install ===" && mise install abbaye@${VERSION} + +# Test: install dir has the binary +RUN test -x /root/.local/share/mise/installs/abbaye/${VERSION}/abbaye && echo "=== PASS: binary exists ===" + +# Test: binary runs with --version +RUN /root/.local/share/mise/installs/abbaye/${VERSION}/abbaye --version + +# Test: version matches +RUN /root/.local/share/mise/installs/abbaye/${VERSION}/abbaye --version | grep -qF "$VERSION" && echo "=== PASS: version matches ===" +DOCKERFILE + +echo "=== ALL TESTS PASSED ===" -
modified src/git_ui.rs
diff --git a/src/git_ui.rs b/src/git_ui.rs index 18ed739..e59da92 100644 --- a/src/git_ui.rs +++ b/src/git_ui.rs @@ -125,6 +125,7 @@ enum RefBadgeKind { struct RefBadge { label: String, kind: RefBadgeKind, + url: Option<String>, } /// One entry in the branch-switcher nav rendered on every log page. @@ -681,6 +682,7 @@ fn build_ref_labels( RefBadge { label: label.to_string(), kind: RefBadgeKind::Tag, + url: Some(format!("refs/{}/", label)), } } else if let Some(label) = name.strip_prefix("refs/heads/") { if !ref_is_included(label, include, exclude) { @@ -689,6 +691,7 @@ fn build_ref_labels( RefBadge { label: label.to_string(), kind: RefBadgeKind::Branch, + url: Some(format!("refs/{}/", label)), } } else { continue; -
modified src/templates/git_log.html.j2
diff --git a/src/templates/git_log.html.j2 b/src/templates/git_log.html.j2 index 1ace956..9efbfd5 100644 --- a/src/templates/git_log.html.j2 +++ b/src/templates/git_log.html.j2 @@ -40,7 +40,7 @@ {% for commit in commits %} <tr> <td class="commit-hash-cell"> - <a class="hash" href="commit/{{ commit.hash }}.html">{{ commit.hash_short }}</a>{% for badge in commit.ref_badges %}<a href="commit/{{ commit.hash }}.html" class="ref-badge ref-badge-{{ badge.kind }}">{{ badge.label }}</a>{% endfor %}{% if commit.ref_badges %}<a href="browse/{{ commit.hash }}/" class="ref-badge browse-link">browse</a>{% endif %} + <a class="hash" href="commit/{{ commit.hash }}.html">{{ commit.hash_short }}</a>{% for badge in commit.ref_badges %}<a href="{{ badge.url }}" class="ref-badge ref-badge-{{ badge.kind }}">{{ badge.label }}</a>{% endfor %}{% if commit.ref_badges %}<a href="browse/{{ commit.hash }}/" class="ref-badge browse-link">browse</a>{% endif %} </td> <td>{{ commit.subject }}</td> <td>{{ commit.author_name }}</td>