Skip to content

Feat jinhua clusters blacklist 260224#681

Draft
Yang1998-jiale wants to merge 30 commits intomainfrom
feat-jinhua-clustersBlacklist-260224
Draft

Feat jinhua clusters blacklist 260224#681
Yang1998-jiale wants to merge 30 commits intomainfrom
feat-jinhua-clustersBlacklist-260224

Conversation

@Yang1998-jiale
Copy link
Copy Markdown
Collaborator

Description

Related Issue

Motivation and Context

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation Update (if none of the other choices apply)

Checklist

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

jjzhang332 and others added 26 commits December 25, 2025 16:43
feat: optimize charts style

Signed-off-by: yingxuan <zhanglujia.zlj@digital-engine.com>
Co-authored-by: yingxuan <zhanglujia.zlj@digital-engine.com>
Signed-off-by: 杨家乐 <yjl516914@digital-engine.com>
Co-authored-by: 杨家乐 <yjl516914@digital-engine.com>
Signed-off-by: 杨家乐 <yjl516914@digital-engine.com>
Signed-off-by: 杨家乐 <yjl516914@digital-engine.com>
Signed-off-by: 杨家乐 <yjl516914@digital-engine.com>
Signed-off-by: 杨家乐 <yjl516914@digital-engine.com>
Allow viewing blacklist details dialog even with single item
- Restructure blacklist UI with separate applications, urls, tags, priorities fields
- Fix priorities type conversion from string to int for backend compatibility
- Add duplicate combination validation for service/task type/feature
- Improve data preservation when updating blacklist fields
- Sync blacklist updates to preheats/new.tsx
Signed-off-by: 杨家乐 <yjl516914@digital-engine.com>
Signed-off-by: 杨家乐 <yjl516914@digital-engine.com>
- Remove Dragonfly dual push skill implementation plan
- Remove test-push.md documentation
- 批量修复Git提交作者信息脚本
- 双仓库安全分支同步脚本
- 配置文件用于仓库管理
- Add /scripts to gitignore for local development scripts
- Remove Git management scripts as they should be local only
- Keep scripts in .gitignore for future local development
为"Add cluster"按钮文本添加 paddingTop 以改善垂直对齐效果
Signed-off-by: 杨佳乐 <yjl516914@digital-engine.com>
Signed-off-by: 杨佳乐 <yjl516914@digital-engine.com>
Signed-off-by: 槿花 <yangjiale@U-0FL67Y02-2001.local>
Signed-off-by: 槿花 <yangjiale@U-0FL67Y02-2001.local>
Signed-off-by: 槿花 <yangjiale@U-0FL67Y02-2001.local>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces cluster blacklist/blocklist configuration in the cluster create/edit flows and surfaces the resulting configuration on the cluster information page, along with related UI polish and expanded Cypress coverage/CI updates.

Changes:

  • Add a new Cluster “Blocklist/Blacklist” editor component and send block_list in create/edit cluster payloads.
  • Render cluster blacklist details in the Cluster Information page and add styling for the new section.
  • Expand Cypress E2E coverage and adjust CI/workflows (Node 20, Cypress split, config tweaks); includes assorted UI alignment/chart refactors.

Reviewed changes

Copilot reviewed 35 out of 36 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
test-dual-push.md Adds a local dual-repo push test note (appears unrelated to feature).
src/lib/api.ts Extends cluster response types to include block_list.
src/index.css Adds new palette CSS variables (error/disabled/button hover).
src/components/users/index.tsx Wraps button label text for alignment.
src/components/resource/task/clear/index.tsx Wraps toggle/button labels; minor formatting fixes.
src/components/resource/persistent-cache-task/show.tsx Wraps delete button label for alignment.
src/components/resource/persistent-cache-task/analytics/index.tsx Refactors analytics aggregation + chart options/gradients.
src/components/resource/persistent-cache-task/analytics/index.module.css Adjusts layout sizing for analytics visuals.
src/components/loading-button.tsx Wraps button text for alignment.
src/components/job/preheats/new.tsx UI layout refactor for URL inputs; wraps button labels; formatting cleanup.
src/components/job/preheats/index.tsx Wraps “add preheat” label for alignment.
src/components/gc/job/index.tsx Wraps button labels; formatting-only change in ternary indentation.
src/components/gc/audit/index.tsx Wraps button labels for alignment.
src/components/developer/tokens/index.tsx Wraps “Add Personal access tokens” label for alignment.
src/components/clusters/seed-peers/index.tsx Wraps delete-inactive label for alignment.
src/components/clusters/schedulers/index.tsx Wraps delete-inactive label; minor formatting.
src/components/clusters/peers/index.tsx Refactors chart options/palettes; wraps action button labels.
src/components/clusters/new.tsx Adds blacklist ref + payload injection; renders new blacklist editor.
src/components/clusters/information.tsx Adds blacklist table rendering to cluster info page; wraps action labels.
src/components/clusters/information.module.css Adds dedicated styling for the blacklist section/table.
src/components/clusters/index.tsx Wraps “Add cluster” label for alignment.
src/components/clusters/edit.tsx Adds blacklist ref + payload injection; renders blacklist editor for editing.
src/components/clusters/blacklist.tsx New blacklist editor component (Autocomplete-based) with URL/priority handling.
package.json Adds engines constraints (Node/Yarn).
cypress/fixtures/clusters/cluster/empty-cluster.json Adds empty-cluster fixture for cluster info tests.
cypress/e2e/menu/menu.cy.ts Makes menu navigation test more robust by expanding/collapsing sidebar.
cypress/e2e/clusters/information.cy.ts Adds E2E coverage for cluster information page scenarios.
cypress/e2e/clusters/cluster.cy.ts Updates tests to reflect commented-out seed-peer cluster ID UI and clipboard checks.
cypress/e2e/clusters/blacklist.cy.ts Adds comprehensive E2E coverage for blacklist create/edit flows.
cypress/e2e/clusters/blacklist-detail.cy.ts Adds E2E coverage for blacklist rendering on detail page.
cypress.config.ts Updates Cypress runtime config (timeouts, retries, viewport, video).
.gitignore Adds /scripts ignore entry.
.github/workflows/release.yml Updates workflow Node version to 20.x.
.github/workflows/lint.yaml Updates workflow Node version to 20.x.
.github/workflows/e2e.yaml Updates workflow Node version to 20.x; increases split containers and sets split env.
.github/workflows/ci.yaml Updates workflow Node version to 20.x; removes build dependency on test job.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: yangjiale <yjl516914@digital-engine.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 24, 2026

Codecov Report

❌ Patch coverage is 66.94561% with 158 lines in your changes missing coverage. Please review.
✅ Project coverage is 46.87%. Comparing base (bbb8c2e) to head (4faca62).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
...resource/persistent-cache-task/analytics/index.tsx 0.00% 64 Missing ⚠️
src/components/job/preheats/new.tsx 0.00% 36 Missing ⚠️
src/components/clusters/peers/index.tsx 0.00% 28 Missing ⚠️
src/components/clusters/blacklist.tsx 90.98% 21 Missing and 1 partial ⚠️
src/components/clusters/information.tsx 92.94% 6 Missing ⚠️
src/components/gc/job/index.tsx 0.00% 2 Missing ⚠️

❌ Your patch check has failed because the patch coverage (66.94%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage.
❌ Your project check has failed because the head coverage (46.87%) is below the target coverage (90.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main     #681       +/-   ##
===========================================
- Coverage   96.49%   46.87%   -49.62%     
===========================================
  Files          52       53        +1     
  Lines        5785     6110      +325     
  Branches     1854     1944       +90     
===========================================
- Hits         5582     2864     -2718     
- Misses        187     3239     +3052     
+ Partials       16        7        -9     
Files with missing lines Coverage Δ
src/components/clusters/edit.tsx 99.55% <100.00%> (+<0.01%) ⬆️
src/components/clusters/index.tsx 99.28% <ø> (-0.72%) ⬇️
src/components/clusters/new.tsx 100.00% <100.00%> (ø)
src/components/clusters/schedulers/index.tsx 98.40% <ø> (-0.46%) ⬇️
src/components/developer/tokens/index.tsx 97.29% <ø> (-0.91%) ⬇️
src/components/gc/audit/index.tsx 0.00% <ø> (-95.22%) ⬇️
src/components/job/preheats/index.tsx 0.00% <ø> (-94.27%) ⬇️
src/components/loading-button.tsx 100.00% <ø> (ø)
...components/resource/persistent-cache-task/show.tsx 0.00% <ø> (-96.25%) ⬇️
src/components/resource/task/clear/index.tsx 0.41% <ø> (-92.34%) ⬇️
... and 8 more

... and 18 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Signed-off-by: yangjiale <yjl516914@digital-engine.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 34 out of 35 changed files in this pull request and generated 8 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +406 to +409
blacklist.map((item, index) => {
const duplicateInfo = getDuplicateInfo();
const duplicateError = duplicateInfo.get(index);
const isSubConfigDownload = item.subConfig === 'download';
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

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

getDuplicateInfo() is recomputed inside the .map() for every blacklist row, making rendering O(n^2). Compute duplicates once per render (e.g., with useMemo based on blacklist) and reuse it for each row.

Copilot uses AI. Check for mistakes.
Comment on lines +213 to +215
const blacklistData = reverseBlacklistFromData(
cluster?.peer_cluster_config || {},
cluster?.seed_peer_cluster_config || {},
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

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

blacklistData is recomputed on every render, so the useMemo for groupBlacklistData will also rerun every render because the dependency identity changes. Consider memoizing blacklistData (e.g., useMemo keyed on cluster.peer_cluster_config.block_list / cluster.seed_peer_cluster_config.block_list) or moving the reverseBlacklistFromData(...) call inside the groupBlacklistData memo.

Suggested change
const blacklistData = reverseBlacklistFromData(
cluster?.peer_cluster_config || {},
cluster?.seed_peer_cluster_config || {},
const blacklistData = useMemo(
() =>
reverseBlacklistFromData(
cluster?.peer_cluster_config || {},
cluster?.seed_peer_cluster_config || {},
),
[cluster?.peer_cluster_config?.block_list, cluster?.seed_peer_cluster_config?.block_list],

Copilot uses AI. Check for mistakes.
Comment on lines 235 to 238
seed_peer_cluster_config: {
load_limit: number;
block_list?: Record<string, any>;
};
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

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

block_list is typed as Record<string, any>, which defeats type-safety for a key config surface and makes downstream usage error-prone. Prefer a structured type (or at least Record<string, unknown> with runtime narrowing) that reflects the expected task/persistent_* -> download/upload -> { applications, urls, tags, priorities } shape.

Copilot uses AI. Check for mistakes.
Comment on lines 239 to 242
peer_cluster_config: {
load_limit: number;
block_list?: Record<string, any>;
};
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

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

block_list is typed as Record<string, any>, which removes compile-time guarantees for this config structure. Prefer a dedicated type (or unknown with narrowing) so UI code can safely read applications/urls/tags/priorities without relying on any.

Copilot uses AI. Check for mistakes.
Signed-off-by: yangjiale <yjl516914@digital-engine.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 34 out of 35 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: yangjiale <yjl516914@digital-engine.com>
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.

3 participants