Make the repository pages reviewable in development

62ca6b831dd3 · AtlantisPleb · · parent df44ff812e96

Make the repository pages reviewable in development

`/{owner}/{repo}` was a 404 on every development machine, for every
repository, because the forge is off in the base config -- `forge_data_dir`
defaults to `/var/lib/openagents/forge`, which a laptop cannot write. So the
repository surfaces could not be looked at locally at all. Dev now enables the
forge against a directory inside the checkout, which is ignored.

The commit and diff pages still need that storage populated, so they stay 404
locally until a repository is actually mirrored there; the repository page
itself renders.

Also drops a tautological assertion from the changelog tests. Comparing a list
of literals to `[]` is a comparison between distinct types, always false, and
it broke `mix precommit`, which is `--warnings-as-errors`.

Deploy story

What this commit did to the running system — joined from the forge receipt chain, the part a commit page elsewhere cannot show.

Not deployed through the forge lane

No push, promotion, build, or deploy receipt references this commit (receipts are scanned over a bounded recent window). Changes shipped by full node replacement carry their proof in the release gate receipt instead.

Changed files

  • modified .gitignore
  • modified config/dev.exs
  • modified test/openagents/changelog_test.exs

Diff

3 files changed, +12 -1

.gitignore modified +3

@@ -46,3 +46,6 @@ npm-debug.log

46 46
47 47
# Local environment variables
48 48
/.env
49
50
# Local development forge storage (config/dev.exs points at it).
51
/.local/
config/dev.exs modified +8

@@ -6,6 +6,14 @@ config :openagents, :runtime_environment, :development

6 6
# path, and a write that escapes the sandbox is a flaky suite.
7 7
config :openagents, :changelog_backfill_on_boot, true
8 8
9
# The forge, pointed at a writable directory inside the checkout. It is off in
10
# the base config because `forge_data_dir` defaults to `/var/lib`, which no
11
# development machine can write -- and with it off, every `/{owner}/{repo}`
12
# page is a 404 locally, so the repository surfaces cannot be reviewed at all.
13
config :openagents,
14
  forge_enabled: true,
15
  forge_data_dir: Path.expand("../.local/forge", __DIR__)
16
9 17
# Configure your database
10 18
config :openagents, OpenAgents.Repo,
11 19
  username: System.get_env("USER") || "christopherdavid",
test/openagents/changelog_test.exs modified +1 -1

@@ -258,7 +258,7 @@ defmodule OpenAgents.ChangelogTest do

258 258
      # They are anchored to the history that preceded this repository's
259 259
      # clean-room rewrite. Kept so they can be restored if that history is
260 260
      # ever grafted in; not seeded, because today they would be dead links.
261
      refute Backfill.pre_public_entries() == []
261
      refute Enum.empty?(Backfill.pre_public_entries())
262 262
263 263
      seeded = MapSet.new(Backfill.seeded_entries(), & &1.sha)
264 264

This page updates live while a promote is in flight · changelog