Skip to content

refactor: improve skip stage detection, propagate context in downloader, and style log viewer#6928

Open
Parthtiw710 wants to merge 1 commit into
pipe-cd:masterfrom
Parthtiw710:refactor/piped-optimizations-and-context
Open

refactor: improve skip stage detection, propagate context in downloader, and style log viewer#6928
Parthtiw710 wants to merge 1 commit into
pipe-cd:masterfrom
Parthtiw710:refactor/piped-optimizations-and-context

Conversation

@Parthtiw710

Copy link
Copy Markdown

Description

This PR introduces performance optimizations, robustness improvements, and a UI enhancement to the log viewer:

  1. Context Propagation in Binary Downloader: Updates DownloadBinary to accept a context.Context and use http.NewRequestWithContext, enabling proper timeouts and cancellation.
  2. Optimized Skip Stage Check: Replaces cloning of the git repository with local directory lookup via targetDSP during stage skip checks, reducing network overhead and disk usage.
  3. Detailed Status Reason Reporting: Adds statusReason support to reportStageStatus to report skip reasons and failure messages to the control plane.
  4. Powerline-Style Log Viewer Header: Enhances the web log viewer component with a sleek, multi-segmented Powerline terminal prompt.

Key Changes

⚙️ Piped & Launcher (Go)

  • pkg/lifecycle/binary.go / pkg/lifecycle/binary_test.go:
    • Added ctx context.Context parameter to DownloadBinary.
    • Replaced http.NewRequest with http.NewRequestWithContext to inherit cancellation signals.
    • Updated callers in launcher.go, piped.go, and test assertions to propagate context.
  • pkg/app/pipedv1/controller/scheduler.go:
    • Updated reportStageStatus signature to include statusReason.
    • Set the StatusReason field inside ReportStageStatusChangedRequest.
    • Cleaned up legacy commented-out script rollback stage logic.
  • pkg/app/pipedv1/controller/skipstage.go:
    • Avoided calling gitClient.Clone inside determineSkipStage.
    • Retrieved local directory using s.targetDSP.Get(ctx, io.Discard) to instantiate the repository object directly, preventing redundant repository clones.

🎨 Web Frontend (TypeScript/React)

  • web/src/components/deployments-detail-page/log-viewer/log/index.tsx:
    • Integrated useAuth hook to query the active user's identity.
    • Added a custom Powerline-themed terminal prompt (Username me?.subject, Directory ~, and File stage.log) constructed with Material UI Box and CSS clipPath polygons.
    • Increased vertical padding on the log container for better readability.

@Parthtiw710

Copy link
Copy Markdown
Author

@eeshaanSA @rahulshendre @khanhtc1202 i have added the context which was written in todo instruction comments, please look the changes. in prev pr i replaced waitgroup to do as mentioned in todo instrucions, i am currently working on todo instructions left in comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant