Skip to content

ujust report: add --confirm <issue-number> flag to attach system fingerprint to an existing issue as a me-too #579

Description

@hanthor

Summary

Extend ujust report with a --confirm <issue-number> mode that lets a user say "I have this too" on an existing issue by posting a lightweight system fingerprint as a GitHub comment. Proposed in #536 (friction reduction epic), this issue specifies the implementation.

No new recipe needed — this is a mode of ujust report, keeping the surface area small.

Motivation

Currently there is no quick path from "I have this bug too" to actually attaching system context to an existing issue. The full ujust report flow (35–45 s OTel collection, gist creation, manual copy-paste) is far too heavy for a simple "me too." Users either don't bother or post low-value "+1" comments with no diagnostic value.

Proposed UX

$ ujust report --confirm 575

Collecting system fingerprint for issue #575...

┌─ What will be posted as a comment on issue #575 ──────────┐
│ **System fingerprint** (via ujust report --confirm)       │
│                                                           │
│ * Image: ghcr.io/projectbluefin/dakota:latest             │
│ * Version: 20260527                                       │
│ * Kernel: 7.0.7                                           │
│ * Arch: x86_64                                            │
│ * Failed units: flatpak-preinstall.service                │
│ * Anonymous device ID: a3f1c8b2 (truncated sha256)        │
└───────────────────────────────────────────────────────────┘

Post this comment to https://github.com/projectbluefin/dakota/issues/575? [y/N]
✅ Comment posted: https://github.com/projectbluefin/dakota/issues/575#issuecomment-...

Acceptance criteria

  • ujust report --confirm <issue-number> triggers the me-too path inside the existing report recipe
  • Collects only the lightweight fingerprint (no OTel, no gist): image ref, image version/digest, kernel version, arch, failed systemd units, anonymous device ID (same keyed sha256 truncation as the full report)
  • Shows the user the exact comment text before posting — no silent uploads
  • Requires gh auth and exits gracefully with a clear message if not authenticated, suggesting gh auth login
  • Validates that the issue number is a positive integer; prints usage on bad input
  • Posts the comment via gh issue comment <number> --repo projectbluefin/dakota --body "..."
  • Prints the direct URL to the posted comment on success
  • Works non-interactively when stdin is not a tty (for scripting / agent use)
  • With no arguments, ujust report continues to behave exactly as today

Implementation sketch

Parse --confirm at the top of the report recipe and branch early:

# At the top of the report recipe body:
CONFIRM_ISSUE=""
while [[ $# -gt 0 ]]; do
    case "$1" in
        --confirm) CONFIRM_ISSUE="$2"; shift 2 ;;
        *) shift ;;
    esac
done

if [[ -n "$CONFIRM_ISSUE" ]]; then
    if ! [[ "$CONFIRM_ISSUE" =~ ^[0-9]+$ ]]; then
        echo "Usage: ujust report --confirm <issue-number>"
        exit 1
    fi

    IMAGE_REF=$(grep '^IMAGE_REF=' /etc/os-release | cut -d= -f2- | tr -d '"')
    IMAGE_VERSION=$(grep '^IMAGE_VERSION=' /etc/os-release | cut -d= -f2- | tr -d '"')
    KERNEL=$(uname -r)
    ARCH=$(uname -m)
    FAILED=$(systemctl list-units --state=failed --no-legend --plain 2>/dev/null \
             | awk '{print $1}' | head -10 | paste -sd ',' || echo "none")
    if [[ -r /etc/machine-id ]]; then
        DEVICE_ID=$(printf 'ujust-report:%s' "$(cat /etc/machine-id)" | sha256sum | cut -c1-8)
    else
        DEVICE_ID="unknown"
    fi

    BODY="$(printf '**System fingerprint** (via `ujust report --confirm`)\n\n* Image: %s\n* Version: %s\n* Kernel: %s\n* Arch: %s\n* Failed units: %s\n* Anonymous device ID: %s (truncated sha256)' \
        "$IMAGE_REF" "$IMAGE_VERSION" "$KERNEL" "$ARCH" "${FAILED:-none}" "$DEVICE_ID")"

    echo ""
    echo "Will post to: https://github.com/projectbluefin/dakota/issues/$CONFIRM_ISSUE"
    echo ""
    echo "$BODY"
    echo ""

    if ! gh auth status --active &>/dev/null; then
        echo "gh is not authenticated. Run: gh auth login"
        exit 1
    fi

    if [[ -t 0 && -t 1 ]]; then
        gum confirm "Post this comment?" || exit 0
    fi

    gh issue comment "$CONFIRM_ISSUE" --repo projectbluefin/dakota --body "$BODY"
    exit 0
fi

# ... existing report flow continues unchanged below

Notes

  • Reuses the same DEVICE_ID derivation as the full report so fingerprints are correlatable across a me-too comment and a later full report
  • No network calls before the confirmation prompt
  • Depends on: gh, gum (already required by ujust report)
  • Parent tracking issue: ujust report: reduce friction for diagnostic donation #536

Dakota · issue pipeline

  ✓  triage     needs kind/ + area/ then /approve
  ·  discussing —
  ▶  queued     —
  ·  claimed    —
  ·  done       —

area: area/ujust   priority:
maintainer:
reporter: comment /claim to fix it yourself, or wait for a contributor

Metadata

Metadata

Assignees

Labels

3-clanker-queueWork admitted to the agent-maintained queue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions