Skip to content

Commit

Permalink
Merge pull request #3235 from manyfold3d/usage-fix
Browse files Browse the repository at this point in the history
Usage tracking: remove leading v from app version
  • Loading branch information
Floppy authored Nov 25, 2024
2 parents a4d395e + 2602990 commit 72b338b
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 72b338b

Please sign in to comment.