Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make team tags use - instead of _ to be url compatible #296

Merged
merged 1 commit into from
Aug 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ rake plan

Then make changes to play around, do not commit changes and make sure to revert with a `rake kennel:update_datadog` after deleting everything.

To make changes via the UI, make a new free datadog account and use it's credentaisl instead.
To make changes via the UI, make a new free datadog account and use it's credentials instead.

Author
======
Expand Down
2 changes: 1 addition & 1 deletion lib/kennel/models/team.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Models
class Team < Base
settings :mention, :tags, :renotify_interval, :kennel_id
defaults(
tags: -> { ["team:#{kennel_id.sub(/^teams_/, "")}"] },
tags: -> { ["team:#{kennel_id.sub(/^teams_/, "").tr("_", "-")}"] },
renotify_interval: -> { 0 }
)
end
Expand Down
2 changes: 1 addition & 1 deletion test/kennel/models/dashboard_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def dashboard(extra = {})
template_variable_presets: nil,
widgets: [],
reflow_type: "auto",
tags: ["team:test_team"]
tags: ["team:test-team"]
}
end
let(:dashboard_with_requests) do
Expand Down
2 changes: 1 addition & 1 deletion test/kennel/models/monitor_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def monitor(options = {})
type: "query alert",
query: +"avg(last_5m) > 123.0",
message: "@slack-foo",
tags: ["team:test_team"],
tags: ["team:test-team"],
priority: nil,
options: {
timeout_h: 0,
Expand Down
2 changes: 1 addition & 1 deletion test/kennel/models/project_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def self.to_s

describe "#tags" do
it "uses team" do
TestProject.new.tags.must_equal ["team:test_team"]
TestProject.new.tags.must_equal ["team:test-team"]
end
end

Expand Down
2 changes: 1 addition & 1 deletion test/kennel/models/slo_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def slo(options = {})
description: nil,
thresholds: [],
monitor_ids: [],
tags: ["team:test_team"],
tags: ["team:test-team"],
type: "metric"
}
end
Expand Down
2 changes: 1 addition & 1 deletion test/kennel/models/synthetic_test_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def synthetic(options = {})
{
message: "hey",
tags: [
"team:test_team"
"team:test-team"
],
config: {},
type: "api",
Expand Down
4 changes: 2 additions & 2 deletions test/kennel/models/team_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

describe "#tags" do
it "is a nice searchable name" do
TestTeam.new.tags.must_equal ["team:test_team"]
TestTeam.new.tags.must_equal ["team:test-team"]
end

it "does not prefix teams with folder name if it is teams too" do
Teams::MyTeam.new.tags.must_equal ["team:my_team"]
Teams::MyTeam.new.tags.must_equal ["team:my-team"]
end
end

Expand Down
4 changes: 2 additions & 2 deletions test/kennel/syncer_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def tagged(api_resource, hash)

def monitor_api_response(pid, cid, extra = {})
tagged("monitor", {
tags: extra.delete(:tags) || ["team:test_team"],
tags: extra.delete(:tags) || ["team:test-team"],
message: "@slack-foo\n-- Managed by kennel #{pid}:#{cid} in test/test_helper.rb, do not modify manually",
options: {}
}.merge(extra))
Expand Down Expand Up @@ -378,7 +378,7 @@ def change(*args)
name: "x\u{1F512}",
type: "metric",
thresholds: [],
tags: ["team:test_team"],
tags: ["team:test-team"],
description: "x\n-- Managed by kennel a:b in test/test_helper.rb, do not modify manually"
})
end
Expand Down
Loading