Skip to content

Comments

refactor: useDeployment hook usage#5086

Open
ogzhanolguncu wants to merge 2 commits intomainfrom
deploy-hook-cleanup
Open

refactor: useDeployment hook usage#5086
ogzhanolguncu wants to merge 2 commits intomainfrom
deploy-hook-cleanup

Conversation

@ogzhanolguncu
Copy link
Contributor

What does this PR do?

We had a hook called useDeployment where we read deploymentId from params, but we can actually call our useProjectsData hooks method getDeploymentById and return the actual deployment instead of just deploymentId. This will ensure that we manage the deployment data from single source of truth

How should this be tested?

  • Deployments overview page should work

@vercel
Copy link

vercel bot commented Feb 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dashboard Ready Ready Preview, Comment Feb 19, 2026 1:05pm
engineering Ready Ready Preview, Comment Feb 19, 2026 1:05pm

Request Review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 19, 2026

No actionable comments were generated in the recent review. 🎉


📝 Walkthrough

Walkthrough

This pull request refactors how deployment data flows through the deployment view layer. Components previously extracted deploymentId and fetched the full deployment object separately; they now receive the complete Deployment object directly from useDeployment(). The hook signature and context type are updated to pass deployment instead of deploymentId. Additionally, the ScrollToBottomButton component is removed. The refactoring affects data providers, context, layout logic, and multiple view sections.

Changes

Cohort / File(s) Summary
Context & Data Flow
layout-provider.tsx, page.tsx
Updated DeploymentLayoutContext type from deploymentId: string to deployment: Deployment. Modified useDeployment() to return deployment object directly instead of deploymentId. Removed getDeploymentById from useProjectData() export. Added deployment retrieval and validation in layout provider.
Component Sections
deployment-domains-section.tsx, deployment-info-section.tsx, deployment-network-section.tsx, deployment-progress-section.tsx
Updated all four section components to extract deployment from useDeployment() and use deployment.id and deployment.* properties directly instead of fetching via deploymentId. Removed redundant useProjectData() and getDeploymentById() calls. Updated instance/prop access to remove optional chaining where applicable.
Views & Utilities
deployment-network-view.tsx, use-deployment-breadcrumb-config.ts, use-deployment-sentinel-logs-query.ts
Updated views and query utilities to consume deployment object from useDeployment(). Changed breadcrumb and query parameter construction to use deployment.id, deployment.projectId, and deployment.environmentId directly. Simplified query enabling logic by removing separate condition checks.
Removed Component
scroll-to-bottom-button.tsx
Deleted entire ScrollToBottomButton component (47 lines). Component displayed a fixed button with shimmer effect during deployment builds, with scroll-to-bottom functionality and conditional visibility based on deployment status.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 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.
Description check ❓ Inconclusive The description explains what the PR does and includes testing instructions, but is missing required checklist items and does not follow the template structure fully. Complete the PR template by checking off relevant checklist items (Required and Appreciated sections) and confirming all steps were performed.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main refactoring—updating useDeployment hook usage to return the deployment object instead of just deploymentId.

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

✨ Finishing Touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch deploy-hook-cleanup

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

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