Versions: year.month.release (VERSION) plus build (commit); What's new from CHANGELOG.md

Shown on Admin -> About, in the software history, records package, procedures
and sam:doctor; release notes in the app under Help.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rickyandClaude Opus 5.5 committed 2026-11-11 21:03:31 -05:00
1 parent 98e943cf0a
commit 8c8e3b7374
16 files changed
+110 -19

No files matched your search

+1
View File
@@ -10,6 +10,7 @@ class AppRevision < ApplicationRecord
record = find_or_initialize_by(revision: revision)
record.first_seen_at ||= now
record.built_at ||= SystemInfo.new.built_at
record.version ||= SystemInfo.new.version
record.last_seen_at = now
record.save!
rescue ActiveRecord::ActiveRecordError => e
+2 -2
View File
@@ -3,7 +3,7 @@
class HelpGuide
DIR = Rails.root.join("docs/guide")
ORDER = %w[README getting-started profile aircraft flights squawks oil-and-fuel components logbook records
inspections ads documents major-records sharing administration].freeze
inspections ads documents major-records sharing administration changelog].freeze
OPTIONS = {
parse: { smart: true },
render: { hardbreaks: false, unsafe: false },
@@ -18,7 +18,7 @@ class HelpGuide
def self.find(slug)
return unless ORDER.include?(slug.to_s)
path = DIR.join("#{slug}.md")
path = slug.to_s == "changelog" ? Rails.root.join("CHANGELOG.md") : DIR.join("#{slug}.md")
return unless path.file?
markdown = path.read
Page.new(slug: slug.to_s, title: markdown[/\A# (.+)$/, 1] || slug.to_s.titleize, markdown: markdown)
+10 -1
View File
@@ -12,7 +12,16 @@ class SystemInfo
DATABASES = { "Main" => :primary, "Cache" => :cache, "Jobs" => :queue, "Cable" => :cable }.freeze
# Set by the Docker build (see Dockerfile); in development, read from git.
# The release version, YYYY.MM.N (the repository's VERSION file).
def version
@version ||= Rails.root.join("VERSION").then { _1.exist? ? _1.read.strip.presence : nil } || "unreleased"
end
# "2026.11.0 (build 87e3094)"
def version_label = "#{version} (build #{revision})"
# The build: the commit it was made from. Set by the Docker build (see
# Dockerfile); in development, read from git.
def revision
@revision ||= ENV["APP_REVISION"].presence ||
(Rails.root.join(".git").exist? && `git -C #{Rails.root} rev-parse --short HEAD 2>/dev/null`.strip.presence) ||
+1 -1
View File
@@ -38,7 +38,7 @@ class RecordsAudit
Item.new("certificates", "No active user is relying on an expired certificate", true, true,
expired.any? ? "Expired (can't sign until renewed): #{expired.map { "#{_1.user.display_name} #{_1.short_label}" }.join(', ')}" : "None expired"),
Item.new("versions", "Software versions since the last audit", true, true,
versions_since.map(&:revision).join(", ").presence || "No changes")
versions_since.map { [ _1.version, "build #{_1.revision}" ].compact.join(" ") }.join(", ").presence || "No changes")
]
end
+2 -2
View File
@@ -51,7 +51,7 @@ class RecordsPackage
check = IntegrityCheck.latest
<<~TXT
Maintenance records for #{@aircraft.tail_number} (#{[ @aircraft.make, @aircraft.model ].compact_blank.join(' ')}, S/N #{@aircraft.serial_number.presence || 'not recorded'})
Prepared #{@generated_at.utc.strftime('%Y-%m-%d %H:%M UTC')} by Simple Aircraft Manager (#{@source}), software version #{SystemInfo.new.revision}.
Prepared #{@generated_at.utc.strftime('%Y-%m-%d %H:%M UTC')} by Simple Aircraft Manager (#{@source}), software version #{SystemInfo.new.version_label}.
Electronic records since: #{@aircraft.electronic_records_since&.iso8601 || 'not stated'}. Earlier records are the paper logbooks#{' (scans marked "legacy record" are in the archive)' if @aircraft.documents.where(legacy_record: true).exists?}.
@@ -106,7 +106,7 @@ class RecordsPackage
# Simple Aircraft Manager on your own computer, to browse #{@aircraft.tail_number.downcase}.sam.zip.
# docker compose up -d then open http://localhost:3000, create an account,
# and import #{@aircraft.tail_number.downcase}.sam.zip (Fleet -> Import). Stop: docker compose down
# Prepared with software version #{SystemInfo.new.revision}.#{" Source: #{repository}" if repository}
# Prepared with software version #{SystemInfo.new.version_label}.#{" Source: #{repository}" if repository}
services:
web:
#{image ? "image: #{image}" : "build: . # no published image known: build from the source code"}
+1 -1
View File
@@ -16,7 +16,7 @@ class SystemDoctor
doctor = new
list = doctor.checks
lines = list.map { |c| "#{{ ok: ' ok ', warn: ' WARN', fail: ' FAIL' }[c.status]} #{c.name.ljust(22)} #{c.detail}" }
[ "Simple Aircraft Manager #{SystemInfo.new.revision} (#{Rails.env})", *lines ].join("\n").then { [ _1, list ] }
[ "Simple Aircraft Manager #{SystemInfo.new.version_label} (#{Rails.env})", *lines ].join("\n").then { [ _1, list ] }
end
private
+5 -5
View File
@@ -8,10 +8,10 @@
<div class="flex flex-wrap items-end justify-between gap-4">
<div>
<p class="text-xs uppercase tracking-wide text-slate-500">Version</p>
<p class="font-mono text-2xl font-semibold" data-revision>
<%= info.revision_url ? link_to(info.revision, info.revision_url, class: "link", target: "_blank", rel: "noopener", title: "This commit on GitHub") : info.revision %>
</p>
<% if info.repository_url %><p class="mt-1 text-sm"><%= link_to "Source code", info.repository_url, class: "link", target: "_blank", rel: "noopener" %></p><% end %>
<p class="font-mono text-2xl font-semibold" data-version><%= info.version %></p>
<p class="text-sm text-slate-600" data-revision>Build
<%= info.revision_url ? link_to(info.revision, info.revision_url, class: "link font-mono", target: "_blank", rel: "noopener", title: "This commit on GitHub") : tag.span(info.revision, class: "font-mono") %></p>
<p class="mt-1 flex flex-wrap gap-x-3 text-sm"><%= link_to "What's new", help_page_path("changelog"), class: "link" %><% if info.repository_url %><%= link_to "Source code", info.repository_url, class: "link", target: "_blank", rel: "noopener" %><% end %></p>
</div>
<dl class="grid grid-cols-2 gap-x-6 gap-y-1 text-sm sm:grid-cols-3">
<div><dt class="text-slate-500">Built</dt><dd class="font-medium"><%= info.built_at ? l(info.built_at.in_time_zone, format: :short) : "—" %></dd></div>
@@ -108,7 +108,7 @@
<div class="card-header"><h2 class="card-title">Software versions</h2></div>
<% revisions = AppRevision.latest_first.limit(20) %>
<% if revisions.any? %>
<%= render "pairs", pairs: revisions.map { |r| [ r.revision, "#{l(r.first_seen_at, format: :short)} – #{l(r.last_seen_at, format: :short)}" ] } %>
<%= render "pairs", pairs: revisions.map { |r| [ [ r.version, "build #{r.revision}" ].compact.join(" · "), "#{l(r.first_seen_at, format: :short)} – #{l(r.last_seen_at, format: :short)}" ] } %>
<% else %>
<%= empty_state "No versions recorded yet." %>
<% end %>
@@ -31,7 +31,7 @@
<h2 class="<%= h2 %>">3. System description</h2>
<ul class="<%= p_ %> list-disc pl-5">
<li><strong>Software:</strong> Simple Aircraft Manager, version <%= info.revision %> (Ruby <%= RUBY_VERSION %>, Rails <%= Rails.version %>, SQLite <%= SQLite3::SQLITE_VERSION %>).</li>
<li><strong>Software:</strong> Simple Aircraft Manager, version <%= info.version_label %> (Ruby <%= RUBY_VERSION %>, Rails <%= Rails.version %>, SQLite <%= SQLite3::SQLITE_VERSION %>).</li>
<li><strong>Hosting and network:</strong>
<% if policy.hosting_description.present? %><div class="mt-1"><%= markdown(policy.hosting_description) %></div><% else %>[describe the server, location and network]<% end %>
<p class="mt-1"><%= ProceduresTemplates.https? ? "Connections use HTTPS only: the system redirects plain HTTP and marks its cookies secure." : "The system is set not to enforce HTTPS itself (FORCE_SSL=false); how connections are protected is described above." %> <%= ProceduresTemplates.sign_in_sentence %></p></li>
@@ -78,7 +78,7 @@
<li><strong>Confidential information (3.2.3):</strong> records are visible only to the aircraft's users, and to share links an owner creates (scoped and optionally expiring).</li>
<li><strong>Data corruption (3.2.4):</strong> nightly, the history chains and every signature's seal and fingerprint are checked; administrators are emailed on any problem.</li>
<li><strong>Outages (3.2.5):</strong> entries are made on paper and signed in ink during an outage (section 13); the database is restored from the latest verified copy or the off-site backup.</li>
<li><strong>Software revision control (3.2.6):</strong> the software is updated by deploying a new version built from its source repository; each version and when it ran is recorded by the system. Before an update that changes how records are entered, displayed or accessed, the responsible person reviews it, and these procedures are revised if they're affected.</li>
<li><strong>Software revision control (3.2.6):</strong> the software is updated by deploying a new release built from its source repository. Each release has a version (year.month.release, e.g. 2026.11.0) and a build (the exact source commit), with release notes describing what changed (What's new); each version and when it ran is recorded by the system. Before an update that changes how records are entered, displayed or accessed, the responsible person reviews it, and these procedures are revised if they're affected.</li>
<li><strong>Backups (3.2.7):</strong> see section 3.</li>
</ul>