Skip to content

merge test from main - #2

Merged
vgtray merged 1 commit into
mainfrom
test
Dec 3, 2025
Merged

merge test from main#2
vgtray merged 1 commit into
mainfrom
test

Conversation

@vgtray

@vgtray vgtray commented Dec 3, 2025

Copy link
Copy Markdown
Owner

test

…e for Express routes

test(admin): add comprehensive tests for authentication, admin routes, cache stats, file filtering, and logs export functionality
Copilot AI review requested due to automatic review settings December 3, 2025 23:12

Copilot AI left a comment

Copy link
Copy Markdown

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 merges test changes from the main branch, introducing a comprehensive notification system, real-time connection monitoring, improved file management with preview capabilities, enhanced logging with advanced filtering, and complete CI/CD infrastructure.

Key Changes:

  • Replaced react-hot-toast with a custom notification system featuring activity tracking and toast notifications
  • Added real-time connection status monitoring with polling capabilities
  • Implemented file preview modal, grid/list view toggle, and enhanced upload queue management with progress tracking
  • Enhanced logs page with filters (action type, status), statistics cards, export functionality, and user agent parsing
  • Added complete CI/CD pipeline with GitHub Actions including lint, test, build, security scanning, and deployment workflows

Reviewed changes

Copilot reviewed 18 out of 63 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
scripts/migrate.sh New database migration script with up/down/status/reset commands
cdn-dashboard/src/lib/realtime.tsx Real-time connection monitoring with polling and event simulation
cdn-dashboard/src/lib/notifications.ts Custom notification and activity feed state management using Zustand
cdn-dashboard/src/lib/api.ts Added upload progress callback and client-side CSV/JSON export utilities
cdn-dashboard/src/components/system-stats.tsx System health monitoring components with animated stats
cdn-dashboard/src/components/sidebar.tsx Integrated activity dropdown in sidebar navigation
cdn-dashboard/src/components/providers.tsx Replaced Toaster with NotificationToast component
cdn-dashboard/src/components/notifications.tsx Complete notification UI with toast, activity panel, and dropdown components
cdn-dashboard/src/app/login/page.tsx Updated to use new notification system
cdn-dashboard/src/app/dashboard/users/page.tsx Updated toast import
cdn-dashboard/src/app/dashboard/tokens/page.tsx Updated to use new notification and activity systems
cdn-dashboard/src/app/dashboard/page.tsx Added real-time connection status and refresh functionality
cdn-dashboard/src/app/dashboard/logs/page.tsx Major enhancement with filters, stats, exports, and user agent parsing
cdn-dashboard/src/app/dashboard/files/page.tsx Complete overhaul with preview, grid view, enhanced upload queue, and exports
cdn-dashboard/src/app/dashboard/api-keys/page.tsx Updated toast import
README.md Comprehensive documentation update with new features and architecture
IMPROVEMENTS_COMPLETED.md Documentation of all 8 phases of improvements
.github/workflows/ci.yml Complete CI/CD pipeline configuration

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

maxNotifications: 5,

addNotification: (notification) => {
const id = `${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;

Copilot AI Dec 3, 2025

Copy link

Choose a reason for hiding this comment

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

The substr method is deprecated. Use substring or slice instead.

Suggested change
const id = `${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
const id = `${Date.now()}-${Math.random().toString(36).slice(2, 11)}`;

Copilot uses AI. Check for mistakes.
maxActivities: 50,

addActivity: (activity) => {
const id = `activity-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;

Copilot AI Dec 3, 2025

Copy link

Choose a reason for hiding this comment

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

The substr method is deprecated. Use substring or slice instead.

Suggested change
const id = `activity-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
const id = `activity-${Date.now()}-${Math.random().toString(36).slice(2, 11)}`;

Copilot uses AI. Check for mistakes.
className="w-full h-full object-cover group-hover:scale-105 transition-transform duration-300"
onError={(e) => {
(e.target as HTMLImageElement).style.display = 'none';
(e.target as HTMLImageElement).parentElement!.innerHTML = `<div class="scale-150">${getFileIcon(mimeType)}</div>`;

Copilot AI Dec 3, 2025

Copy link

Choose a reason for hiding this comment

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

Setting innerHTML can expose the application to XSS attacks. Use DOM manipulation methods like createElement and appendChild instead.

Copilot uses AI. Check for mistakes.
Comment on lines +927 to +928
(e.target as HTMLImageElement).style.display = 'none';
(e.target as HTMLImageElement).parentElement!.innerHTML = '<p class="text-zinc-500 p-8">Impossible de charger la prévisualisation</p>';

Copilot AI Dec 3, 2025

Copy link

Choose a reason for hiding this comment

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

Setting innerHTML can expose the application to XSS attacks. Use DOM manipulation methods like createElement and appendChild instead.

Suggested change
(e.target as HTMLImageElement).style.display = 'none';
(e.target as HTMLImageElement).parentElement!.innerHTML = '<p class="text-zinc-500 p-8">Impossible de charger la prévisualisation</p>';
const img = e.target as HTMLImageElement;
img.style.display = 'none';
const parent = img.parentElement!;
// Remove all children
while (parent.firstChild) {
parent.removeChild(parent.firstChild);
}
// Create and append the error message
const p = document.createElement('p');
p.className = 'text-zinc-500 p-8';
p.textContent = 'Impossible de charger la prévisualisation';
parent.appendChild(p);

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/ci.yml
API_KEY: test-api-key

- name: Upload coverage
uses: codecov/codecov-action@v4

Copilot AI Dec 3, 2025

Copy link

Choose a reason for hiding this comment

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

Using @v4 without specifying a full SHA or tag makes the workflow vulnerable to supply chain attacks. Pin to a specific commit SHA or use a full version tag.

Suggested change
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v4.4.1

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/ci.yml
output: 'trivy-results.sarif'

- name: Upload Trivy scan results
uses: github/codeql-action/upload-sarif@v2

Copilot AI Dec 3, 2025

Copy link

Choose a reason for hiding this comment

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

Using @v2 without specifying a full SHA or tag makes the workflow vulnerable to supply chain attacks. Pin to a specific commit SHA or use a full version tag.

Suggested change
uses: github/codeql-action/upload-sarif@v2
uses: github/codeql-action/upload-sarif@v2.22.7

Copilot uses AI. Check for mistakes.
@vgtray
vgtray merged commit 6ac9b02 into main Dec 3, 2025
13 of 15 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