Skip to content

feat: add Ash declarative data layer for GitHub resources#10

Merged
jordangarrison merged 16 commits intomainfrom
onboard-ash
Mar 4, 2026
Merged

feat: add Ash declarative data layer for GitHub resources#10
jordangarrison merged 16 commits intomainfrom
onboard-ash

Conversation

@jordangarrison
Copy link
Copy Markdown
Owner

@jordangarrison jordangarrison commented Mar 3, 2026

Summary

  • Add Ash Framework 3.19 as a declarative data layer, replacing hand-rolled Models module with 10 typed Ash resources (WorkflowRun, Job, Step, Repository, Pull, Branch, Release, User, UserPR, UserCommit)
  • Create Greenlight.GitHub Ash Domain with code interface functions (list_workflow_runs/2, list_jobs/3, list_pulls/2, etc.) providing a single entry point for all GitHub data access
  • Migrate all consumers (Poller, WorkflowGraph, UserInsightsServer, PipelineLive, DashboardLive, RepoLive) from direct Client calls to the Ash domain interface
  • Simplify Client to a pure HTTP transport layer returning raw API maps, with all data shaping handled by ManualRead action modules
  • Remove Models module — all struct definitions now live in Ash resources with proper type declarations

Architecture

LiveViews / GenServers
        ↓
  Greenlight.GitHub (Ash Domain)
        ↓
  ManualRead Actions (data shaping)
        ↓
  GitHub.Client (HTTP transport, raw maps)
        ↓
  GitHub REST API

Changes

Area Files What
Dependency mix.exs, mix.lock, config/config.exs Add {:ash, "~> 3.19"}, configure domain
Resources lib/greenlight/github/{step,job,workflow_run,repository,pull,branch,release,user,user_pr,user_commit}.ex 10 Ash resource definitions
Domain lib/greenlight/github/domain.ex Greenlight.GitHub Ash Domain with code interfaces
Actions lib/greenlight/github/actions/*.ex 11 ManualRead actions + parsing helpers
Migration poller.ex, workflow_graph.ex, user_insights_server.ex, *_live.ex Use domain instead of Client
Cleanup models.ex deleted, client.ex simplified Remove Models, Client returns raw maps
Nix nix/package.nix Updated dep hash for ash
Tests domain_test.exs added, models_test.exs removed, others updated 63 tests, 0 failures

Test plan

  • mix compile --warnings-as-errors passes
  • mix test — 63 tests, 0 failures
  • nix build .#default succeeds
  • nix build .#dockerImage succeeds
  • Manual: Dashboard loads user insights and org repos
  • Manual: Repo view shows pulls, branches, releases, commits
  • Manual: Pipeline DAG viewer loads and updates in real-time

@jordangarrison jordangarrison merged commit 8b9ae73 into main Mar 4, 2026
3 checks passed
@github-actions github-actions bot mentioned this pull request Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant