test buildah spindle engine #1

open
opened by evan.jarrett.net targeting main from loom
Changed files
+71 -30
.tangled
pkg
appview
jetstream
+23
.tangled/workflows/loom-amd64.yml
···
+
when:
+
- event: ["push"]
+
branch: ["*"]
+
- event: ["pull_request"]
+
branch: ["main"]
+
+
engine: kubernetes
+
image: golang:1.24-bookworm
+
architecture: amd64
+
+
steps:
+
- name: Download and Generate
+
environment:
+
CGO_ENABLED: 1
+
command: |
+
go mod download
+
go generate ./...
+
+
- name: Run Tests
+
environment:
+
CGO_ENABLED: 1
+
command: |
+
go test -cover ./...
+23
.tangled/workflows/loom-arm64.yml
···
+
when:
+
- event: ["push"]
+
branch: ["*"]
+
- event: ["pull_request"]
+
branch: ["main"]
+
+
engine: kubernetes
+
image: golang:1.24-bookworm
+
architecture: arm64
+
+
steps:
+
- name: Download and Generate
+
environment:
+
CGO_ENABLED: 1
+
command: |
+
go mod download
+
go generate ./...
+
+
- name: Run Tests
+
environment:
+
CGO_ENABLED: 1
+
command: |
+
go test -cover ./...
+1 -1
.tangled/workflows/release-credential-helper.yml
···
# Triggers on version tags (v*) pushed to the repository.
when:
-
- event: ["push"]
+
- event: ["manual"]
tag: ["v*"]
engine: "nixery"
+23 -19
.tangled/workflows/release.yml
···
# Triggers on version tags and builds cross-platform binaries using buildah
when:
-
- event: ["manual"]
+
- event: ["push"]
tag: ["v*"]
-
engine: "nixery"
-
-
dependencies:
-
nixpkgs:
-
- buildah
-
- gnugrep # Required for tag detection
+
engine: "buildah"
environment:
IMAGE_REGISTRY: atcr.io
···
steps:
- name: Get tag for current commit
command: |
+
#test
# Fetch tags (shallow clone doesn't include them by default)
git fetch --tags
···
echo "Building version: $TAG"
echo "$TAG" > .version
-
- name: Setup build environment
+
- name: Setup registry credentials
command: |
-
if ! grep -q "^root:" /etc/passwd 2>/dev/null; then
-
echo "root:x:0:0:root:/root:/bin/sh" >> /etc/passwd
-
fi
-
-
- name: Login to registry
-
command: |
-
echo "${APP_PASSWORD}" | buildah login \
-
--storage-driver vfs \
-
-u "${IMAGE_USER}" \
-
--password-stdin \
-
${IMAGE_REGISTRY}
+
mkdir -p ~/.docker
+
cat > ~/.docker/config.json <<EOF
+
{
+
"auths": {
+
"${IMAGE_REGISTRY}": {
+
"auth": "$(echo -n "${IMAGE_USER}:${APP_PASSWORD}" | base64)"
+
}
+
}
+
}
+
EOF
+
chmod 600 ~/.docker/config.json
- name: Build and push AppView image
command: |
···
buildah push \
--storage-driver vfs \
+
${IMAGE_REGISTRY}/${IMAGE_USER}/atcr-appview:${TAG}
+
+
buildah push \
+
--storage-driver vfs \
${IMAGE_REGISTRY}/${IMAGE_USER}/atcr-appview:latest
- name: Build and push Hold image
···
--tag ${IMAGE_REGISTRY}/${IMAGE_USER}/atcr-hold:latest \
--file ./Dockerfile.hold \
.
+
+
buildah push \
+
--storage-driver vfs \
+
${IMAGE_REGISTRY}/${IMAGE_USER}/atcr-hold:${TAG}
buildah push \
--storage-driver vfs \
+1 -10
pkg/appview/jetstream/processor.go
···
// Detect manifest type
isManifestList := len(manifestRecord.Manifests) > 0
-
// Extract hold DID from manifest (with fallback for legacy manifests)
-
// New manifests use holdDid field (DID format)
-
// Old manifests use holdEndpoint field (URL format) - convert to DID
-
holdDID := manifestRecord.HoldDID
-
if holdDID == "" && manifestRecord.HoldEndpoint != "" {
-
// Legacy manifest - convert URL to DID
-
holdDID = atproto.ResolveHoldDIDFromURL(manifestRecord.HoldEndpoint)
-
}
-
// Prepare manifest for insertion (WITHOUT annotation fields)
manifest := &db.Manifest{
DID: did,
···
Digest: manifestRecord.Digest,
MediaType: manifestRecord.MediaType,
SchemaVersion: manifestRecord.SchemaVersion,
-
HoldEndpoint: holdDID,
+
HoldEndpoint: manifestRecord.HoldEndpoint,
CreatedAt: manifestRecord.CreatedAt,
// Annotations removed - stored separately in repository_annotations table
}