Skip to content

Conversation

@hoangsonww
Copy link
Member

SUMMARY

This PR collects AI flag for each case and assign cases to all participants in the study. It also fixes Black formatter rules and reformatted all Python files in the project.


Pre-merge author checklist

  • I've clearly explained:
    • What problem this PR is solving.
    • How this problem was solved.
    • How reviewers can test my changes.
  • I've included tests I've run to ensure my changes work.
  • I've added unit tests for any new code, if applicable.
  • I've documented any added code.

@hoangsonww hoangsonww requested a review from Copilot June 20, 2025 00:49
@hoangsonww hoangsonww self-assigned this Jun 20, 2025
@hoangsonww hoangsonww added documentation Improvements or additions to documentation enhancement New feature or request labels Jun 20, 2025
Copy link

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 PR introduces tracking of whether an AI-generated score was shown to users and refines the case-assignment shell script, alongside applying Black formatting rules across the codebase.

  • Add ai_score_shown handling in the answer service and model
  • Enhance generate_config.sh for interactive password entry and per-user loops
  • Update Black configuration and reformat imports/signatures project-wide

Reviewed Changes

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

Show a summary per file
File Description
src/configration/utils/answer_config_validations/multiple_choice.py Reformatted import block
src/configration/service/answer_config_service.py Reformatted import block
src/configration/controller/answer_config_controller.py Reformatted _needs_attention_check signature
src/common/service/email_service.py Reformatted import block
src/common/exception/exception_handlers.py Reformatted import block
src/common/exception/BusinessException.py Reformatted enum formatting
src/cases/service/case_service.py Reformatted chained calls and imports
src/cases/repository/visit_occurrence_repository.py Reformatted import
src/cases/repository/measurement_repository.py Reformatted import
src/cases/controller/case_controller.py Reformatted imports
src/answer/service/answer_service.py Added ai_shown flag extraction and passing to repository
src/answer/model/answer.py Added ai_score_shown column to Answer model
src/answer/controller/answer_controller.py Reformatted imports
src/analytics/service/analytics_service.py Reformatted record_metrics signature
src/analytics/repository/analytics_repository.py Cleaned up extra blank line
src/analytics/model/analytics.py Reformatted timestamp columns
src/analytics/controller/analytics_controller.py Reformatted imports and error-message punctuation
script/assign_cases/generate_config.sh Switched to bash, interactive password prompt, per-user loop
pyproject.toml Set Black line-length and target-version
README.md Added Black and migration guidance
Comments suppressed due to low confidence (1)

src/answer/service/answer_service.py:31

  • The new ai_score_shown behavior isn’t covered by existing tests. Consider adding unit tests to verify that this flag is correctly extracted, stored, and retrieved.
        ai_shown = data.get("aiScoreShown", False)


configuration = self.configuration_repository.get_configuration_by_id(task_id)

if not configuration or configuration.user_email != user_eamil:
Copy link

Copilot AI Jun 20, 2025

Choose a reason for hiding this comment

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

There's a typo in the variable name user_eamil. It should be user_email to match the existing variable.

Suggested change
if not configuration or configuration.user_email != user_eamil:
if not configuration or configuration.user_email != user_email:

Copilot uses AI. Check for mistakes.
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
#!/usr/bin/env bash
Copy link

Copilot AI Jun 20, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider adding set -euo pipefail immediately after the shebang to ensure the script exits on errors, treats unset variables as errors, and fails on pipeline errors.

Copilot uses AI. Check for mistakes.
@hoangsonww hoangsonww merged commit 416fe0a into main Jun 20, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants