Skip to content

[BACKPORT] MPT-17588 UAT improvements#230

Merged
d3rky merged 6 commits intorelease/4from
MPT-17588-uat-improvements
Feb 5, 2026
Merged

[BACKPORT] MPT-17588 UAT improvements#230
d3rky merged 6 commits intorelease/4from
MPT-17588-uat-improvements

Conversation

@ruben-sebrango
Copy link
Collaborator

@ruben-sebrango ruben-sebrango commented Feb 5, 2026

Closes MPT-17588

Changes

  • Order Parameters: Added three new enum members to OrderParametersEnum (NEW_ACCOUNT_INSTRUCTIONS, TECHNICAL_CONTACT_INFO, CONNECT_AWS_BILLING_ACCOUNT) and introduced AWS_ITEMS_SKUS constant for AWS Usage items.

  • Validation Pipeline: Replaced update_parameters_visibility with new validate_order(client, order) function that provides structured validation orchestration including new account constraint validation, account-type-based parameter constraints, and default line item injection.

  • Account Type Configuration: Refactored ACCOUNT_TYPE_CONFIG to update parameter visibility and reset rules for both NEW_AWS_ENVIRONMENT and EXISTING_AWS_ENVIRONMENT account types with expanded visibility constraints.

  • CRM Ticket Enhancements: Extended all CRM ticket summaries (Deploy Roles, New Account, Onboard Services, Order Fail, PLS, Terminate Order) with four new fields: seller_country, pm_account_id, handshake_approved, and customer_roles_deployed.

  • CRM Ticket Templates: Updated HTML templates for all ticket types to display the new fields (Seller Country, PMA, Handshake Approved, Customer Roles Deployed) and added call-to-action messaging for Onboard Services tickets.

  • Parameter Defaults: Updated get_customer_roles_deployed and get_channel_handshake_approval_status to return empty string ("") instead of None when parameter values are missing.

  • Test Infrastructure: Updated test fixtures and test cases to align with the new validate_order validation approach, including refactored parameter assertions focused on constraint visibility and updated mock fixtures.

  • Code Quality: Updated pyproject.toml to include WPS210 suppression for test_base.py validation tests.

alephsur and others added 6 commits February 5, 2026 10:47
…es status to the tickets

(cherry picked from commit 14b7365)
Bumps the python-production group with 1 update: [boto3](https://github.com/boto/boto3).

Updates `boto3` from 1.42.34 to 1.42.39
- [Release notes](https://github.com/boto/boto3/releases)
- [Commits](boto/boto3@1.42.34...1.42.39)

---
updated-dependencies:
- dependency-name: boto3
  dependency-version: 1.42.39
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: python-production
...

Signed-off-by: dependabot[bot] <support@github.com>
(cherry picked from commit 126c651)
…with 3 updates

Bumps the python-development group with 3 updates in the / directory: [boto3-stubs](https://github.com/youtype/mypy_boto3_builder), [botocore-stubs](https://github.com/youtype/botocore-stubs) and [ipython](https://github.com/ipython/ipython).

Updates `boto3-stubs` from 1.42.34 to 1.42.40
- [Release notes](https://github.com/youtype/mypy_boto3_builder/releases)
- [Commits](https://github.com/youtype/mypy_boto3_builder/commits)

Updates `botocore-stubs` from 1.42.34 to 1.42.40
- [Release notes](https://github.com/youtype/botocore-stubs/releases)
- [Commits](https://github.com/youtype/botocore-stubs/commits)

Updates `ipython` from 9.9.0 to 9.10.0
- [Release notes](https://github.com/ipython/ipython/releases)
- [Commits](ipython/ipython@9.9.0...9.10.0)

---
updated-dependencies:
- dependency-name: boto3-stubs
  dependency-version: 1.42.40
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: python-development
- dependency-name: botocore-stubs
  dependency-version: 1.42.40
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: python-development
- dependency-name: ipython
  dependency-version: 9.10.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: python-development
...

Signed-off-by: dependabot[bot] <support@github.com>
(cherry picked from commit 0322464)
@ruben-sebrango ruben-sebrango requested a review from a team as a code owner February 5, 2026 09:49
@coderabbitai
Copy link

coderabbitai bot commented Feb 5, 2026

📝 Walkthrough

Walkthrough

This PR refactors the order validation pipeline by introducing a new validate_order function that replaces update_parameters_visibility, adds support for AWS new account ordering with specific parameter constraints, and extends CRM ticket summaries with four new fields (seller_country, pm_account_id, handshake_approved, customer_roles_deployed) across all ticket templates.

Changes

Cohort / File(s) Summary
Configuration & Constants
pyproject.toml, swo_aws_extension/constants.py
Updated linter ignores and added three new OrderParametersEnum members (NEW_ACCOUNT_INSTRUCTIONS, TECHNICAL_CONTACT_INFO, CONNECT_AWS_BILLING_ACCOUNT) plus AWS_ITEMS_SKUS constant.
Validation Pipeline
swo_aws_extension/flows/validation/base.py
Major refactor replacing update_parameters_visibility with new validate_order function; added helpers (_add_default_lines, _is_parameter_visible, _validate_new_account_constraints); restructured ACCOUNT_TYPE_CONFIG to enforce parameter visibility rules for NEW_AWS_ENVIRONMENT and EXISTING_AWS_ENVIRONMENT account types.
Integration Point
swo_aws_extension/extension.py
Updated import and call site to use validate_order(client, order) instead of update_parameters_visibility(order), now passing client context to validation logic.
Parameter Helpers
swo_aws_extension/parameters.py
Changed default return values from None to empty string ("") in get_customer_roles_deployed and get_channel_handshake_approval_status.
CRM Ticket Steps - Data Collection
swo_aws_extension/flows/steps/crm_tickets/{deploy_customer_roles,new_account,onboard_services,order_fail,pls,terminate_order}.py
Added seller_country and pm_account_id to all ticket summaries; additionally added handshake_approved and customer_roles_deployed (with capitalization) to onboard_services, order_fail, pls, and terminate_order.
CRM Ticket Templates
swo_aws_extension/flows/steps/crm_tickets/templates/{deploy_roles,new_account,onboard_services,order_failed,pls,terminate_order}.py
Extended HTML templates with list items for seller_country, pm_account_id, handshake_approved, and customer_roles_deployed; onboard_services template also includes new "CALL TO ACTION" messaging block.
Test Fixtures
tests/conftest.py
Added NEW_ACCOUNT_INSTRUCTIONS parameter entry to order_parameters_factory; replaced mock_update_parameters_visibility fixture with mock_validate_order; updated channel_handshake_approved default value.
CRM Ticket Step Tests
tests/flows/steps/crm_tickets/test_{deploy_customer_roles,new_account,onboard_services,order_fail,pls}.py
Updated expected ServiceRequest assertions to include new fields (seller_country, pm_account_id, handshake_approved, customer_roles_deployed) in summary payloads.
Validation Tests
tests/flows/validation/test_base.py
Refactored test suite to exercise validate_order with mocked MPTClient and get_product_items_by_skus; replaced parameter-level assertions with parameter constraint checks; added explicit test for NEW_ACCOUNT_INSTRUCTIONS visibility validation error.
Extension Tests
tests/test_extension.py
Updated test method parameters from mock_update_parameters_visibility to mock_validate_order; adjusted corresponding mock setup and assertions.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Jira Issue Key In Title ✅ Passed The PR title '[BACKPORT] MPT-17588 UAT improvements' contains exactly one Jira issue key in the correct format.
Test Coverage Required ✅ Passed The PR modifies 17 code files and includes corresponding updates to 8 test files, satisfying test coverage requirements.
Single Commit Required ✅ Passed The pull request contains exactly one commit (3465d6e), as confirmed by git rev-list --count HEAD returning 1.

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

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • MPT-17588: Cannot read properties of undefined (reading 'map')

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

@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 5, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
88.5% Coverage on New Code (required ≥ 95%)
6.9% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
swo_aws_extension/parameters.py (1)

296-302: ⚠️ Potential issue | 🟠 Major

Normalize missing values to a string to prevent .capitalize() crashes.

fulfillment_param.get("value", "") can still return None when the key exists with a null value, which will raise AttributeError in callers that do .capitalize(). Use or "" to guarantee a string.

🛠️ Proposed fix
-    return fulfillment_param.get("value", "")
+    return fulfillment_param.get("value") or ""
-    return fulfillment_param.get("value", "")
+    return fulfillment_param.get("value") or ""

Also applies to: 374-380

🤖 Fix all issues with AI agents
In `@swo_aws_extension/flows/steps/crm_tickets/onboard_services.py`:
- Around line 57-58: Guard against None returned by
get_channel_handshake_approval_status and get_customer_roles_deployed before
calling .capitalize(): when populating handshake_approved and
customer_roles_deployed, coerce the helper results to a safe string (e.g., use a
default like "" or "Unknown") or check for None and handle accordingly, then
call .capitalize() on the ensured string; locate the calls to
get_channel_handshake_approval_status(context.order) and
get_customer_roles_deployed(context.order) in the onboarding step and replace
them with the guarded/coerced expressions so .capitalize() never receives None.

In `@swo_aws_extension/flows/steps/crm_tickets/templates/onboard_services.py`:
- Around line 39-40: Replace the awkward CTA string in the template in
onboard_services.py: change "Please reach out the account manager to contact the
customer regarding additional services.!!" to a grammatically correct sentence
such as "Please ask the account manager to contact the customer about additional
services." — remove the double exclamation marks, fix "reach out the account
manager" to "ask the account manager" (or "reach out to the account manager")
and use "about" instead of "regarding" for conciseness in the string shown in
the diff.
🧹 Nitpick comments (2)
swo_aws_extension/flows/steps/crm_tickets/onboard_services.py (1)

48-49: Consider defaulting PMA to empty string.
If context.pm_account_id is missing, the summary will render None. A small guard keeps the ticket clean.

♻️ Optional tweak
-            pm_account_id=context.pm_account_id,
+            pm_account_id=context.pm_account_id or "",
tests/flows/validation/test_base.py (1)

40-42: Remove unused variable assignment.

The new_account_instructions_param variable assigned here is never used before being reassigned at line 46. This assignment can be removed.

🧹 Proposed fix
     order = set_order_parameter_constraints(
         order,
         OrderParametersEnum.NEW_ACCOUNT_INSTRUCTIONS.value,
         constraints={"hidden": True, "required": False, "readonly": False},
     )
-    new_account_instructions_param = get_ordering_parameter(
-        OrderParametersEnum.NEW_ACCOUNT_INSTRUCTIONS.value, order
-    )

     result = validate_order(mock_client, order)

@ruben-sebrango
Copy link
Collaborator Author

Coverage in the new code will be fixed in the next release.

@d3rky d3rky merged commit 99a1310 into release/4 Feb 5, 2026
3 of 4 checks passed
@d3rky d3rky deleted the MPT-17588-uat-improvements branch February 5, 2026 10:00
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.

3 participants