Scheduler plugin for Commerce Product Variation

Created on 10 April 2024, 12 months ago

Problem/Motivation

In our current project, we need Commerce product variations be published/unpublished on schedule, but it appeared that Scheduler provide no support for Variations.

Proposed resolution

Implement Scheduler plugin for Commerce Product Variation entity type.

Feature request
Status

Active

Version

2.0

Component

Plugin

Created by

🇧🇾Belarus aylis

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @aylis
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.2.x + Environment: PHP 8.1 & MySQL 8
    last update 12 months ago
    Build Successful
  • Status changed to Needs review 12 months ago
  • 🇧🇾Belarus aylis

    Added MR with changes to make Scheduler work for Variation entities, needs review

  • Open in Jenkins → Open on Drupal.org →
    Core: 10.2.x + Environment: PHP 8.1 & MySQL 8
    last update 12 months ago
    Build Successful
  • Pipeline finished with Failed
    12 months ago
    Total: 413s
    #143133
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.2.x + Environment: PHP 8.1 & MySQL 8
    last update 12 months ago
    Build Successful
  • Pipeline finished with Failed
    12 months ago
    Total: 147s
    #143137
  • Pipeline finished with Failed
    12 months ago
    Total: 502s
    #143140
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.2.x + Environment: PHP 8.1 & MySQL 8
    last update 12 months ago
    195 pass, 6 fail
  • Pipeline finished with Failed
    12 months ago
    #143153
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.2.x + Environment: PHP 8.1 & MySQL 8
    last update 12 months ago
    195 pass, 6 fail
  • Pipeline finished with Failed
    12 months ago
    Total: 735s
    #143162
  • First commit to issue fork.
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.2.x + Environment: PHP 8.1 & MySQL 8
    last update 12 months ago
    195 pass, 6 fail
  • Status changed to Needs work 12 months ago
  • 🇬🇧United Kingdom jonathan1055

    Thanks for starting this. I just rebase the MR, I'm not actively working on it, so you are free to investigate the test failures.

  • First commit to issue fork.
  • Assigned to tcrawford
  • Status changed to Active about 1 month ago
  • Pipeline finished with Failed
    about 1 month ago
    Total: 731s
    #428679
  • Pipeline finished with Failed
    about 1 month ago
    Total: 826s
    #428810
  • Pipeline finished with Canceled
    about 1 month ago
    Total: 125s
    #428874
  • Pipeline finished with Failed
    about 1 month ago
    Total: 169s
    #428876
  • Pipeline finished with Failed
    about 1 month ago
    Total: 720s
    #428879
  • Pipeline finished with Canceled
    about 1 month ago
    Total: 137s
    #428893
  • Pipeline finished with Failed
    about 1 month ago
    Total: 284s
    #428898
  • Pipeline finished with Failed
    about 1 month ago
    Total: 698s
    #428907
  • Pipeline finished with Failed
    about 1 month ago
    Total: 698s
    #428921
  • Pipeline finished with Failed
    about 1 month ago
    Total: 403s
    #428965
  • Pipeline finished with Failed
    about 1 month ago
    Total: 166s
    #428974
  • Pipeline finished with Canceled
    about 1 month ago
    Total: 135s
    #428978
  • Pipeline finished with Canceled
    about 1 month ago
    Total: 85s
    #428981
  • Pipeline finished with Failed
    about 1 month ago
    Total: 245s
    #428984
  • Pipeline finished with Failed
    about 1 month ago
    Total: 702s
    #428989
  • Pipeline finished with Canceled
    about 1 month ago
    Total: 405s
    #428997
  • Pipeline finished with Failed
    about 1 month ago
    Total: 426s
    #429010
  • Pipeline finished with Failed
    about 1 month ago
    Total: 737s
    #429017
  • Pipeline finished with Failed
    about 1 month ago
    Total: 835s
    #429531
  • 🇬🇧United Kingdom jonathan1055

    Hi @tcrawford,
    This is excellent work, thank you. It seems like you know what to do, and are making good progress. In case it helps, have you read the new Scheduler documentaion regarding the plugins

    Also, to speed up test times and save resources, you could comment out the other entity types from dataStandardEntityTypes(). Then you'll get quicker jobs, shorter logs and be able to identify the problem tests more easily. Let me know if I can help.

  • Pipeline finished with Failed
    about 1 month ago
    Total: 842s
    #429563
  • 🇨🇭Switzerland tcrawford

    Hi @jonathan1055. Thanks for the feedback. I had not, but I just read the documentation.

    If you would prefer the plugin for product variations to be stored in a third party module or is it a commonly used enough entity to be included here (perhaps due to its relation to the commerce product entity that it included)?

    Unfortunately, I had some issues running these tests locally (the runner is complaining about missing dependencies that don't seem to be an issue on the server). I reached out to pfrenssen, who is a colleague, for some assistance and so if I can get the tests running locally I will save some resources on the server and be a bit faster.

    Great idea, I will comment out data types (now that the prior tests are passing) to get feedback on the new entity type only.

  • 🇬🇧United Kingdom jonathan1055

    Would prefer the plugin for product variations to be stored in a third party module or is it a commonly used enough entity to be included here

    It woud be good if it can be included in Scheduler, provided there is not too much overhead, as it fits neatly here. It would take more effort to be a separate third-party module. But is there any benefit in putting it within a submodule of Scheduler which only gets enabled when required? We do this for scheduler_rules_integration. It may make the code more messy, and might not warrant the effort. But just making the suggestion in case you like the idea.

    running tests locally ... missing dependencies

    Is this why you added 'language', 'locale' and 'config' to SchedulerBrowserTestBase here ?

  • Pipeline finished with Failed
    about 1 month ago
    Total: 374s
    #430572
  • Pipeline finished with Failed
    about 1 month ago
    Total: 1123s
    #430743
  • 🇨🇭Switzerland tcrawford

    Thanks for the feedback on where to include the plugin.

    But is there any benefit in putting it within a submodule of Scheduler which only gets enabled when required?

    I would tend to suggest to leave it in the main module as it is consistent with the commerce product plugin.

    Is this why you added 'language', 'locale' and 'config' to SchedulerBrowserTestBase here ?

    Yes. I have removed these though as they were not required.

  • 🇬🇧United Kingdom jonathan1055

    Yes, leaving the additions in the main module plugin is fine.
    I am going to push a change to .gitlab-ci.yml to make the 'next minor' testing manual. So when done, you will need to pull that down to your local repo. Are you currently in the middle of making changes? Let me know when you have pushed, as I don't want to make more work for you.

  • Pipeline finished with Failed
    about 1 month ago
    Total: 856s
    #430826
  • Pipeline finished with Failed
    about 1 month ago
    Total: 916s
    #431343
  • Pipeline finished with Canceled
    about 1 month ago
    Total: 279s
    #431401
  • Pipeline finished with Failed
    about 1 month ago
    Total: 864s
    #431404
  • Pipeline finished with Failed
    about 1 month ago
    Total: 884s
    #431416
  • Pipeline finished with Failed
    about 1 month ago
    Total: 983s
    #431583
  • Pipeline finished with Failed
    about 1 month ago
    #431635
  • Pipeline finished with Failed
    about 1 month ago
    Total: 1183s
    #431644
  • Pipeline finished with Canceled
    about 1 month ago
    Total: 264s
    #431650
  • Pipeline finished with Failed
    about 1 month ago
    Total: 1846s
    #431651
  • Pipeline finished with Failed
    about 1 month ago
    Total: 1058s
    #431669
  • Pipeline finished with Failed
    about 1 month ago
    Total: 995s
    #431856
  • Pipeline finished with Failed
    about 1 month ago
    Total: 937s
    #431878
  • Pipeline finished with Failed
    about 1 month ago
    Total: 949s
    #431890
  • Pipeline finished with Failed
    about 1 month ago
    Total: 1186s
    #431902
  • Pipeline finished with Failed
    about 1 month ago
    Total: 820s
    #432144
  • Pipeline finished with Canceled
    about 1 month ago
    Total: 339s
    #432156
  • Pipeline finished with Failed
    about 1 month ago
    #432159
  • Pipeline finished with Failed
    about 1 month ago
    #432173
  • Pipeline finished with Canceled
    about 1 month ago
    #432194
  • Pipeline finished with Success
    about 1 month ago
    Total: 1256s
    #432196
  • 🇨🇭Switzerland tcrawford

    @Jonathan1055: Sorry. I missed your prior message. I now have tests passing now. I just need to add the view and integrate this and consider whether to do the rules integration.

  • 🇬🇧United Kingdom jonathan1055

    That's great news. I've not reviewed any code yet, but getting the tests to pass is a major step forward.

    Regarding rules integration, if it is as straightforward as adding the single event file, then yes do so. But Rules is not used so much anymore, so if it becomes tedious then we could take the decision not to do that.

  • Pipeline finished with Success
    about 1 month ago
    Total: 908s
    #434638
  • 🇨🇭Switzerland tcrawford

    I have added the view for commerce product variations, adapted the derivative plugin and updated the view access tests. I am therefore assigning this one to 'needs review'. Thanks in advance.

  • 🇨🇭Switzerland tcrawford

    I am re-assigning this as there are some minor issues with the view.

  • Pipeline finished with Success
    about 1 month ago
    Total: 918s
    #434704
Production build 0.71.5 2024