Merged
Conversation
Comment on lines
+77
to
87
| describe "/go/prospectus-en?2025" do | ||
| let(:res) { http_get("https://rubykaigi.org/go/prospectus-en?2025") } | ||
| it "redirects to 2025 prospectus" do | ||
| expect(res.code).to eq("302") | ||
| expect(res["location"]).to eq("https://storage.rubykaigi.org/2025/rubykaigi2025-sponsorship-prospectus-en.pdf") | ||
| end | ||
| end | ||
|
|
||
| describe "(https) /2024/" do | ||
| let(:res) { http_get("https://rubykaigi.org/2024/") } | ||
| it "should render the top page" do |
There was a problem hiding this comment.
Bug: The new /go/prospectus endpoint, handled by a CloudFront function, lacks any test coverage. The existing test suite doesn't exercise this production code.
Severity: MEDIUM
Suggested Fix
Add a dedicated test suite for the TypeScript CloudFront function. This could involve using a framework like Jest to unit test the handleProspectusRedirect() logic by mocking the CloudFront event object. This ensures the language detection and query string preservation are tested.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: spec/rubykaigi_org_spec.rb#L50-L87
Potential issue: The new `/go/prospectus` endpoint is implemented via a CloudFront
function (`viewreq.ts`) that performs language detection and redirects users. This
function is deployed to production but is completely untested. The existing Ruby test
suite does not and cannot invoke CloudFront functions, and no separate TypeScript tests
have been added. This creates a risk that bugs in the redirect logic, such as incorrect
handling of query parameters, could go undetected and impact production users.
Did we get this right? 👍 / 👎 to inform future reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.