This repository has been archived by the owner on Jul 1, 2024. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The code for a
dangerLevel
ofMultiplePackagesEdited
was broken:it used
noNulls
over a list of booleans, which means thatMultiplePackagesEdited
corresponded with just having multiplepackages (not taking into account tests or criticals). This changes
the code to use just a simple count of packages for now.
I tried to fix it, but that exposes a problem with
dangerLevel
ingeneral: it is sometimes used as an indicator for a single package
literally (eg, allow all owners to request a merge if it starts with
"Scoped") and sometimes as a generic danger situation. This is likely
my fault since pretty much any use of it confused me (since it's
defined as a hard-to-remember combination of different things).
For the same reason, I think that it'd be best to try to remove it and
use the information directly. Some of the following changes are going
in this direction. I will revisit the issues around it when this is
done (eg Improve "multiple packages" label? #206 / Don't take test files into account when looking at whether a package affects multiple packages #155).
Use an extended
editsInfra
field instead ofdangerLevel === "Infrastructure"
.Working toward the above, move the
getDangerLevel
computation (andthe
dangerLevel
field, and theDangerLevel
type) toExtendedPrInfo
since there are no more uses of it inpr-info
. Thenext step is to split it into fields that express the relevant parts
instead of a single level value.
Move
authorIsOwner
from aPrInfo
field to a computedExtendedPrInfo
one. It's meaning is also changed: previously, itwould be on if the author is an owner of any package, and now it's
on if the author is an owner of all packages (if more than one).
This currently affects only the corresponding label. Two
tests (45836, 45946) updated for this.
Aggregate all review info into a single
getReviews
(much revisedfrom
analyzeReviews
) that returns areview: ReviewInfo[]
, holdingall of the relevant information. Remove all of the other fields, and
add the ones that are needed into the
ExtendedPrInfo
.There are some minor diffeences --- for example, previously all stale
reviews were kept, and now it's only one review kind per person so at
most one stale review. These differences only affect the derived
information, but no test changes.
Note that the computation of
approvalFlags
moved toextendPrInfo
(in
compute-pr-actions
), where it can be changed to adapt it toaddress People should not be able to self-merge until maintainers of all affected packages have approved a change. #178.