Skip to content

Commit

Permalink
remove leading v from app version if present
Browse files Browse the repository at this point in the history
  • Loading branch information
Floppy committed Nov 25, 2024
1 parent 4fb6bf2 commit 1977b49
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/lib/usage_report.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def self.generate
Jbuilder.encode do |report|
report.id SiteSettings.anonymous_usage_id
report.version do |version|
version.app Rails.application.config.app_version
version.app Rails.application.config.app_version.gsub(/^v/,"")
version.sha Rails.application.config.git_sha
version.image ENV.fetch("DOCKER_TAG", nil)&.split(":")&.first
version.arch RUBY_PLATFORM
Expand Down
4 changes: 2 additions & 2 deletions spec/lib/usage_report_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
before do
allow(SiteSettings).to receive(:anonymous_usage_id).and_return("guid-goes-here")
allow(Rails.application.config).to receive_messages(
app_version: "test",
app_version: "v0.89.0",
git_sha: "deadbeef"
)
end
Expand All @@ -27,7 +27,7 @@
end

it "includes application version" do
expect(parsed["version"]["app"]).to eq "test"
expect(parsed["version"]["app"]).to eq "0.89.0"
end

it "includes image type" do
Expand Down

0 comments on commit 1977b49

Please sign in to comment.