Skip to content

Commit

Permalink
Merge branch 'release/0.8.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
Flo0807 committed Nov 6, 2024
2 parents 429c8fb + cbe803a commit b6209d0
Show file tree
Hide file tree
Showing 16 changed files with 86 additions and 73 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4

- uses: erlef/setup-beam@5304e04ea2b355f03681464e683d92e3b2f18451 # v1
with:
otp-version: ${{ matrix.erlang }}
elixir-version: ${{ matrix.elixir }}

- name: Restore the deps and _build cache
uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4
id: restore-cache
env:
MIX_LOCK_HASH: ${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
Expand Down Expand Up @@ -91,7 +91,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4

- uses: erlef/setup-beam@5304e04ea2b355f03681464e683d92e3b2f18451 # v1
id: beam
Expand Down Expand Up @@ -129,7 +129,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4

- name: Setup beam
uses: erlef/setup-beam@5304e04ea2b355f03681464e683d92e3b2f18451 # v1
Expand All @@ -139,14 +139,14 @@ jobs:
version-type: strict

- name: Setup node
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
with:
node-version: 20
cache: 'yarn'
cache-dependency-path: demo/yarn.lock

- name: Restore the deps and _build cache
uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4
id: restore-cache
env:
OTP_VERSION: ${{ steps.beam.outputs.otp-version }}
Expand Down Expand Up @@ -232,7 +232,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3
Expand Down
2 changes: 1 addition & 1 deletion demo/.formatter.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
line_length: 120,
import_deps: [:ecto, :phoenix, :backpex, :ash, :ash_postgres],
plugins: [TailwindFormatter, Phoenix.LiveView.HTMLFormatter],
plugins: [Spark.Formatter, TailwindFormatter, Phoenix.LiveView.HTMLFormatter],
inputs: ["*.{heex,ex,exs}", "priv/*/seeds.exs", "{config,lib,test}/**/*.{heex,ex,exs}"],
subdirectories: ["priv/*/migrations"]
]
29 changes: 27 additions & 2 deletions demo/config/config.exs
Original file line number Diff line number Diff line change
@@ -1,8 +1,33 @@
import Config

config :spark,
formatter: [
remove_parens?: true,
"Ash.Resource": [
section_order: [
:postgres,
:resource,
:code_interface,
:actions,
:policies,
:pub_sub,
:preparations,
:changes,
:validations,
:multitenancy,
:attributes,
:relationships,
:calculations,
:aggregates,
:identities
]
],
"Ash.Domain": [section_order: [:resources, :policies, :authorization, :domain, :execution]]
]

config :demo,
namespace: Demo,
ecto_repos: [Demo.Repo, Demo.RepoAsh],
ecto_repos: [Demo.Repo],
ash_domains: [Demo.Helpdesk],
generators: [binary_id: true]

Expand Down Expand Up @@ -49,7 +74,7 @@ config :phoenix, :json_library, Jason

config :demo, DemoWeb.Gettext, default_locale: "en"

config :ash, include_embedded_source_by_default?: false
config :ash, include_embedded_source_by_default?: false, default_page_type: :keyset

config :ash, :policies, no_filter_static_forbidden_reads?: false

Expand Down
8 changes: 0 additions & 8 deletions demo/config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,6 @@ config :demo, Demo.Repo,
port: get_env("DB_PORT", "5432") |> to_integer(),
pool_size: get_env("DB_POOL_SIZE", "5") |> to_integer()

config :demo, Demo.RepoAsh,
hostname: get_env("DB_HOSTNAME", "postgres"),
username: get_env("DB_USERNAME", "postgres"),
password: get_env("DB_PASSWORD", "postgres"),
database: get_env("DB_DATABASE", "postgres"),
port: get_env("DB_PORT", "5432") |> to_integer(),
pool_size: get_env("DB_POOL_SIZE", "5") |> to_integer()

config :demo, DemoWeb.Endpoint,
http: [
port: get_env("PORT", "4000") |> to_integer()
Expand Down
1 change: 0 additions & 1 deletion demo/lib/demo/application.ex
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ defmodule Demo.Application do
{Cluster.Supervisor, [topologies, [name: Sourceboat.ClusterSupervisor]]},
{Phoenix.PubSub, name: Demo.PubSub},
Demo.Repo,
Demo.RepoAsh,
DemoWeb.Telemetry,
{DemoWeb.MetricsStorage, DemoWeb.Telemetry.metrics()},
DemoWeb.Endpoint
Expand Down
2 changes: 1 addition & 1 deletion demo/lib/demo/helpdesk/ticket.ex
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ defmodule Demo.Helpdesk.Ticket do
data_layer: AshPostgres.DataLayer

postgres do
repo Demo.RepoAsh
repo Demo.Repo
table "tickets"
end

Expand Down
13 changes: 6 additions & 7 deletions demo/lib/demo/repo.ex
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
defmodule Demo.Repo do
use Ecto.Repo,
otp_app: :demo,
adapter: Ecto.Adapters.Postgres
end

defmodule Demo.RepoAsh do
use AshPostgres.Repo, otp_app: :demo
use AshPostgres.Repo,
otp_app: :demo

def installed_extensions do
["ash-functions"]
end

def min_pg_version do
%Version{major: 16, minor: 0, patch: 0}
end
end
2 changes: 1 addition & 1 deletion demo/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ defmodule Demo.MixProject do
{:csv, "~> 3.2.0"},
{:jason, ">= 1.0.0"},
{:ash, "~> 3.0"},
{:ash_postgres, "~> 2.0.0"},
{:ash_postgres, "~> 2.4.0"},

# assets
{:esbuild, "~> 0.8", runtime: Mix.env() == :dev},
Expand Down
Loading

0 comments on commit b6209d0

Please sign in to comment.