mirror of
https://github.com/we-promise/sure.git
synced 2026-05-07 21:04:12 +00:00
* Extract version to .sure-version file and add Sentry release tracking Move the hardcoded version string to a `.sure-version` file at the repo root so it can be read by both the Rails version initializer and other tooling. Configure `config.release` in the Sentry initializer to tag errors with the app version. https://claude.ai/code/session_01KfUgF42B3exoU2vpErqJyW * Use .sure-version as single source of truth in Helm CI workflows Update chart-ci, chart-release, and publish workflows to read the app version from .sure-version instead of regex-parsing version.rb. The pre-release bump job now writes directly to .sure-version and stages it for commit. https://claude.ai/code/session_01KfUgF42B3exoU2vpErqJyW * Guard empty .sure-version fallback * fix: sync Helm chart version with .sure-version * Moving on to `v0.7.1-alpha.*` with this * Defensive rescue * Getting fancy with versions now --------- Signed-off-by: Juan José Mata <juanjo.mata@gmail.com> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: SureBot <sure-bot@we-promise.com> Co-authored-by: sure-admin <sure-admin@splashblot.com>
26 lines
507 B
Ruby
26 lines
507 B
Ruby
module Sure
|
|
class << self
|
|
def version
|
|
Semver.new(semver)
|
|
end
|
|
|
|
def commit_sha
|
|
if Rails.env.production?
|
|
ENV["BUILD_COMMIT_SHA"]
|
|
else
|
|
`git rev-parse HEAD`.chomp
|
|
end
|
|
rescue Errno::ENOENT
|
|
nil
|
|
end
|
|
|
|
private
|
|
def semver
|
|
stripped_content = Rails.root.join(".sure-version").read.strip
|
|
stripped_content.presence || "n/a: #{commit_sha}"
|
|
rescue Errno::ENOENT
|
|
"n/a: #{commit_sha || 'unknown'}"
|
|
end
|
|
end
|
|
end
|