Skip to content

Commit

Permalink
Replace dots in review app subdomains
Browse files Browse the repository at this point in the history
While dots are valid, they don't work with our SSL certificate. I've already
adapted the hats CI workflow to expect this change.
  • Loading branch information
sulami committed Aug 26, 2024
1 parent c4422c9 commit 4586c69
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/models/review_app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ def computed_environment
]
end

# replace underscores and downcase - not valid as subdomain
# replace dots & underscores and downcase - not valid as subdomain
def sanitized_subject
subject.downcase.gsub('_', '-')
subject.downcase.gsub(/[._]/, '-')
end
end
4 changes: 2 additions & 2 deletions spec/models/review_app_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
context 'when an invalid subject is passed' do
let(:review_app) {
group.review_apps.new(
subject: "subject_With_Caps_And_Underscores",
subject: "subject_With_Caps_And.Underscores",
image_name: "image",
image_tag: "tag",
retention: 12 * 3600,
Expand All @@ -57,7 +57,7 @@
expect{review_app.save!}.to_not raise_error
end

it "converts the underscores to hyphens" do
it "converts the dots and underscores to hyphens" do
expect(review_app.to_param).to eq('subject-with-caps-and-underscores')
expect(review_app.slug).to eq('review---subject-with-caps-and-underscores')
end
Expand Down

0 comments on commit 4586c69

Please sign in to comment.