Problem/Motivation

#3307163: Add the ability to ProjectInfo handle projects not in the active codebase follow-up

right now it is up to any module that uses package_manager to check drupal.org XML to check that any releases are secure, published and supported and that project itself is supported

That means there will be a lot of duplication and package_manager itself will install insecure releases.

Proposed resolution

After #3307163: Add the ability to ProjectInfo handle projects not in the active codebase is done all new or updated packages that start with `drupal/` and are projects that would have Update XML should be checked with Update XML.

  1. Create new \Drupal\package_manager\Validator\ReleaseValidator this would similar to \Drupal\automatic_updates_extensions\Validator\UpdateReleaseValidator except it should only subscribe to PreApply and it should check updated as well as new packages
  2. Add kernel test for the new validator
  3. Remove the PreApply logic in \Drupal\automatic_updates_extensions\Validator\UpdateReleaseValidator. This should be covered by the new validator
  4. follow-up #3303900: Remove PreApply check in PackagesInstalledWithComposerValidator

This is mean this validation would apply to all modules that use Package Manager.

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

tedbow created an issue. See original summary.

tedbow’s picture

Issue summary: View changes
tedbow’s picture

tedbow’s picture

Priority: Normal » Major
narendrar’s picture

tedbow’s picture

Status: Postponed » Active
tedbow’s picture

Issue summary: View changes

kunal.sachdev made their first commit to this issue’s fork.

kunal.sachdev’s picture

Assigned: Unassigned » kunal.sachdev
tedbow’s picture

Status: Active » Needs work

Changing to Needs work to indicate there is any active merge request

"Active" means work has not started on the code change

kunal.sachdev’s picture

kunal.sachdev’s picture

Status: Needs work » Needs review
phenaproxima’s picture

Title: Validate all changed or updated Drupal projects with Update XML » [PP-1] Validate all changed or updated Drupal projects with Update XML
Status: Needs review » Postponed
Related issues: +#3305564: Create a validator to stop newly installed packages from overwriting existing directories on apply

In that case, let's postpone this issue on that one.

phenaproxima’s picture

Title: [PP-1] Validate all changed or updated Drupal projects with Update XML » Validate all changed or updated Drupal projects with Update XML
Status: Postponed » Needs work

I just committed the blocker.

kunal.sachdev’s picture

Status: Needs work » Needs review
phenaproxima’s picture

Status: Needs review » Needs work

I think this makes sense.

My main concerns are about fixture drift, where we add a lot of fixtures that aren't very well documented or clear as to their purpose. I want to correct existing problems with this in #3309486: [meta] Make all fixtures consistent, but I also don't want to introduce more issues here. :)

It's also not going to fly for Package Manager tests to extend Automatic Updates' test classes; instead, we should move whatever methods we need from AU into Package Manager.

My final overarching issue is that this seems to introduce a pervasive need to disable the supported releases validator in several tests. Disabling validators is something we should always seek to avoid, unless there's no other option. I think we might still be able to get around the validator by making most of our fixtures' stub modules of the drupal-custom-module type.

phenaproxima’s picture

Been thinking about this a lot and I think that the right thing to do is proceed with disabling the validator in the tests that need to disable it, at least for now, but over in #3309486: [meta] Make all fixtures consistent, we should change our fixtures so they only use test modules that we have fake release data for.

That means we'll probably need to create a bunch of reusable stub modules (and at least one stub theme), and a bunch of release XML for each one.

This is really only a problem since Package Manager became aware of project history. It no longer makes sense to have fixtures that refer to projects with no history.

kunal.sachdev’s picture

Assigned: kunal.sachdev » Unassigned
phenaproxima’s picture

@kunal.sachdev, it turns out the problem you're running into (I did as well) is due to #3308686: Logic error in XdebugValidator. I reviewed and committed that, and have merged it back into this branch, so I think you'll be all set now.

kunal.sachdev’s picture

Status: Needs work » Needs review
phenaproxima’s picture

Status: Needs review » Needs work

One nit, then I think I'm happy with the way this looks.

kunal.sachdev’s picture

Status: Needs work » Needs review
phenaproxima’s picture

Status: Needs review » Reviewed & tested by the community

No further objections here. We'll clean up the fixtures and re-enable the disabled validator in subsequent issues, since that depends on us having coherent release history for all stub modules known to Drupal.

Awesome work, @kunal.sachdev. Thanks for sticking with it so persistently.

drumm’s picture

tedbow’s picture

Status: Reviewed & tested by the community » Needs work

couples questions on this

If I am correct about the missing test coverage this could be added. the duplicate fixtures could be solved in a follow-up

kunal.sachdev’s picture

Status: Needs work » Needs review
tedbow’s picture

Status: Needs review » Reviewed & tested by the community

Looks good!

  • tedbow committed 612c194 on 8.x-2.x
    Issue #3307369 by kunal.sachdev, tedbow, phenaproxima: Validate all...
tedbow’s picture

Status: Reviewed & tested by the community » Fixed

🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉
@kunal.sachdev and @phenaproxima thanks! 🎉 🎉 🎉
Huge win security and package_manager 🎉 🎉 🎉 🎉
🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉

Status: Fixed » Closed (fixed)

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

tedbow’s picture

Issue tags: +core-mvp