Skip to content

Conversation

@DavidS-ovm
Copy link
Contributor

Previously, the "Waiting for Approval" component only appeared when promotion steps had a 'Succeeded' status and only for git-open-pr steps. This created a poor user experience for git-wait-for-pr steps, when they're not in the same stage as git-open-pr. They did not have a PR url attached and remain in 'Running' status while waiting for PR approval or merge.

The fix differentiates between step types:

  • git-open-pr: Link appears only when step succeeds (PR is created)
  • git-wait-for-pr: Link appears when step is running or succeeded (PR exists and is waiting for approval/merge)

This ensures users can access the PR for review/approval as soon as it's available, improving the GitOps workflow efficiency.

WHY: Users need immediate access to the PR link during the approval waiting period, not just after the step completes. The PR URL is already available from the preceding git-open-pr step output, so there's no reason to hide the link until the wait step succeeds.

@DavidS-ovm DavidS-ovm requested review from a team as code owners January 9, 2026 18:26
@netlify
Copy link

netlify bot commented Jan 9, 2026

Deploy Preview for docs-kargo-io ready!

Name Link
🔨 Latest commit ea4a139
🔍 Latest deploy log https://app.netlify.com/projects/docs-kargo-io/deploys/696a10d1a530a70008b545d0
😎 Deploy Preview https://deploy-preview-5560.docs.kargo.io
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@DavidS-ovm
Copy link
Contributor Author

DavidS-ovm commented Jan 9, 2026

Note that this requires the fix in #5559 for full effect. Here's some screenshots of this working:

image image

In this example, the prep stage has the git-open-pr step, and the ready stage has the git-wait-for-pr step. Together with a github action that closes superseded PRs this neatly implements a workaround for #3108

@codecov
Copy link

codecov bot commented Jan 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.01%. Comparing base (ce0d4d0) to head (ea4a139).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5560      +/-   ##
==========================================
+ Coverage   55.99%   56.01%   +0.02%     
==========================================
  Files         423      423              
  Lines       32131    32148      +17     
==========================================
+ Hits        17991    18008      +17     
  Misses      13087    13087              
  Partials     1053     1053              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 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.

Comment on lines 82 to 86
const isStatusAcceptable = isGitOpenPr
? hasPullRequestStepSucceeded
: isGitWaitForPr
? hasPullRequestStepSucceeded || hasPullRequestStepRunning
: false;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is the same as:

const isStatusAcceptable =                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
    (isGitOpenPr && hasPullRequestStepSucceeded) ||                                                                                                                                                                                                                                                                                                                                                                                                                                             
    (isGitWaitForPr && (hasPullRequestStepSucceeded || hasPullRequestStepRunning));

Which I personally find easier to read than the ternary version.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed, and updated!

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like you forgot to push this change @DavidS-ovm ?

@hiddeco hiddeco added kind/enhancement An entirely new feature area/controller Affects the (main) controller labels Jan 13, 2026
@DavidS-ovm DavidS-ovm force-pushed the feat-wait-for-pr-approval-linking branch from d46df5b to 772be2e Compare January 14, 2026 11:45
@hiddeco hiddeco added this to the v1.9.0 milestone Jan 15, 2026
Copy link
Contributor

@hiddeco hiddeco left a comment

Choose a reason for hiding this comment

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

The backend side of this looks good to me. Thank you @DavidS-ovm 🙇

@Marvin9 will check the frontend bit to ensure it's backwards compatible and doesn't break when there are stale git-wait-for-pr steps without metadata.

Comment on lines 13 to 14
// Steps that can produce PR deep links
const PR_STEP_TYPES = ['git-open-pr', 'git-wait-for-pr'];
Copy link
Contributor

Choose a reason for hiding this comment

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

this is re-used in next file (but copied). I would suggest please move this constant in get-pr-link.ts

Copy link
Contributor

@Marvin9 Marvin9 left a comment

Choose a reason for hiding this comment

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

Please check backward compatibility. The link looks stale on git wait step without this output schema.

Previously, the "Waiting for Approval" component only appeared when
promotion steps had a 'Succeeded' status and only for git-open-pr
steps. This created a poor user experience for git-wait-for-pr steps,
when they're not in the same stage as git-open-pr. They did not have
a PR url attached and remain in 'Running' status while waiting for
PR approval or merge.

The fix differentiates between step types:
- git-open-pr: Link appears only when step succeeds (PR is created)
- git-wait-for-pr: Link appears when step is running or succeeded
  (PR exists and is waiting for approval/merge)

This ensures users can access the PR for review/approval as soon as
it's available, improving the GitOps workflow efficiency.

WHY: Users need immediate access to the PR link during the approval
waiting period, not just after the step completes. The PR URL is
already available from the preceding git-open-pr step output, so there's
no reason to hide the link until the wait step succeeds.

Signed-off-by: David Schmitt <[email protected]>
@DavidS-ovm DavidS-ovm force-pushed the feat-wait-for-pr-approval-linking branch from 772be2e to ea4a139 Compare January 16, 2026 10:19
@DavidS-ovm
Copy link
Contributor Author

Yup, it'd have helped if I acually pushed that change. I now did so with changes addressing all comments:

  • improve the isStatusAcceptable expression
  • extract PR_TYPES
  • skipping the PR icon when there is no url

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

Labels

area/controller Affects the (main) controller kind/enhancement An entirely new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants