github-issue-tower-defence-management 2.195.3 → 2.195.5
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/bin/adapter/entry-points/console/consoleAirplaneSnapshotApi.js +1 -0
- package/bin/adapter/entry-points/console/consoleAirplaneSnapshotApi.js.map +1 -1
- package/bin/adapter/entry-points/console/consoleOperationApi.js +129 -16
- package/bin/adapter/entry-points/console/consoleOperationApi.js.map +1 -1
- package/bin/adapter/entry-points/console/consoleReadApi.js +4 -1
- package/bin/adapter/entry-points/console/consoleReadApi.js.map +1 -1
- package/bin/adapter/entry-points/console/ui-dist/assets/index-BLvvLwaO.js +104 -0
- package/bin/adapter/entry-points/console/ui-dist/index.html +1 -1
- package/bin/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.js +54 -14
- package/bin/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.js.map +1 -1
- package/package.json +1 -1
- package/types/adapter/entry-points/console/consoleAirplaneSnapshotApi.d.ts +2 -1
- package/types/adapter/entry-points/console/consoleAirplaneSnapshotApi.d.ts.map +1 -1
- package/types/adapter/entry-points/console/consoleOperationApi.d.ts.map +1 -1
- package/types/adapter/entry-points/console/consoleReadApi.d.ts +2 -1
- package/types/adapter/entry-points/console/consoleReadApi.d.ts.map +1 -1
- package/types/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.d.ts +2 -0
- package/types/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.d.ts.map +1 -1
- package/types/domain/usecases/adapter-interfaces/IssueRepository.d.ts +3 -0
- package/types/domain/usecases/adapter-interfaces/IssueRepository.d.ts.map +1 -1
- package/bin/adapter/entry-points/console/ui-dist/assets/index-Cx_saspS.js +0 -104
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
7
7
|
<link rel="manifest" href="/manifest.webmanifest" />
|
|
8
8
|
<title>TDPM Console</title>
|
|
9
|
-
<script type="module" crossorigin src="/assets/index-
|
|
9
|
+
<script type="module" crossorigin src="/assets/index-BLvvLwaO.js"></script>
|
|
10
10
|
<link rel="stylesheet" crossorigin href="/assets/index-CV1jZcpP.css">
|
|
11
11
|
</head>
|
|
12
12
|
<body>
|
|
@@ -76,13 +76,26 @@ function isRequiredCheckNamesDiskCache(value) {
|
|
|
76
76
|
Array.isArray(value.names) &&
|
|
77
77
|
value.names.every((n) => typeof n === 'string'));
|
|
78
78
|
}
|
|
79
|
+
function isCachedRelatedOpenPr(value) {
|
|
80
|
+
if (typeof value !== 'object' || value === null)
|
|
81
|
+
return false;
|
|
82
|
+
return ('ciStatusAvailability' in value &&
|
|
83
|
+
(value.ciStatusAvailability === 'AVAILABLE' ||
|
|
84
|
+
value.ciStatusAvailability === 'UNAVAILABLE'));
|
|
85
|
+
}
|
|
79
86
|
function isCachedRelatedOpenPrs(value) {
|
|
80
87
|
if (typeof value !== 'object' || value === null)
|
|
81
88
|
return false;
|
|
82
89
|
return ('fetchedAtMs' in value &&
|
|
83
90
|
typeof value.fetchedAtMs === 'number' &&
|
|
84
91
|
'prs' in value &&
|
|
85
|
-
Array.isArray(value.prs)
|
|
92
|
+
Array.isArray(value.prs) &&
|
|
93
|
+
value.prs.every(isCachedRelatedOpenPr));
|
|
94
|
+
}
|
|
95
|
+
function filterRelatedOpenPrsByCiStatusAvailability(prs, includeCiStatusUnavailable) {
|
|
96
|
+
if (includeCiStatusUnavailable)
|
|
97
|
+
return prs;
|
|
98
|
+
return prs.filter((pr) => pr.ciStatusAvailability !== 'UNAVAILABLE');
|
|
86
99
|
}
|
|
87
100
|
const SELF_AUTHORED_REVIEW_REFUSAL = 'Can not request changes on your own pull request';
|
|
88
101
|
// One GraphQL query carrying this many aliased pull requests costs the same
|
|
@@ -1284,6 +1297,7 @@ class ApiV3CheerioRestIssueRepository extends BaseGitHubRepository_1.BaseGitHubR
|
|
|
1284
1297
|
isBranchOutOfDate: false,
|
|
1285
1298
|
missingRequiredCheckNames,
|
|
1286
1299
|
reviewDecision: data.reviewDecision ?? null,
|
|
1300
|
+
ciStatusAvailability: 'AVAILABLE',
|
|
1287
1301
|
};
|
|
1288
1302
|
};
|
|
1289
1303
|
this.requiredCheckNamesCache = new Map();
|
|
@@ -1708,6 +1722,20 @@ class ApiV3CheerioRestIssueRepository extends BaseGitHubRepository_1.BaseGitHubR
|
|
|
1708
1722
|
reviewThreads: slimPullRequest.reviewThreads,
|
|
1709
1723
|
});
|
|
1710
1724
|
};
|
|
1725
|
+
this.buildRelatedPullRequestWithUnknownCiStatus = (slimPullRequest) => ({
|
|
1726
|
+
...this.computePrStatus(slimPullRequest.url, slimPullRequest.headRefName, {
|
|
1727
|
+
isDraft: slimPullRequest.isDraft,
|
|
1728
|
+
mergeable: slimPullRequest.mergeable,
|
|
1729
|
+
reviewDecision: slimPullRequest.reviewDecision,
|
|
1730
|
+
requiredCheckNames: [],
|
|
1731
|
+
ciContexts: [],
|
|
1732
|
+
reviewThreads: slimPullRequest.reviewThreads,
|
|
1733
|
+
}),
|
|
1734
|
+
isPassedAllCiJob: false,
|
|
1735
|
+
isCiStateSuccess: false,
|
|
1736
|
+
missingRequiredCheckNames: [],
|
|
1737
|
+
ciStatusAvailability: 'UNAVAILABLE',
|
|
1738
|
+
});
|
|
1711
1739
|
this.resolveMergeabilityWithRetry = async (owner, repo, prNumber) => {
|
|
1712
1740
|
const query = `
|
|
1713
1741
|
query PullRequestMergeability($owner: String!, $repo: String!, $prNumber: Int!) {
|
|
@@ -1760,16 +1788,17 @@ class ApiV3CheerioRestIssueRepository extends BaseGitHubRepository_1.BaseGitHubR
|
|
|
1760
1788
|
if (isPr) {
|
|
1761
1789
|
throw new Error('findRelatedOpenPRs only supports issue URLs, not pull request URLs');
|
|
1762
1790
|
}
|
|
1791
|
+
const includeCiStatusUnavailable = options?.includeCiStatusUnavailable === true;
|
|
1763
1792
|
const nowMs = (await this.dateRepository.now()).getTime();
|
|
1764
1793
|
const cacheKey = `related-open-prs/${owner}/${repo}/${issueNumber}`;
|
|
1765
1794
|
const cachedRaw = await this.localStorageCacheRepository.getSingle(cacheKey);
|
|
1766
1795
|
if (!options?.bypassCache &&
|
|
1767
1796
|
isCachedRelatedOpenPrs(cachedRaw) &&
|
|
1768
1797
|
nowMs - cachedRaw.fetchedAtMs < exports.RELATED_OPEN_PRS_CACHE_TTL_MS) {
|
|
1769
|
-
return cachedRaw.prs.map((pr) => ({
|
|
1798
|
+
return filterRelatedOpenPrsByCiStatusAvailability(cachedRaw.prs.map((pr) => ({
|
|
1770
1799
|
...pr,
|
|
1771
1800
|
createdAt: new Date(pr.createdAt),
|
|
1772
|
-
}));
|
|
1801
|
+
})), includeCiStatusUnavailable);
|
|
1773
1802
|
}
|
|
1774
1803
|
const query = `
|
|
1775
1804
|
query IssueRelatedOpenPullRequests($owner: String!, $repo: String!, $issueNumber: Int!, $after: String) {
|
|
@@ -1870,26 +1899,37 @@ class ApiV3CheerioRestIssueRepository extends BaseGitHubRepository_1.BaseGitHubR
|
|
|
1870
1899
|
}
|
|
1871
1900
|
if (pr.number === undefined)
|
|
1872
1901
|
continue;
|
|
1873
|
-
let
|
|
1902
|
+
let slimPullRequest;
|
|
1874
1903
|
try {
|
|
1875
|
-
const
|
|
1876
|
-
if (!
|
|
1904
|
+
const fetchedSlimPullRequest = await this.fetchSlimPullRequest(prOwner, prRepo, pr.number);
|
|
1905
|
+
if (!fetchedSlimPullRequest ||
|
|
1906
|
+
fetchedSlimPullRequest.state !== 'OPEN') {
|
|
1877
1907
|
console.info(`ApiV3CheerioRestIssueRepository: pull request is no longer open, excluding it from related open PRs. prUrl: ${prUrl}`);
|
|
1878
1908
|
continue;
|
|
1879
1909
|
}
|
|
1880
|
-
|
|
1881
|
-
prStatus = await this.buildRelatedPullRequestFromSlim(prOwner, prRepo, {
|
|
1882
|
-
...slimPullRequest,
|
|
1883
|
-
url: slimPullRequest.url || prUrl,
|
|
1884
|
-
headRefName: slimPullRequest.headRefName ?? pr.headRefName,
|
|
1885
|
-
baseRefName,
|
|
1886
|
-
});
|
|
1910
|
+
slimPullRequest = fetchedSlimPullRequest;
|
|
1887
1911
|
}
|
|
1888
1912
|
catch (error) {
|
|
1889
1913
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
1890
1914
|
console.warn(`ApiV3CheerioRestIssueRepository: fetching pull request status failed, skipping PR for this cycle. prUrl: ${prUrl} error: ${errorMessage}`);
|
|
1891
1915
|
continue;
|
|
1892
1916
|
}
|
|
1917
|
+
const baseRefName = slimPullRequest.baseRefName ?? pr.baseRefName ?? pr.baseRef?.name;
|
|
1918
|
+
const slimPullRequestWithRefs = {
|
|
1919
|
+
...slimPullRequest,
|
|
1920
|
+
url: slimPullRequest.url || prUrl,
|
|
1921
|
+
headRefName: slimPullRequest.headRefName ?? pr.headRefName,
|
|
1922
|
+
baseRefName,
|
|
1923
|
+
};
|
|
1924
|
+
let prStatus;
|
|
1925
|
+
try {
|
|
1926
|
+
prStatus = await this.buildRelatedPullRequestFromSlim(prOwner, prRepo, slimPullRequestWithRefs);
|
|
1927
|
+
}
|
|
1928
|
+
catch (error) {
|
|
1929
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
1930
|
+
console.warn(`ApiV3CheerioRestIssueRepository: fetching pull request CI status failed, keeping PR with unknown CI status. prUrl: ${prUrl} error: ${errorMessage}`);
|
|
1931
|
+
prStatus = this.buildRelatedPullRequestWithUnknownCiStatus(slimPullRequestWithRefs);
|
|
1932
|
+
}
|
|
1893
1933
|
relatedPRsMap.set(prUrl, {
|
|
1894
1934
|
...prStatus,
|
|
1895
1935
|
isConflicted,
|
|
@@ -1905,7 +1945,7 @@ class ApiV3CheerioRestIssueRepository extends BaseGitHubRepository_1.BaseGitHubR
|
|
|
1905
1945
|
fetchedAtMs: nowMs,
|
|
1906
1946
|
prs: prs.map((pr) => ({ ...pr, createdAt: pr.createdAt.toISOString() })),
|
|
1907
1947
|
});
|
|
1908
|
-
return prs;
|
|
1948
|
+
return filterRelatedOpenPrsByCiStatusAvailability(prs, includeCiStatusUnavailable);
|
|
1909
1949
|
};
|
|
1910
1950
|
this.isRelatedOpenPullRequestTimelineItem = (item, issueUrl) => {
|
|
1911
1951
|
if (!item)
|