Skip to content

Github allowlist automation#1855

Merged
prxt6529 merged 7 commits intomainfrom
github-allowlist-automation
Jan 29, 2026
Merged

Github allowlist automation#1855
prxt6529 merged 7 commits intomainfrom
github-allowlist-automation

Conversation

@prxt6529
Copy link
Copy Markdown
Collaborator

@prxt6529 prxt6529 commented Jan 28, 2026

Summary by CodeRabbit

  • New Features

    • Publish distribution plans to GitHub with a "Publish to GitHub" action, showing loading, success, error and retry states.
    • Modal shows upload progress, results (GitHub folder link, uploaded/deleted file lists), and supports retry.
    • Contextual tooltips and validation gate publishing; photo and automatic airdrop uploads include toast feedback and overview refresh.
  • Chores

    • Added/updated test scripts and introduced new dependencies for browser mapping and YAML handling.

✏️ Tip: You can customize this high-level summary in your review settings.

Signed-off-by: prxt6529 <prxt@6529.io>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 28, 2026

📝 Walkthrough

Walkthrough

Adds a GitHub publishing flow to the subscription footer: UI/state, backend POST integration, result/error modal, publish validation/tooltips, photo/airdrop upload handlers, and package.json script/dependency updates (baseline-browser-mapping, yaml).

Changes

Cohort / File(s) Summary
Subscription Footer (main)
components/distribution-plan-tool/review-distribution-plan/table/ReviewDistributionPlanTableSubscriptionFooter.tsx
Adds GitHub publishing state/handlers (isUploadingToGithub, showGithubModal, githubUploadResult, githubUploadError), canPublishToGithub and githubUploadTooltip helpers, uploadToGithub(contract, tokenId) POST, photo/airdrop upload handlers, refactors rendering into SubscriptionFooterMain, and exposes onUploadToGithub callback and Publish button.
Github Upload Modal
components/distribution-plan-tool/review-distribution-plan/table/ReviewDistributionPlanTableSubscriptionFooterGithubUploadModal.tsx
New GithubUploadModal component and GithubUploadResult type; modal shows loading, success (link, uploaded/deleted lists) or error states, supports retry and disables close while uploading.
Package manifest
package.json
Adds test:no-coverage script, updates test-json to use --coverage=false, and adds baseline-browser-mapping (^2.9.19) and yaml (^2.4.2) to dependencies and devDependencies.

Sequence Diagram

sequenceDiagram
    actor User
    participant Footer as ReviewDistributionPlanTableSubscriptionFooter
    participant API as Backend API
    participant Modal as GithubUploadModal
    participant GitHub as GitHub

    User->>Footer: Click "Publish to GitHub"
    Footer->>Footer: set isUploadingToGithub = true
    Footer->>API: POST /distributions/{contract}/{tokenId}/github-upload
    API->>GitHub: create folder / upload files
    GitHub-->>API: return upload result or error
    API-->>Footer: return result or error
    Footer->>Footer: store result/error, set isUploadingToGithub = false
    Footer->>Modal: show modal with result or error
    Modal->>User: display success (link, file lists) or error (retry)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested reviewers

  • simo6529
  • ragnep

Poem

🐇 I hopped through code and found a lane,
Buttons, modals, and a tiny train.
Upload hums, the folder glows,
GitHub grins where the rabbit goes. 🥕✨

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The PR title 'Github allowlist automation' is vague and does not clearly describe the main changes, which involve adding GitHub publishing functionality to the distribution plan tool component. Consider a more specific title that reflects the actual implementation, such as 'Add GitHub publishing flow to distribution plan review component' or 'Implement GitHub upload functionality for distribution plans'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In
`@components/distribution-plan-tool/review-distribution-plan/table/ReviewDistributionPlanTableSubscriptionFooter.tsx`:
- Around line 334-359: The Publish button's title (githubUploadTooltip) won't
show when the button is disabled; wrap the <button> in a focusable wrapper and
move the tooltip/title there so users can still see the reason when disabled.
Specifically, in the ReviewDistributionPlanTableSubscriptionFooter component,
wrap the existing <button> (which uses isUploadingToGithub, canPublishToGithub,
uploadToGithub) with a <div> or <span> that has title={githubUploadTooltip ??
undefined} and when the button is disabled add tabIndex={0} and
aria-disabled={true} on the wrapper so it remains focusable/accessible and
exposes the tooltip/description to assistive tech; keep the actual disabled
attribute on the button and do not change uploadToGithub, isUploadingToGithub,
or canPublishToGithub logic.
🧹 Nitpick comments (1)
components/distribution-plan-tool/review-distribution-plan/table/ReviewDistributionPlanTableSubscriptionFooterGithubUploadModal.tsx (1)

90-111: Prefer stable keys for file lists.
Index keys can cause unnecessary re-renders if lists change between retries.

♻️ Suggested tweak
-                  {result.deleted_files.map((f, i) => (
-                    <li key={i}>{f}</li>
-                  ))}
+                  {result.deleted_files.map((f) => (
+                    <li key={f}>{f}</li>
+                  ))}
-                  {result.uploaded_files.map((f, i) => (
-                    <li key={i}>{f}</li>
-                  ))}
+                  {result.uploaded_files.map((f) => (
+                    <li key={f}>{f}</li>
+                  ))}

Signed-off-by: prxt6529 <prxt@6529.io>
Signed-off-by: prxt6529 <prxt@6529.io>
Signed-off-by: prxt6529 <prxt@6529.io>
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In
`@components/distribution-plan-tool/review-distribution-plan/table/ReviewDistributionPlanTableSubscriptionFooterGithubUploadModal.tsx`:
- Around line 75-92: The href is built directly from GITHUB_BASE and
result.github_folder which can contain spaces or reserved characters and break
the URL; update the Link generation (where result.github_folder and GITHUB_BASE
are used) to encode each path segment of result.github_folder before joining
(e.g. split on '/' and map each segment through encodeURIComponent then join
with '/'), then prepend GITHUB_BASE so the generated href is safe; keep the
existing conditional that checks result.github_folder.
🧹 Nitpick comments (1)
components/distribution-plan-tool/review-distribution-plan/table/ReviewDistributionPlanTableSubscriptionFooter.tsx (1)

33-54: Make tooltip/gating loading-aware to avoid stale or misleading state.

When overview is still loading (or still reflects the previous token), the current tooltip implies “Finalize…” and canPublish can be computed from stale data. Consider passing isLoadingOverview into the helpers to keep the button disabled and the tooltip accurate.

♻️ Suggested refactor
-function getGithubUploadTooltip(
-  overview: DistributionOverview | null
-): string | null {
+function getGithubUploadTooltip(
+  overview: DistributionOverview | null,
+  isLoading: boolean
+): string | null {
+  if (isLoading) {
+    return "Loading distribution overview…";
+  }
   if (overview?.is_normalized === true) {
     if ((overview?.photos_count ?? 0) === 0) {
       return "Upload distribution photos first";
     }
     if ((overview?.automatic_airdrops_count ?? 0) === 0) {
       return "Upload automatic airdrops first";
     }
     return null;
   }
   return "Finalize and normalize the distribution first";
 }
 
-function canPublishToGithub(overview: DistributionOverview | null): boolean {
+function canPublishToGithub(
+  overview: DistributionOverview | null,
+  isLoading: boolean
+): boolean {
+  if (isLoading) return false;
   return (
     overview?.is_normalized === true &&
     (overview?.photos_count ?? 0) > 0 &&
     (overview?.automatic_airdrops_count ?? 0) > 0
   );
 }
 
-const githubUploadTooltip = getGithubUploadTooltip(overview);
+const githubUploadTooltip = getGithubUploadTooltip(
+  overview,
+  isLoadingOverview
+);
 
-      canPublish={canPublishToGithub(overview)}
+      canPublish={canPublishToGithub(overview, isLoadingOverview)}

Also applies to: 331-332, 567-568

Signed-off-by: prxt6529 <prxt@6529.io>
Signed-off-by: prxt6529 <prxt@6529.io>
Signed-off-by: prxt6529 <prxt@6529.io>
@sonarqubecloud
Copy link
Copy Markdown

@prxt6529 prxt6529 merged commit 689be61 into main Jan 29, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants