Skip to content

Align authorization service with architecture documentation #4

Description

@rowan-stein

User Request

Align the authorization service with the architecture documentation in agynio/architecture (commit 4fbedf1): new-service.md, e2e-testing.md, ci-cd.md.

Specification

1. Dockerfile (4 gaps)

  • Add --platform=$BUILDPLATFORM on build stage: FROM --platform=$BUILDPLATFORM golang:1.24-alpine AS build
  • Switch from Debian (golang:1.24) to Alpine (golang:1.24-alpine)
  • Switch runtime from gcr.io/distroless/base-debian12 to alpine:3.21 (or current)
  • Move ARG TARGETOS TARGETARCH after COPY . ., add ENV CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH per template
  • Proto generation needs to happen in the Dockerfile (add buf stage like gateway/chat) since code imports from generated stubs

2. Workflows (7 gaps)

Delete docker-ghcr.yml — not in architecture spec (publishes edge/dev images on main push).

Rewrite release.yml:

  • Add docker/metadata-action@v5 for tags: sha-<short>, semver {{version}}, {{major}}.{{minor}}, {{major}}, latest (no pre-release)
  • Add GHA layer cache (cache-from: type=gha, cache-to: type=gha,mode=max)
  • Add manifest verification step with jq after image push
  • Add helm dependency build before lint
  • Remove redundant proto gen steps if Dockerfile handles it

ci.yml — already close to standard, just needs minor cleanup.

3. buf.gen.yaml / Proto (2 gaps)

  • Change output directory from gen/go to .gen/go
  • Update .gitignore from gen/ to .gen/
  • Update all Go import paths referencing gen/go to .gen/go
  • Consider removing manual M option overrides if proto go_package handles it
  • Keep using buf generate buf.build/agynio/api --path agynio/api/authorization/v1 (already correct)

4. Helm Chart (1 gap)

  • Add service-base dependency to Chart.yaml:
dependencies:
  - name: service-base
    version: ">=0.1.4 <1.0.0"
    repository: oci://ghcr.io/agynio/charts
  • Remove custom templates (deployment.yaml, hpa.yaml, service.yaml, serviceaccount.yaml, _helpers.tpl). Keep NOTES.txt.
  • Adjust values.yaml to use service-base value schema.

5. DevSpace (missing entirely)

Create devspace.yaml following the Go service template from e2e-testing.md:

  • deployments.e2e-runner with component-chart
  • dev.e2e-runner with sync
  • pipelines.test:e2e + dev
  • commands.test:e2e
  • Namespace: platform, E2E image: ghcr.io/agynio/devcontainer-go:1

6. E2E Tests (missing entirely)

Create test/e2e/ with:

  • main_test.go — setup, K8s DNS address defaults (authorization:50051)
  • authorization_test.go — basic gRPC connectivity/health test
  • //go:build e2e build tag on all files

7. README (missing entirely)

Create standard template from new-service.md.

8. Makefile

Delete Makefile.

Reference

Follow patterns from agynio/gateway and agynio/chat (already aligned), and agynio/notifications (PR #13, just merged).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions