Skip to content

Conversation

@pcrespov
Copy link
Member

@pcrespov pcrespov commented Mar 11, 2025

What do these changes do?

This PR introduces an AI-assisted workflow, using Copilot prompt customization, for generating and maintaining user-facing messages in the backend.

Key Changes

  1. Adds a user_message function to mark user-facing strings and associate them with a revision version.
  2. Adds a prompt file at .github/prompts/update-user-messages.prompt.md to guide GitHub Copilot in updating these messages.
  3. Adds human-readable guidelines at docs/user-messages-guidelines.md, based on @eofli's recommendations, to ensure consistency and clarity in user messages.

Example

A screenshot showing the result of running the prompt on a selected file, using Copilot prompt customization:

image

Notes

  • This PR includes a partial demonstration: some user messages have been marked and revised using the new workflow.
  • A follow-up is needed to cover the remaining messages across the codebase (every developer could use this prompt to update their own domain).

Related issue/s

How to test

  • Open copilot and drop some files
  • Run prompt
  • Check diffs on messages

Dev-ops checklist

NOne

@pcrespov pcrespov self-assigned this Mar 11, 2025
@pcrespov pcrespov added the a:webserver webserver's codebase. Assigning the area is particularly useful for bugs label Mar 11, 2025
@pcrespov pcrespov added this to the The Awakening milestone Mar 11, 2025
@pcrespov pcrespov force-pushed the is6673/auto-user-friendly-messages branch from 11473b4 to eb7bf18 Compare March 13, 2025 19:21
@pcrespov pcrespov changed the title 🎨 Is6673/auto user friendly messages 🎨 Is6673/auto user friendly messages and unique EOC for deduplication purposes Mar 13, 2025
@codecov
Copy link

codecov bot commented Mar 13, 2025

Codecov Report

Attention: Patch coverage is 95.23810% with 1 line in your changes missing coverage. Please review.

Project coverage is 87.83%. Comparing base (15c27b9) to head (7ec0c5e).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7345      +/-   ##
==========================================
- Coverage   88.03%   87.83%   -0.20%     
==========================================
  Files        1845     1448     -397     
  Lines       71206    59882   -11324     
  Branches     1220      673     -547     
==========================================
- Hits        62685    52597   -10088     
+ Misses       8169     7061    -1108     
+ Partials      352      224     -128     
Flag Coverage Δ
integrationtests 64.19% <94.11%> (-0.07%) ⬇️
unittests 86.17% <95.23%> (-0.45%) ⬇️
Components Coverage Δ
api ∅ <ø> (∅)
pkg_aws_library ∅ <ø> (∅)
pkg_dask_task_models_library ∅ <ø> (∅)
pkg_models_library ∅ <ø> (∅)
pkg_notifications_library ∅ <ø> (∅)
pkg_postgres_database ∅ <ø> (∅)
pkg_service_integration ∅ <ø> (∅)
pkg_service_library 72.67% <100.00%> (-0.02%) ⬇️
pkg_settings_library ∅ <ø> (∅)
pkg_simcore_sdk 85.05% <ø> (-0.06%) ⬇️
agent 96.29% <ø> (ø)
api_server 92.31% <ø> (ø)
autoscaling 96.03% <ø> (ø)
catalog 92.29% <ø> (ø)
clusters_keeper 99.13% <ø> (ø)
dask_sidecar 91.79% <ø> (ø)
datcore_adapter 97.94% <ø> (ø)
director 76.73% <ø> (-0.10%) ⬇️
director_v2 91.07% <ø> (-0.13%) ⬇️
dynamic_scheduler 96.69% <ø> (ø)
dynamic_sidecar 90.09% <ø> (ø)
efs_guardian 89.65% <ø> (ø)
invitations 93.00% <ø> (ø)
payments 92.57% <ø> (ø)
resource_usage_tracker 89.11% <ø> (+0.10%) ⬆️
storage 87.78% <ø> (+0.31%) ⬆️
webclient ∅ <ø> (∅)
webserver 87.63% <94.11%> (-0.02%) ⬇️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 15c27b9...7ec0c5e. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pcrespov pcrespov changed the title 🎨 Is6673/auto user friendly messages and unique EOC for deduplication purposes 🎨 Is6673/auto user friendly messages Mar 13, 2025
@pcrespov pcrespov changed the title 🎨 Is6673/auto user friendly messages WIP: 🎨 Is6673/auto user friendly messages Mar 18, 2025
@pcrespov pcrespov force-pushed the is6673/auto-user-friendly-messages branch from eb7bf18 to 233a2f4 Compare March 19, 2025 11:25
@pcrespov pcrespov force-pushed the is6673/auto-user-friendly-messages branch from 233a2f4 to 20e2170 Compare March 28, 2025 22:16
@pcrespov pcrespov force-pushed the is6673/auto-user-friendly-messages branch from 20e2170 to 105df9d Compare April 9, 2025 13:24
@sonarqubecloud
Copy link

sonarqubecloud bot commented Apr 9, 2025

@pcrespov pcrespov changed the title WIP: 🎨 Is6673/auto user friendly messages 🎨🔨 AI-assisted workflow for user-facing messages Jun 18, 2025
@pcrespov pcrespov modified the milestones: The Awakening, Engage Jun 18, 2025
Copy link
Contributor

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 standardizes user-facing strings by wrapping them in a user_message call (with version tracking) and provides guidance for maintaining these messages.

  • Wraps existing error and status messages in user_message for AI-assisted updates.
  • Introduces a prompt file and human-readable guidelines for consistent message updates.
  • Adds basic tests and the user_message implementation to support this workflow.

Reviewed Changes

Copilot reviewed 20 out of 23 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
services/web/server/src/simcore_service_webserver/tasks/_exception_handlers.py Replaced literal messages with user_message(..., _version=1).
services/web/server/src/simcore_service_webserver/tags/_rest.py Wrapped tag-related errors in user_message.
services/web/server/src/simcore_service_webserver/projects/_controller/trash_rest.py Wrapped trash errors in user_message.
services/web/server/src/simcore_service_webserver/projects/_controller/_rest_exceptions.py Wrapped folder/node errors with user_message.
services/web/server/src/simcore_service_webserver/products/_controller/rest_exceptions.py Wrapped product errors with user_message.
services/web/server/src/simcore_service_webserver/licenses/_common/exceptions_handlers.py Wrapped license errors with user_message.
services/web/server/src/simcore_service_webserver/groups/_common/exceptions_handlers.py Wrapped group errors with user_message.
services/web/server/src/simcore_service_webserver/folders/_common/exceptions_handlers.py Wrapped folder/workspace errors with user_message.
services/web/server/src/simcore_service_webserver/director_v2/_controller/_rest_exceptions.py Wrapped director_v2 errors with user_message.
services/web/server/src/simcore_service_webserver/constants.py Converted default retry message to user_message.
services/web/server/src/simcore_service_webserver/catalog/_controller_rest_exceptions.py Wrapped catalog errors with user_message.
services/web/server/src/simcore_service_webserver/api_keys/_controller/rest_exceptions.py Wrapped API key errors with user_message.
packages/service-library/src/servicelib/aiohttp/rest_middlewares.py Converted internal error template to user_message.
packages/common-library/tests/test_user_messages.py Added a basic test for user_message.
packages/common-library/tests/test_errors_classes.py Extended tests for error factory functions.
packages/common-library/src/common_library/user_messages.py Introduced user_message function.
packages/common-library/src/common_library/errors_classes.py Added resource-based error factory definitions.
docs/user-messages-guidelines.md Updated guidelines to focus on user-facing messages.
.github/prompts/update-user-messages.prompt.md New Copilot prompt for updating user messages.
.github/copilot-instructions.md Minor link ordering adjustment.
Comments suppressed due to low confidence (2)

services/web/server/src/simcore_service_webserver/tags/_rest.py:37

  • Typo: 'insuficient' should be 'insufficient'. Also add _version=1 to this message to enable version tracking.
)

