Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2163 breakout mirador #75

Merged
merged 8 commits into from
Oct 18, 2022
Merged

2163 breakout mirador #75

merged 8 commits into from
Oct 18, 2022

Conversation

alxp
Copy link
Contributor

@alxp alxp commented Sep 9, 2022

GitHub Issue: (link)

Islandora/documentation#2163

Mirador module to be moved to Islandora organization: https://github.com/alxp/islandora_mirador

What does this Pull Request do?

Remove islandora_mirador so it can be a standalone module.

What's new?

Islandora Mirador will be moved to a separate module.

  • Does this change require documentation to be updated? No
  • Does this change add any new dependencies? implicit islandora_mirador module
  • Does this change require any other modifications to be made to the repository
    (i.e. Regeneration activity, etc.)? No
  • Could this change impact execution of existing code? TBD

How should this be tested?

When a PR to introduce the islandora_mirador module to Islandora is created, installing that module should, via a composer conflict config, trigger this module to be updated.

Then Clear cache, restart your web server, and interact with Mirador as you normally would�..

Additional Notes:

Any additional information that you think would be helpful when reviewing this
PR.

You can't as far as I know declare that a module is incompatible with a range of commits on e.g. a dev branch so if your installation relies on a dev branch of islandora_defaults the conflict will not appear.

Updating the module versions in composer should still pull down compatible versions however, once this PR is merged and a point release is made.

Interested parties

Tag (@ mention) interested parties or, if unsure, @Islandora/8-x-committers

@alxp
Copy link
Contributor Author

alxp commented Sep 12, 2022

The CI failure seems to be in error. I also edited the README to give it at least one changed file but it still fails.

Is the CI script as it currently exists expecting there to be code changes to run successfully?

image

@whikloj
Copy link
Member

whikloj commented Sep 12, 2022

That is a weird one, it's like phpcpd is looking in the wrong place.

@alxp
Copy link
Contributor Author

alxp commented Sep 12, 2022

Looks like this is a known open issue with PHPCPD v. 6.0.3

sebastianbergmann/phpcpd#147

Since this issue is open we could perhaps pin phpcpd to v. 6.0.2

@alxp
Copy link
Contributor Author

alxp commented Sep 13, 2022

I've found the issue, it's in how phpcpd is invoked in islandora_ci:

phpcpd is invoked via this command

travis_scripts.sh:phpcpd --suffix *.module,*.inc,*.test,*.php $GITHUB_WORKSPACE/build_dir

From the phpcpd command help text

  --suffix <suffix> Include files with names ending in <suffix> in the analysis
(default: .php; can be given multiple times)

"Can be given multiple times" tells me that you can't actually have multiple extensions separated by a comma as above.

It looks like the way the program parses the command-line argument makes it only use the last one, in this case *.php.

Islandora Mirador is the only module currently part of Islandora Defaults that has an actual .php file inside it, so removing it causes the job to display the "no files found" message.

vagrant@islandora8:/var/www/html/drupal/web/modules/contrib/islandora_defaults$ git checkout 2163-breakout-mirador 
Switched to branch '2163-breakout-mirador'
vagrant@islandora8:/var/www/html/drupal/web/modules/contrib/islandora_defaults$ phpcpd --suffix *.php  .
phpcpd 6.0.3 by Sebastian Bergmann.

No files found to scan
vagrant@islandora8:/var/www/html/drupal/web/modules/contrib/islandora_defaults$ echo $?
1

This error happens with all 6.0.x versions of phpcpd. But if we invoke it correctly no error is shown:

vagrant@islandora8:/var/www/html/drupal/web/modules/contrib/islandora_defaults$ phpcpd --suffix *.php --suffix *.module --suffix *.inc --suffix *.install --suffix *.test .
phpcpd 6.0.3 by Sebastian Bergmann.

No clones found.

Time: 00:00.008, Memory: 4.00 MB
vagrant@islandora8

I know more than I care to about this utility now.

I'll make a PR for islandora_ci.

@alxp
Copy link
Contributor Author

alxp commented Sep 14, 2022

Marked as draft until Islandora/islandora_ci#16 is merged so I can continue testing the new CI failure.

This prevents the situation where a module is sitll enabled but has been
deleted from the code base.
@alxp
Copy link
Contributor Author

alxp commented Sep 21, 2022

Once @inikolaidis adds islandora/islandora_mirador to Packagist this can be taken out of draft and tested / merged.

It now requires islandora_mirador in composer so a site is not left with an enabled module that has been deleted from the code base.

@alxp
Copy link
Contributor Author

alxp commented Oct 11, 2022

Taking this out of draft since islandora_mirador has been put up on Packagist.

@alxp
Copy link
Contributor Author

alxp commented Oct 12, 2022

Re-ran failing tests, the failure seemed to be in composer not finding the islandora/island package.

No error on most recent run.ora_mirador

This reverts commit b7030b6.

Put CI back to normal.
@adam-vessey
Copy link
Contributor

Should we consider this a major version bump? Then, the conflict declaration in islandora_mirador can just target anything less than major version 3 (looks like the demo playbook dealio rolls 2.x-dev, so the bump to 3 should address conflicting appropriately).

... otherwise, yeah, seems to do the trick:

  1. Up'd a demo version of islandora-playbook

  2. Ingested a "paged content" object with a single "page" child

  3. Enabled islandora_mirador

  4. Updated the paged_content_mirador context to place the "Mirador block" in the "Islandora Starter Theme", with manifest URL http://localhost:8000/node/[node:nid]/book-manifest

  5. Set the display hint to "Mirador" in the earlier-ingested "paged content" object; it works!

  6. Grabbed islandora/islandora_mirador; which did not conflict, due to the project spec'ing 2.x-dev

    vagrant@islandora8:/var/www/html/drupal$ composer require islandora/islandora_mirador
    composer/installers contains a Composer plugin which is currently not in your allow-plugins config. See https://getcomposer.org/allow-plugins
    Do you trust "composer/installers" to execute code and wish to enable it now? (writes "allow-plugins" to composer.json) [y,n,d,?] y
    [... bunch of other plugins being added, snip'd for brevity ...]
    Info from https://repo.packagist.org: #StandWithUkraine
    Using version ^2.2 for islandora/islandora_mirador
    ./composer.json has been updated
    Running composer update islandora/islandora_mirador
    Loading composer repositories with package information
    Updating dependencies
    Lock file operations: 1 install, 0 updates, 0 removals
      - Locking islandora/islandora_mirador (2.2.0)
    Writing lock file
    Installing dependencies from lock file (including require-dev)
    Package operations: 1 install, 0 updates, 0 removals
      - Downloading islandora/islandora_mirador (2.2.0)
      - Installing islandora/islandora_mirador (2.2.0): Extracting archive
    Package doctrine/reflection is abandoned, you should avoid using it. Use roave/better-reflection instead.
    Package silex/silex is abandoned, you should avoid using it. Use symfony/flex instead.
    Package webmozart/path-util is abandoned, you should avoid using it. Use symfony/filesystem instead.
    Generating autoload files
    80 packages you are using are looking for funding.
    Use the `composer fund` command to find out more!
    Found 15 security vulnerability advisories affecting 7 packages.
    Run composer audit for a full list of advisories.
    vagrant@islandora8:/var/www/html/drupal$
    
  7. Updated islandora/islandora_defaults:

    vagrant@islandora8:/var/www/html/drupal$ composer require "islandora/islandora_defaults:dev-2163-breakout-mirador as 2.x-dev"
    ./composer.json has been updated
    Running composer update islandora/islandora_defaults
    Loading composer repositories with package information
    Updating dependencies
    Lock file operations: 0 installs, 1 update, 0 removals
      - Upgrading islandora/islandora_defaults (2.x-dev b1d6d0d => dev-2163-breakout-mirador 57b44cc)
    Writing lock file
    Installing dependencies from lock file (including require-dev)
    Package operations: 0 installs, 1 update, 0 removals
      - Downloading islandora/islandora_defaults (dev-2163-breakout-mirador 57b44cc)
      - Upgrading islandora/islandora_defaults (2.x-dev b1d6d0d => dev-2163-breakout-mirador 57b44cc): Extracting archive
    Package doctrine/reflection is abandoned, you should avoid using it. Use roave/better-reflection instead.
    Package silex/silex is abandoned, you should avoid using it. Use symfony/flex instead.
    Package webmozart/path-util is abandoned, you should avoid using it. Use symfony/filesystem instead.
    Generating autoload files
    80 packages you are using are looking for funding.
    Use the `composer fund` command to find out more!
    Found 15 security vulnerability advisories affecting 7 packages.
    Run composer audit for a full list of advisories.
    vagrant@islandora8:/var/www/html/drupal$
    
  8. drush cr'd; not working (but not yet fully following the directions for testing), getting errors such as:

    Warning: include(/var/www/html/drupal/web/modules/contrib/islandora_defaults/modules/islandora_mirador/src/Plugin/Block/MiradorBlock.php): failed to open stream: No such file or directory in include() (line 571 of /var/www/html/drupal/vendor/composer/ClassLoader.php) 
    
    Warning: include(): Failed opening '/var/www/html/drupal/web/modules/contrib/islandora_defaults/modules/islandora_mirador/src/Plugin/Block/MiradorBlock.php' for inclusion (include_path='/var/www/html/drupal/vendor/pear/archive_tar:/var/www/html/drupal/vendor/pear/console_getopt:/var/www/html/drupal/vendor/pear/pear-core-minimal/src:/var/www/html/drupal/vendor/pear/pear_exception:.:/usr/share/php') in include() (line 571 of /var/www/html/drupal/vendor/composer/ClassLoader.php)
    
    Drupal\Component\Plugin\Exception\PluginException: Plugin (mirador_block) instance class "Drupal\islandora_mirador\Plugin\Block\MiradorBlock" does not exist. in Drupal\Component\Plugin\Factory\DefaultFactory::getPluginClass() (line 97 of /var/www/html/drupal/web/core/lib/Drupal/Component/Plugin/Factory/DefaultFactory.php).
    
  9. Restarted the webserver: sudo systemctl restart apache2 ... and everything started working, so woo!

@alxp
Copy link
Contributor Author

alxp commented Oct 18, 2022

Making it 3.x makes sense to me, Islandora Defaults the twilight era.

@adam-vessey adam-vessey changed the base branch from 2.x to 3.x October 18, 2022 14:52
@adam-vessey adam-vessey merged commit 443fca7 into 3.x Oct 18, 2022
@rosiel rosiel deleted the 2163-breakout-mirador branch October 18, 2022 22:52
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