Fix status task and add sitemap lastmod - #427
Merged
Merged
Conversation
Repo was not properly started in --no-start context: status task and runtime version detection both failed to start the Repo process with database config, causing all queries to fail silently and fall back to version 0/1.
Router-discovered pages now use the beam file modification time of the actual LiveView module (extracted from route metadata) as an approximate lastmod date. Static and custom entries use the current date of sitemap generation. In dev mode, parent app modules may lack beam files (in-memory compilation), so lastmod gracefully falls back to nil.
Extract post update logic into update_post_from_form/3 to bring cyclomatic complexity from 13 to within the 12 limit.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
mix phoenix_kit.statusshowing V01 instead of actual migration version (V84)lastmodto sitemap router-discovered and static entries per Google recommendationsChanges
Fix phoenix_kit.status Repo startup
phoenix_kit.statustask runs with--no-start, but Repo was never properly startedstatus.ex: pass parent app config torepo.start_link/1instead of empty listpostgres.ex: rewriteensure_repo_started/1to actually start the Repo process with config from application env, not just check if module is loadedAdd sitemap lastmod
route.metadata.phoenix_live_viewand use its beam file modification time as approximate lastmodDate.utc_today()as lastmod (generation date)Test Plan
mix phoenix_kit.statusshows correct V84 on Decor3D (path dep)~D[2026-03-17]lastmod via MCP evalbeam_file_mtimereturns DateTime for compiled modulesmix format,mix credo --strict,mix dialyzerpass