docs/user-messages-guidelines.md:3

  • [nitpick] The phrase 'error and warnings user-facing messages' is awkward; consider rephrasing to 'user-facing error and warning messages' for clarity.
These guidelines ensure that error and warnings user-facing messages are user-friendly, clear, and helpful while maintaining a professional tone. 🚀

@pcrespov pcrespov added the t:maintenance Some planned maintenance work label Jun 18, 2025
@pcrespov pcrespov enabled auto-merge (squash) June 18, 2025 14:44
Copy link
Member

@odeimaiz odeimaiz left a comment

Choose a reason for hiding this comment

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

very nice 👌

Copy link
Member

@sanderegg sanderegg left a comment

Choose a reason for hiding this comment

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

this is looking good! but I am wondering why many of the diffs do not show any change.

@sonarqubecloud
Copy link

@pcrespov
Copy link
Member Author

@mergify queue

@pcrespov pcrespov added the 🤖-automerge marks PR as ready to be merged for Mergify label Jun 19, 2025
@mergify
Copy link
Contributor

mergify bot commented Jun 19, 2025

queue

🟠 Waiting for conditions to match

  • -closed [📌 queue requirement]
  • -conflict [📌 queue requirement]
  • -draft [📌 queue requirement]
  • any of: [📌 queue -> configuration change requirements]
    • -mergify-configuration-changed
    • check-success = Configuration changed
  • any of: [🔀 queue conditions]
    • all of: [📌 queue conditions of queue default]
      • #approved-reviews-by >= 2 [🛡 GitHub branch protection]
      • #approved-reviews-by>=2
      • #changes-requested-reviews-by = 0 [🛡 GitHub branch protection]
      • #changes-requested-reviews-by=0
      • #review-threads-unresolved = 0 [🛡 GitHub branch protection]
      • #review-threads-unresolved=0
      • -conflict
      • -draft
      • base=master
      • branch-protection-review-decision = APPROVED [🛡 GitHub branch protection]
      • label!=🤖-do-not-merge
      • label=🤖-automerge
      • any of: [🛡 GitHub branch protection]
        • check-skipped = deploy to dockerhub
        • check-neutral = deploy to dockerhub
        • check-success = deploy to dockerhub
      • any of: [🛡 GitHub branch protection]
        • check-success = system-tests
        • check-neutral = system-tests
        • check-skipped = system-tests
      • any of: [🛡 GitHub branch protection]
        • check-success = unit-tests
        • check-neutral = unit-tests
        • check-skipped = unit-tests
      • any of: [🛡 GitHub branch protection]
        • check-success = check OAS' are up to date
        • check-neutral = check OAS' are up to date
        • check-skipped = check OAS' are up to date
      • any of: [🛡 GitHub branch protection]
        • check-success = integration-tests
        • check-neutral = integration-tests
        • check-skipped = integration-tests
      • any of: [🛡 GitHub branch protection]
        • check-success = build-test-images (frontend) / build-test-images
        • check-neutral = build-test-images (frontend) / build-test-images
        • check-skipped = build-test-images (frontend) / build-test-images

Copy link
Contributor

@giancarloromeo giancarloromeo left a comment

Choose a reason for hiding this comment

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

Nice thanks

@pcrespov pcrespov merged commit 431ac36 into ITISFoundation:master Jun 19, 2025
95 checks passed
@pcrespov pcrespov deleted the is6673/auto-user-friendly-messages branch June 19, 2025 12:05
matusdrobuliak66 pushed a commit that referenced this pull request Jun 23, 2025
@matusdrobuliak66 matusdrobuliak66 mentioned this pull request Jun 23, 2025
92 tasks
@matusdrobuliak66 matusdrobuliak66 mentioned this pull request Aug 5, 2025
88 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🤖-automerge marks PR as ready to be merged for Mergify a:webserver webserver's codebase. Assigning the area is particularly useful for bugs t:maintenance Some planned maintenance work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dump and review automatically all user messages (info, warnings, errors) following Z43 standards

7 participants