@staff0rd/assist 0.819.0 → 0.819.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/sessions/web/bundle.js +381 -381
- package/dist/index.js +17 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { Command } from "commander";
|
|
|
6
6
|
// package.json
|
|
7
7
|
var package_default = {
|
|
8
8
|
name: "@staff0rd/assist",
|
|
9
|
-
version: "0.819.
|
|
9
|
+
version: "0.819.2",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -35515,12 +35515,17 @@ var SAME_REPO_PATTERN2 = /(?<![\w/#-])#\d+\b/g;
|
|
|
35515
35515
|
function firstMatch(body, pattern2) {
|
|
35516
35516
|
return body.match(pattern2)?.[0] ?? null;
|
|
35517
35517
|
}
|
|
35518
|
-
function checkDescriptionLinksIssue(body) {
|
|
35518
|
+
function checkDescriptionLinksIssue(body, linkedIssues) {
|
|
35519
|
+
if (linkedIssues[0])
|
|
35520
|
+
return {
|
|
35521
|
+
status: "pass",
|
|
35522
|
+
reason: `Development-linked to ${linkedIssues[0]}`
|
|
35523
|
+
};
|
|
35519
35524
|
const reference = firstMatch(body, ISSUE_URL_PATTERN) ?? firstMatch(body, CROSS_REPO_PATTERN) ?? firstMatch(body, SAME_REPO_PATTERN2);
|
|
35520
35525
|
if (!reference)
|
|
35521
35526
|
return {
|
|
35522
35527
|
status: "fail",
|
|
35523
|
-
reason: "no GitHub issue reference (`#123`, `owner/repo#123`, or an issue URL) in the description"
|
|
35528
|
+
reason: "no GitHub issue reference (`#123`, `owner/repo#123`, or an issue URL) in the description and no Development-linked issue"
|
|
35524
35529
|
};
|
|
35525
35530
|
return { status: "pass", reason: `links ${reference}` };
|
|
35526
35531
|
}
|
|
@@ -35625,8 +35630,8 @@ var highLevelChecklist = [
|
|
|
35625
35630
|
{
|
|
35626
35631
|
id: "description-links-issue",
|
|
35627
35632
|
kind: "deterministic",
|
|
35628
|
-
title: "
|
|
35629
|
-
backing: "GitHub issue
|
|
35633
|
+
title: "PR links the GitHub issue it resolves",
|
|
35634
|
+
backing: "A Development-linked issue or a GitHub issue reference in the PR body"
|
|
35630
35635
|
},
|
|
35631
35636
|
{
|
|
35632
35637
|
id: "ui-evidence",
|
|
@@ -35664,7 +35669,7 @@ var highLevelChecklist = [
|
|
|
35664
35669
|
var evaluators = {
|
|
35665
35670
|
"description-what-why": (subject) => checkDescriptionSections(subject.body),
|
|
35666
35671
|
"description-word-cap": (subject) => checkDescriptionWordCap(subject.body, subject.config.descriptionWordCap),
|
|
35667
|
-
"description-links-issue": (subject) => checkDescriptionLinksIssue(subject.body),
|
|
35672
|
+
"description-links-issue": (subject) => checkDescriptionLinksIssue(subject.body, subject.linkedIssues),
|
|
35668
35673
|
"ui-evidence": (subject) => checkUiEvidence(subject.body, subject.changedFiles, subject.config.uiPaths)
|
|
35669
35674
|
};
|
|
35670
35675
|
function evaluateHighLevelChecks(subject) {
|
|
@@ -35710,7 +35715,7 @@ function fetchHighLevelFiles(prNumber, repo) {
|
|
|
35710
35715
|
import { execSync as execSync57 } from "child_process";
|
|
35711
35716
|
function fetchHighLevelPr(prNumber, repo) {
|
|
35712
35717
|
const raw = execSync57(
|
|
35713
|
-
`gh pr view ${prNumber} --json title,body,headRefName,headRefOid -R ${repo.org}/${repo.repo}`,
|
|
35718
|
+
`gh pr view ${prNumber} --json title,body,headRefName,headRefOid,closingIssuesReferences -R ${repo.org}/${repo.repo}`,
|
|
35714
35719
|
{ encoding: "utf8" }
|
|
35715
35720
|
);
|
|
35716
35721
|
const pr = JSON.parse(raw);
|
|
@@ -35718,7 +35723,10 @@ function fetchHighLevelPr(prNumber, repo) {
|
|
|
35718
35723
|
title: pr.title ?? "",
|
|
35719
35724
|
body: pr.body ?? "",
|
|
35720
35725
|
headRef: pr.headRefName,
|
|
35721
|
-
headSha: pr.headRefOid
|
|
35726
|
+
headSha: pr.headRefOid,
|
|
35727
|
+
linkedIssues: pr.closingIssuesReferences.map(
|
|
35728
|
+
(issue) => `${issue.repository.owner.login}/${issue.repository.name}#${issue.number}`
|
|
35729
|
+
)
|
|
35722
35730
|
};
|
|
35723
35731
|
}
|
|
35724
35732
|
|
|
@@ -35784,6 +35792,7 @@ function gatherHighLevelSubject(prNumber, force) {
|
|
|
35784
35792
|
headSha: pr.headSha,
|
|
35785
35793
|
checks: evaluateHighLevelChecks({
|
|
35786
35794
|
body: pr.body,
|
|
35795
|
+
linkedIssues: pr.linkedIssues,
|
|
35787
35796
|
changedFiles: files.map((file) => file.path),
|
|
35788
35797
|
config
|
|
35789
35798
|
}),
|