Skip to content

SL-329 optimize db - #297

Merged
MarijusDilys merged 5 commits into
release-v2.0.2from
SL-329/optimize-db
Oct 10, 2025
Merged

SL-329 optimize db#297
MarijusDilys merged 5 commits into
release-v2.0.2from
SL-329/optimize-db

Conversation

@MarijusDilys

Copy link
Copy Markdown
Contributor

Self-Checks

  • I have performed a self-review of my code.
  • I have updated/added necessary technical documentation in the README file.

JIRA task link

Summary

QA Checklist Labels

  • Bug fix?
  • New feature?
  • Improvement?
  • Technical debt?
  • Reusable?
  • Covered by tests?

QA Checklist

Additional Context

Frontend Changes

@MarijusDilys
MarijusDilys changed the base branch from master to release-v2.0.2 September 25, 2025 12:48
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @MarijusDilys, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the SaferPay module by focusing on performance, user experience, and code quality. It introduces critical database indexing for faster operations, streamlines the checkout process by grouping card payment methods, and provides granular control over email notifications. The integration of static analysis tools and extensive code refactoring ensures a more robust and maintainable codebase for future development.

Highlights

  • Database Optimization: Introduced new database indexes across saferpay_order, saferpay_card_alias, saferpay_assert, and saferpay_order_refund tables to improve query performance and efficiency.
  • Payment Method Grouping: Implemented a new feature to group various credit/debit card brands under a single 'Cards' payment option in the checkout, configurable via new settings.
  • Email Sending Control: Added a service to control the sending of 'new_order' and 'order_conf' emails, allowing module-specific configuration for these notifications.
  • Code Quality & Static Analysis: Integrated PHPStan for static code analysis by adding new Makefile targets (ci-lint, ci-phpstan) and PHPStan configuration files, aiming to improve code quality and catch potential bugs early.
  • Payment Method Removal: The 'WL Crypto Payments' method and its related configurations and validation logic have been removed from the module.
  • Code Refactoring & Cleanup: Performed significant code cleanup, including updating type hints, removing unused imports and properties, simplifying logic in various controllers and services, and improving object validation.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/cd.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request focuses on database optimizations for the SaferPay module. It introduces a new upgrade script to add several database indexes to key tables, which should improve query performance. The queries in SaferPayCardAliasRepository and SaferPayOrderRepository have also been updated to be more efficient by removing unnecessary quotes around integer values in WHERE clauses and adding filtering and ordering. A new TASKS.md file is also added to document planned improvements.

My review focuses on the correctness and maintainability of these changes. I've identified a potential issue in the upgrade script where some configuration updates were removed, which could affect users upgrading the module. I've also suggested a refactoring to reduce code duplication in the same script. A minor formatting issue in the new TASKS.md file was also noted.

@MarijusDilys MarijusDilys changed the title SL 329/optimize db SL-329 optimize db Sep 25, 2025
@MarijusDilys
MarijusDilys merged commit a0fceb5 into release-v2.0.2 Oct 10, 2025
3 checks passed
@MarijusDilys
MarijusDilys deleted the SL-329/optimize-db branch October 10, 2025 06:39
@MarijusDilys
MarijusDilys restored the SL-329/optimize-db branch October 16, 2025 06:06
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.

1 participant