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

CommentFileSizeAuthor
#9 mock-source.png21.7 KBprashant.c
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

fjgarlin created an issue. See original summary.

lostcarpark’s picture

Keeping the mock API available for tests sounds useful.

fjgarlin’s picture

Status: Active » Needs work

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.

Currently only two test files are failing:
* The failing Kernel test seems to fail because the “inserts” that run on the install hook either don’t run or don’t find the fixture files.
* The failing Functional test is failing to find the Browse tab.

fjgarlin’s picture

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

fjgarlin’s picture

Status: Needs work » Needs review

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.

fjgarlin’s picture

Status: Needs review » Needs work

Rebased from latest and trying to fix the nightwatch test.

fjgarlin’s picture

Status: Needs work » Needs review

All green after rebase. Back to needs review.

prashant.c’s picture

StatusFileSize
new21.7 KB

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

prashant.c’s picture

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

prashant.c’s picture

fjgarlin’s picture

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.

lostcarpark’s picture

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.

fjgarlin’s picture

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.

lostcarpark’s picture

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.

fjgarlin’s picture

Status: Needs review » Needs work

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

fjgarlin’s picture

Status: Needs work » Needs review

@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.

prashant.c’s picture

Error mentioned in #13 was getting triggered from the drush.services.ymlfile.

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

fjgarlin’s picture

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.

lostcarpark’s picture

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

prashant.c’s picture

@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.

fjgarlin’s picture

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!

lostcarpark’s picture

Status: Needs review » Reviewed & tested by the community

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.

chrisfromredfin made their first commit to this issue’s fork.

chrisfromredfin’s picture

Status: Reviewed & tested by the community » Fixed

Woooo! big things are happening. :)

Status: Fixed » Closed (fixed)

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