paperclip-github-plugin 0.8.10 → 0.8.12

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/worker.js CHANGED
@@ -2857,21 +2857,10 @@ async function buildToolbarSyncState(ctx, input) {
2857
2857
  if (entityType === "issue" && entityId && companyId) {
2858
2858
  const link = await resolvePaperclipIssueGitHubLink(ctx, entityId, companyId);
2859
2859
  if (link) {
2860
- const mappings2 = getSyncableMappingsForTarget(settings.mappings, {
2861
- kind: "issue",
2862
- companyId,
2863
- projectId: link.paperclipProjectId,
2864
- issueId: entityId,
2865
- repositoryUrl: link.repositoryUrl,
2866
- githubIssueId: link.githubIssueId,
2867
- githubIssueNumber: link.githubIssueNumber,
2868
- githubIssueUrl: link.githubIssueUrl,
2869
- displayLabel: `issue #${link.githubIssueNumber}`
2870
- });
2871
2860
  return {
2872
2861
  kind: "issue",
2873
2862
  visible: false,
2874
- canRun: githubTokenConfigured && mappings2.length > 0,
2863
+ canRun: githubTokenConfigured,
2875
2864
  label: `Sync #${link.githubIssueNumber}`,
2876
2865
  message: `Sync ${link.repositoryUrl.replace(/^https:\/\/github\.com\//, "")} issue #${link.githubIssueNumber}.`,
2877
2866
  syncState: settings.syncState,
@@ -2880,20 +2869,10 @@ async function buildToolbarSyncState(ctx, input) {
2880
2869
  };
2881
2870
  }
2882
2871
  const pullRequestLink = await resolvePaperclipIssueGitHubPullRequestLink(ctx, entityId, companyId);
2883
- const mappings = pullRequestLink ? getSyncableMappingsForTarget(settings.mappings, {
2884
- kind: "issue",
2885
- companyId,
2886
- projectId: pullRequestLink.data.paperclipProjectId,
2887
- issueId: entityId,
2888
- repositoryUrl: pullRequestLink.data.repositoryUrl,
2889
- githubPullRequestNumber: pullRequestLink.data.githubPullRequestNumber,
2890
- githubPullRequestUrl: pullRequestLink.data.githubPullRequestUrl,
2891
- displayLabel: `pull request #${pullRequestLink.data.githubPullRequestNumber}`
2892
- }) : [];
2893
2872
  return {
2894
2873
  kind: "issue",
2895
2874
  visible: false,
2896
- canRun: githubTokenConfigured && mappings.length > 0,
2875
+ canRun: githubTokenConfigured && Boolean(pullRequestLink),
2897
2876
  label: pullRequestLink?.data.githubPullRequestNumber ? `Sync PR #${pullRequestLink.data.githubPullRequestNumber}` : "Sync issue",
2898
2877
  message: pullRequestLink ? `Sync ${pullRequestLink.data.repositoryUrl.replace(/^https:\/\/github\.com\//, "")} pull request #${pullRequestLink.data.githubPullRequestNumber}.` : "This Paperclip issue is not linked to GitHub yet.",
2899
2878
  syncState: settings.syncState,
@@ -5906,8 +5885,13 @@ function isGitHubPullRequestActionRequiredForSync(pullRequest) {
5906
5885
  function isGitHubPullRequestPendingExternalWaitForSync(pullRequest) {
5907
5886
  return pullRequest.ciState === "unfinished" && !pullRequest.hasUnresolvedReviewThreads && pullRequest.mergeability !== "conflicting" && (pullRequest.mergeStateStatus === "blocked" || pullRequest.mergeStateStatus === "unstable");
5908
5887
  }
5888
+ function isGitHubPullRequestBlockedMaintainerApprovalWaitForSync(pullRequest) {
5889
+ return pullRequest.ciState === "green" && !pullRequest.hasUnresolvedReviewThreads && pullRequest.mergeability !== "conflicting" && pullRequest.mergeStateStatus === "blocked" && (pullRequest.reviewDecision === "unknown" || pullRequest.reviewDecision === "review_required");
5890
+ }
5909
5891
  function shouldPreserveBlockedExternalPullRequestWait(params) {
5910
- return params.currentStatus === "blocked" && params.linkedPullRequests.length > 0 && params.linkedPullRequests.every((pullRequest) => isGitHubPullRequestPendingExternalWaitForSync(pullRequest));
5892
+ return params.currentStatus === "blocked" && params.linkedPullRequests.length > 0 && params.linkedPullRequests.every(
5893
+ (pullRequest) => isGitHubPullRequestPendingExternalWaitForSync(pullRequest) || isGitHubPullRequestBlockedMaintainerApprovalWaitForSync(pullRequest)
5894
+ );
5911
5895
  }
5912
5896
  function isGitHubPullRequestTransientUnknownMergeabilityWait(pullRequest) {
5913
5897
  return pullRequest.ciState === "green" && !pullRequest.hasUnresolvedReviewThreads && pullRequest.mergeability !== "conflicting" && pullRequest.mergeStateStatus === "unknown";
@@ -15475,6 +15459,7 @@ var __testing = {
15475
15459
  formatPaperclipApiFetchErrorMessage,
15476
15460
  hasUnresolvedPaperclipIssueBlocker,
15477
15461
  isHealthyMaintainerWaitTransition,
15462
+ resolvePaperclipPullRequestIssueStatus,
15478
15463
  resolveSyncTransitionAssignee
15479
15464
  };
15480
15465
  var plugin = definePlugin({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "paperclip-github-plugin",
3
- "version": "0.8.10",
3
+ "version": "0.8.12",
4
4
  "description": "Paperclip plugin for synchronizing GitHub issues into Paperclip projects.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -49,7 +49,7 @@
49
49
  "remark-gfm": "^4.0.1"
50
50
  },
51
51
  "devDependencies": {
52
- "@types/node": "24.12.2",
52
+ "@types/node": "24.12.3",
53
53
  "@types/react": "19.2.14",
54
54
  "esbuild": "0.28.0",
55
55
  "playwright": "1.59.1",