Skip to content

ResponseBodyにquestion idを含める #1305

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

Merged
merged 11 commits into from
May 19, 2025

Conversation

Eraxyso
Copy link

@Eraxyso Eraxyso commented May 2, 2025

Closes #1293

@Eraxyso Eraxyso requested a review from kaitoyama May 2, 2025 19:19
Copy link
Contributor

@kaitoyama kaitoyama left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

全体としてはLGTMです!
一か所説明をコメントで足しておいてください!

@@ -72,6 +74,35 @@ func setupSampleResponse() {
}
}

func AddQuestionID2SampleResponse(questionnaireID int) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここに、この関数の目的だけコメントで書いておいてほしいです

@Eraxyso Eraxyso requested a review from Copilot May 14, 2025 06:29
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request adds a new field "question_id" to the ResponseBody and updates related serialization, OpenAPI spec, controller logic, and tests. Key changes include:

  • Modifications in openapi/types.go to marshal and unmarshal the new "question_id" field.
  • Updates to the OpenAPI spec in docs/swagger/swagger.yaml to reflect the added field.
  • Adjustments in controller and test files to set and validate the new field, including synchronization in tests.

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
openapi/types.go Added QuestionId field and updated JSON marshalling/unmarshalling logic.
openapi/spec.go Modified schema definition to include question_id with allOf composition.
controller/response_test.go Updated tests to set QuestionId and added mutex for concurrent test access.
controller/response.go Adjusted validation logic for ResponseBody; now iterates over responseMetas.
controller/questionnaire_test.go Updated tests to include added QuestionId in responses.
controller/questionnaire.go Updated response creation with new QuestionId field and validations.
controller/adapter.go Mapped model QuestionID to openapi.ResponseBody.QuestionId.

Copy link

codecov bot commented May 19, 2025

Codecov Report

Attention: Patch coverage is 78.57143% with 12 lines in your changes missing coverage. Please review.

Project coverage is 62.39%. Comparing base (68962d6) to head (df0f4d7).
Report is 12 commits behind head on fix/openapi.

Files with missing lines Patch % Lines
controller/response.go 73.91% 5 Missing and 1 partial ⚠️
controller/adapter.go 70.00% 2 Missing and 1 partial ⚠️
controller/questionnaire.go 86.95% 3 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff               @@
##           fix/openapi    #1305      +/-   ##
===============================================
- Coverage        62.60%   62.39%   -0.21%     
===============================================
  Files               25       25              
  Lines             4115     4146      +31     
===============================================
+ Hits              2576     2587      +11     
- Misses            1199     1215      +16     
- Partials           340      344       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Eraxyso Eraxyso merged commit 2f8dbdd into fix/openapi May 19, 2025
7 of 9 checks passed
@Eraxyso Eraxyso deleted the fix/openapi-responsebody-questionid branch May 19, 2025 18:17
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