Skip to content

fix: mkStatus usage - #44

Merged
ayushjain17 merged 1 commit into
masterfrom
fix-generation
Mar 26, 2026
Merged

ayushjain17 merged 1 commit into
masterfrom
fix-generation

Conversation

@ayushjain17

@ayushjain17 ayushjain17 commented Mar 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Chores

    • Version updated from 0.0.7 to 0.0.8.
  • Refactor

    • Enhanced the Haskell client code generator for improved HTTP status code handling in response parser instances. Status code construction has been refined for better consistency and maintainability across all generated client models, including error and success responses.

@coderabbitai

coderabbitai Bot commented Mar 26, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 312a8322-824e-47a0-8c28-7bc67eb2dd73

📥 Commits

Reviewing files that changed from the base of the PR and between ae35882 and 3c439e1.

📒 Files selected for processing (15)
  • client-codegen-test/output/source/haskell-client-codegen/Com/Example/Model/Error400.hs
  • client-codegen-test/output/source/haskell-client-codegen/Com/Example/Model/InternalServerError.hs
  • client-codegen-test/output/source/haskell-client-codegen/Com/Example/Model/TestCustomStatusOutput.hs
  • client-codegen-test/output/source/haskell-client-codegen/Com/Example/Model/TestErrorsOutput.hs
  • client-codegen-test/output/source/haskell-client-codegen/Com/Example/Model/TestHttpDocumentDeserializationOutput.hs
  • client-codegen-test/output/source/haskell-client-codegen/Com/Example/Model/TestHttpDocumentOutput.hs
  • client-codegen-test/output/source/haskell-client-codegen/Com/Example/Model/TestHttpHeadersOutput.hs
  • client-codegen-test/output/source/haskell-client-codegen/Com/Example/Model/TestHttpLabelsOutput.hs
  • client-codegen-test/output/source/haskell-client-codegen/Com/Example/Model/TestHttpPayloadDeserializationOutput.hs
  • client-codegen-test/output/source/haskell-client-codegen/Com/Example/Model/TestHttpPayloadOutput.hs
  • client-codegen-test/output/source/haskell-client-codegen/Com/Example/Model/TestMaybeOutput.hs
  • client-codegen-test/output/source/haskell-client-codegen/Com/Example/Model/TestQueryOutput.hs
  • client-codegen-test/output/source/haskell-client-codegen/Com/Example/Model/TestReservedWordsOutput.hs
  • client-codegen/src/main/kotlin/in/juspay/smithy/haskell/client/codegen/generators/FromResponseParserGenerator.kt
  • gradle.properties

Walkthrough

This PR updates the Haskell code generator and its test output to construct HTTP status codes using Network.HTTP.Types.mkStatus with an empty reason phrase instead of predefined constants, and bumps the version from 0.0.7 to 0.0.8.

Changes

Cohort / File(s) Summary
Generated Haskell Model Files
client-codegen-test/output/source/haskell-client-codegen/Com/Example/Model/Error400.hs, InternalServerError.hs, TestCustomStatusOutput.hs, TestErrorsOutput.hs, TestHttpDocumentDeserializationOutput.hs, TestHttpDocumentOutput.hs, TestHttpHeadersOutput.hs, TestHttpLabelsOutput.hs, TestHttpPayloadDeserializationOutput.hs, TestHttpPayloadOutput.hs, TestMaybeOutput.hs, TestQueryOutput.hs, TestReservedWordsOutput.hs
Updated expectedStatus in FromResponseParser instances from predefined constants (e.g., Network.HTTP.Types.status200) to explicit constructor calls (e.g., Network.HTTP.Types.mkStatus 200 ""), maintaining equivalent functionality.
Code Generator
client-codegen/src/main/kotlin/.../FromResponseParserGenerator.kt
Modified status code generation to use mkStatus $status "" instead of mkStatus $status \"\", changing how the empty reason phrase is represented in the generated Haskell output.
Version Update
gradle.properties
Incremented version from 0.0.7 to 0.0.8.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • ShubhranshuSanjeev

Poem

🐰 Status codes dance with a crafted grace,
No longer static, they find their place,
With mkStatus now they come alive,
From empty strings their reasons thrive,
A nimble refactor, version now eight! 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: mkStatus usage' directly corresponds to the main change across all files: updating HTTP status construction from predefined constants to using mkStatus function calls.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-generation

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ayushjain17
ayushjain17 merged commit 3eb6902 into master Mar 26, 2026
9 checks passed
@ayushjain17
ayushjain17 deleted the fix-generation branch March 26, 2026 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants