department-of-veterans-affairs / va.gov-cms

Editor-centered management for Veteran-centered content.
https://prod.cms.va.gov
GNU General Public License v2.0
79 stars 59 forks source link

Add test to look for /merge_requests/*.patch #10065

Open swirtSJW opened 1 year ago

swirtSJW commented 1 year ago

Description

Our patching process should not allow merge request based patches, so as a security precaution we should have a test that checks our composer.json for "/merge_requests/" and fails if it finds it.

The risk?

A patch that comes from the merge request is altered. It will float with the PR. This creates a situation where a MR change on d.o could intentionally or unintentionally break our site or pipeline with no way for us prevent it.

Patches should always be to files that can not change once added to d.o, not dynamically generated from a MR.

Acceptance Criteria

CMS Team

Please check the team(s) that will do this work.

swirtSJW commented 1 year ago

I usually catch these on code review, but I can see in our composer.json that I clearly let one past the goalie.

cweagans commented 1 year ago

FWIW: I wouldn't be opposed to putting this functionality into composer patches itself. There are github URLs and such too that could be excluded.