This repository was archived by the owner on Jul 1, 2024. It is now read-only.
Additional refactoring#234
Merged
orta merged 1 commit intoDefinitelyTyped:masterfrom Nov 24, 2020
elibarzilay:more-revisions
Merged
Additional refactoring#234orta merged 1 commit intoDefinitelyTyped:masterfrom elibarzilay:more-revisions
orta merged 1 commit intoDefinitelyTyped:masterfrom
elibarzilay:more-revisions
Conversation
* Switch `Action.labels` from an object to a list of labels
Since there are now many labels, this makes the test files smaller,
and also the labels are much easier to read. Also, the code is a bit
simpler (modulo the `as const` thing).
- Very minor caveat: the order of labels in the result is sometimes
different now.
- Very minor bonus: test 44402 has the only difference, which is due
to a very minor fix. Previously, if the labels were `{X: true}`,
then the `execute-pr-actions` code would only touch that. There's a
bit in `compute-pr-actions` that returns `labels: ["Edits
Infrastructure"]`, which previously made it add that label but leave
all others, whereas now other (known) labels are removed.
* In preparation for the timeline change:
- Replace `stalenessInDays` with `lastActivityDate` (so staleness is
computed later).
- Remove unused `reopenedDate`, `lastCommentDate`.
* Also:
- Switch from the `ApprovalFlags` bitmap to a `ApproverKind[]` with a
matching classification of each review.
- Add `needsAuthorAction`.
- Add a convenient `post` function to make comment-posting code more
readable.
- Add a `:passport_control:` to the reply for premature merge
requests.
- Reindent and refactor `execute-pr-actions` to make it more functional.
- Slightly clearer definitions for `earliestDate`, `latestDate`.
- Switch `import * as Comment` -> `comment`.
orta
reviewed
Nov 24, 2020
| "reopenedDate": "2019-10-18T22:52:06.000Z", | ||
| "lastCommentDate": "2020-05-12T15:13:19.000Z", | ||
| "lastActivityDate": "2020-05-12T15:13:19.000Z", | ||
| "maintainerBlessed": false, |
orta
reviewed
Nov 24, 2020
| "input": { | ||
| "subjectId": "MDExOlB1bGxSZXF1ZXN0NTAwNjg4ODM0", | ||
| "body": "Hi @mgol, I can't [accept a merge request](https://github.com/DefinitelyTyped/DefinitelyTyped#make-a-pull-request) until the PR has a green CI and was appropriately reviewed. I will let you know once that happens.\n\nThanks, and happy typing!\n<!--typescript_bot_wait-for-merge-offer-06d8d67-->" | ||
| "body": ":passport_control: Hi @mgol,\n\nI can't [accept a merge request](https://github.com/DefinitelyTyped/DefinitelyTyped#make-a-pull-request) until the PR has a green CI and was appropriately reviewed. I will let you know once that happens.\n\nThanks, and happy typing!\n<!--typescript_bot_wait-for-merge-offer-06d8d67-->" |
orta
reviewed
Nov 24, 2020
| return who === "maintainers" && blessed && !noOtherOwners ? "owners" | ||
| : who === "owners" && noOtherOwners ? "maintainers" | ||
| return who === "maintainer" && blessed && !noOtherOwners ? "owner" | ||
| : who === "owner" && noOtherOwners ? "maintainer" |
Contributor
There was a problem hiding this comment.
Good call on the plural -> singular, feels better
orta
approved these changes
Nov 24, 2020
Contributor
|
Nice wrk 👍 |
Contributor
Author
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Switch
Action.labelsfrom an object to a list of labelsSince there are now many labels, this makes the test files smaller,
and also the labels are much easier to read. Also, the code is a bit
simpler (modulo the
as constthing).Very minor caveat: the order of labels in the result is sometimes
different now.
Very minor bonus: test 44402 has the only difference, which is due
to a very minor fix. Previously, if the labels were
{X: true},then the
execute-pr-actionscode would only touch that. There's abit in
compute-pr-actionsthat returnslabels: ["Edits Infrastructure"], which previously made it add that label but leaveall others, whereas now other (known) labels are removed.
In preparation for the timeline change:
Replace
stalenessInDayswithlastActivityDate(so staleness iscomputed later).
Remove unused
reopenedDate,lastCommentDate.Also:
Switch from the
ApprovalFlagsbitmap to aApproverKind[]with amatching classification of each review.
Add
needsAuthorAction.Add a convenient
postfunction to make comment-posting code morereadable.
Add a
:passport_control:to the reply for premature mergerequests.
Reindent and refactor
execute-pr-actionsto make it more functional.Slightly clearer definitions for
earliestDate,latestDate.Switch
import * as Comment->comment.