Files
lmxopcua/scripts/queue/setup-labels.sh
Joseph Doherty 2d07d716dc Recover stashed driver-gaps work from pre-v2-mxgw-merge working tree
Captures uncommitted work that lived in the working tree on
v2-mxgw-integration but was orthogonal to the migration. Stashed
during the v2-mxgw merge to master (2026-04-30) and replanted here on
a feature branch off master so it's git-visible rather than living in
the stash list.

Two distinct buckets:

1. Tracked fixture/config refinements (10 files, ~36 lines):
   - scripts/e2e/test-opcuaclient.ps1
   - src/ZB.MOM.WW.OtOpcUa.Admin/appsettings.json
   - 5 docker-compose.yml under tests/.../IntegrationTests/Docker/
     (AbCip, Modbus, OpcUaClient, S7)
   - 4 fixture .cs files (AbServerFixture, ModbusSimulatorFixture,
     OpcPlcFixture, Snap7ServerFixture)

2. Untracked driver-gaps queue artifacts (~8000 lines):
   - docs/plans/{abcip,ablegacy,focas,opcuaclient,s7,twincat}-plan.md
     — per-driver gap plans
   - docs/featuregaps.md — cross-cutting analysis
   - docs/v2/focas-deployment.md, docs/v2/implementation/focas-simulator-plan.md
   - followup.md — auto/driver-gaps queue follow-ups
   - scripts/queue/ — PR-queue automation tooling (12 files including
     pr-manifest.yaml at 1473 lines)

This commit is a snapshot for recoverability — review and split into
focused PRs (or discard) before merging anywhere downstream.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 08:28:01 -04:00

59 lines
1.7 KiB
Bash

#!/usr/bin/env bash
# Idempotent: creates queue labels in Gitea and stores name→id map at .label-ids.json
set -euo pipefail
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
. "$HERE/lib.sh"
declare -A LABELS=(
["driver/abcip"]="0e8a16"
["driver/ablegacy"]="0e8a16"
["driver/focas"]="0e8a16"
["driver/opcuaclient"]="0e8a16"
["driver/s7"]="0e8a16"
["driver/twincat"]="0e8a16"
["phase/1"]="bfd4f2"
["phase/2"]="bfd4f2"
["phase/3"]="bfd4f2"
["phase/4"]="bfd4f2"
["phase/5"]="bfd4f2"
["phase/6"]="bfd4f2"
["queue/queued"]="d4c5f9"
["queue/in-progress"]="fbca04"
["queue/blocked"]="b60205"
["queue/failed"]="b60205"
["queue/done"]="2ea44f"
["auto-managed"]="cccccc"
["cross-driver"]="d93f0b"
)
# Pull existing labels
EXISTING=$(api_repo GET "labels?limit=200")
emit_map() {
python - <<PY
import json, sys
existing = json.loads('''$EXISTING''')
print(json.dumps({l['name']: l['id'] for l in existing}, indent=2))
PY
}
# Create any missing
for name in "${!LABELS[@]}"; do
color="${LABELS[$name]}"
exists=$(echo "$EXISTING" | python -c "import json,sys; ls=json.load(sys.stdin); print('yes' if any(l['name']=='$name' for l in ls) else 'no')")
if [ "$exists" = "no" ]; then
payload=$(python -c "import json; print(json.dumps({'name':'$name','color':'#$color','description':'queue management'}))")
api_repo POST labels "$payload" >/dev/null
echo "created label: $name"
fi
done
# Refresh and write the map file
api_repo GET "labels?limit=200" | python -c "
import json, sys
ls = json.load(sys.stdin)
m = {l['name']: l['id'] for l in ls}
open('$LABEL_MAP','w').write(json.dumps(m, indent=2))
print(f'wrote {len(m)} labels to $LABEL_MAP')
"