Remove or demote mock to test folder

Created on 26 July 2024, about 1 month ago
Updated 20 August 2024, 18 days ago

Problem/Motivation

After the DrupalOrg live endpoint and plugin was made live, the mock should no longer be offered as an option and we shouldn't need to worry anymore about regenerating fixtures, etc.

It might still be useful to have a DB driven plugin in the tests folder tho, so we can still keep it as many tests use it.

Proposed resolution

Remove mock related code to update fixtures and demote the plugin to the test folder

📌 Task
Status

Fixed

Version

2.0

Component

Code

Created by

🇪🇸Spain fjgarlin

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

Merge Requests

Comments & Activities

  • Issue created by @fjgarlin
  • Pipeline finished with Failed
    about 1 month ago
    #235090
  • 🇮🇪Ireland lostcarpark

    Keeping the mock API available for tests sounds useful.

  • Status changed to Needs work about 1 month ago
  • 🇪🇸Spain fjgarlin

    I've done a big refactoring + cleanup and most of the tests are passing as well as all the linting steps.

    There are some tests still not passing, but most of them are green already. If somebody would be willing to help here that'd be great as my available time is limited. I can continue working on it, but it might be a few days until I get to it again.

  • Pipeline finished with Failed
    about 1 month ago
    Total: 562s
    #238509
  • Pipeline finished with Failed
    about 1 month ago
    Total: 2691s
    #238514
  • Pipeline finished with Failed
    about 1 month ago
    Total: 345s
    #238559
  • Pipeline finished with Failed
    about 1 month ago
    Total: 379s
    #238595
  • Pipeline finished with Success
    about 1 month ago
    Total: 565s
    #238604
  • 🇪🇸Spain fjgarlin

    Green tests all over!! I still want to do more clean up but this is a great milestone in this initial refactoring.

  • Pipeline finished with Success
    about 1 month ago
    Total: 336s
    #239250
  • Pipeline finished with Canceled
    about 1 month ago
    Total: 285s
    #239261
  • Pipeline finished with Canceled
    about 1 month ago
    Total: 227s
    #239265
  • Pipeline finished with Success
    about 1 month ago
    Total: 416s
    #239271
  • Pipeline finished with Canceled
    about 1 month ago
    #239287
  • Pipeline finished with Canceled
    about 1 month ago
    Total: 105s
    #239292
  • Pipeline finished with Canceled
    about 1 month ago
    Total: 164s
    #239294
  • Pipeline finished with Success
    about 1 month ago
    Total: 570s
    #239298
  • Status changed to Needs review about 1 month ago
  • 🇪🇸Spain fjgarlin

    Following up on #5 (all tests green). I have cleaned up any code that was related to the initial drupalorg_mockapi and I have moved only the parts that were needed to the "tests" folder and renamed the plugin slightly.

    I've tested via Drupalpod and things look good too. This is now ready for review. It's a big MR but it's a big cleanup, so it's expected.

  • Pipeline finished with Failed
    about 1 month ago
    Total: 426s
    #239623
  • Pipeline finished with Failed
    about 1 month ago
    #239637
  • Pipeline finished with Failed
    about 1 month ago
    Total: 312s
    #239649
  • Pipeline finished with Failed
    about 1 month ago
    Total: 334s
    #239656
  • Status changed to Needs work about 1 month ago
  • 🇪🇸Spain fjgarlin

    Rebased from latest and trying to fix the nightwatch test.

  • Pipeline finished with Failed
    about 1 month ago
    #239667
  • Pipeline finished with Success
    about 1 month ago
    Total: 409s
    #239676
  • Status changed to Needs review about 1 month ago
  • 🇪🇸Spain fjgarlin

    All green after rebase. Back to needs review.

  • 🇮🇳India Prashant.c Dharamshala

    I tried to test it when this Mock source was enabled. It does not get completely removed, Only the source name got removed.

  • 🇮🇳India Prashant.c Dharamshala

    Need a hook_update to delete the config value drupalorg_mockapi from the drupalorg_mockapi.

  • 🇮🇳India Prashant.c Dharamshala
  • Pipeline finished with Canceled
    about 1 month ago
    Total: 170s
    #240183
  • Pipeline finished with Success
    about 1 month ago
    Total: 316s
    #240185
  • 🇪🇸Spain fjgarlin

    Yeah, this was a known issue that was discussed in the MR. Thanks for the commits @prashantc.
    We also need to remove the tables. I named the hook "project_browser_update_9019" as suggested by Chris.

    I added the above and also sorted out the missing hooks using "hook_update_last_removed".

    Ready for review again.

  • Pipeline finished with Canceled
    about 1 month ago
    Total: 307s
    #240319
  • Pipeline finished with Success
    about 1 month ago
    Total: 973s
    #240323
  • 🇮🇪Ireland lostcarpark

    If someone was a couple of versions behind and installs this, the runs "drush updb", they get the following:

    In LegacyServiceInstantiator.php line 192:
                                                                                    
      Class "Drupal\project_browser\Commands\UpdateFixtureCommands" does not exist

    Should we retain a dummy version of this class for legacy updates? I'd guess it's not something we'd want to keep when we move to core, so I'd guess we need to evaluate whether it's worth keeping in play in the short time.

  • 🇪🇸Spain fjgarlin

    Where in the code does that class appear so it gets executed somehow by "drush updb"? I definitely wouldn't want to keep a dummy version of the file. We just need to figure out why is this triggered if there are no instances of it in the code anymore.

  • 🇮🇪Ireland lostcarpark

    Hmmm, I was assuming it was coming from one of the _project_browser_populate_from_fixture() updates, but now I see they've all been removed, so I don't know what's causing this.

  • Status changed to Needs work about 1 month ago
  • 🇪🇸Spain fjgarlin

    I’ll check this. Probably more cleanup needed somewhere.

  • Status changed to Needs review about 1 month ago
  • 🇪🇸Spain fjgarlin

    @lostcarpark - there was still a file that needed to be removed. Done here: https://git.drupalcode.org/project/project_browser/-/merge_requests/554/...

    Hopefully you won't get that warning anymore.

  • 🇮🇳India Prashant.c Dharamshala

    Error mentioned in #13 📌 Remove or demote mock to test folder Needs review was getting triggered from the drush.services.ymlfile.

    The UpdateFixtureCommandsclass was removed therefore removed the drush file as well.

  • 🇪🇸Spain fjgarlin

    On comment #16 I wrote:

    I’ll check this

    And then we've done pretty much the same commit simultaneously.

    @prashantc - I know that you're trying to help but it'd be great if we can coordinate on who's doing what. I'm happy if you want to take over but I just want to avoid duplicate efforts.

  • Pipeline finished with Success
    about 1 month ago
    Total: 343s
    #240613
  • Pipeline finished with Success
    about 1 month ago
    Total: 371s
    #240615
  • 🇮🇪Ireland lostcarpark

    Aha! That seems to have done the trick. Update ran cleanly for me this time.

  • 🇮🇳India Prashant.c Dharamshala

    @prashantc - I know that you're trying to help but it'd be great if we could coordinate on who's doing what. I'm happy if you want to take over but I just want to avoid duplicate efforts.

    @fjgarlin
    Apologies and I agree to avoid duplicate efforts :), I encountered this error on cache clear as well, and then I found that the drush file is not required, unfortunately, we pushed the same change at the same time.

  • 🇪🇸Spain fjgarlin

    It's fine. I'm on slack as well if you need real time replies or checks.

    Hopefully 🤞, this was the last change needed on this MR, but yeah, let's just make a quick comment or give a quick ping if something else comes up. Thanks for helping!

  • Status changed to RTBC about 1 month ago
  • 🇮🇪Ireland lostcarpark

    I've carried out manual testing including upgrading the module, uninstalling, and installing. Everything seems to be working as expected.

    I also reviewed the code changes and they look good.

    All tests have passed in CI.

    I think this is good to go RTBC.

  • Pipeline finished with Skipped
    about 1 month ago
    #245846
  • First commit to issue fork.
  • Status changed to Fixed about 1 month ago
  • 🇺🇸United States chrisfromredfin Portland, Maine

    Woooo! big things are happening. :)

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024