[8571] Disable staging target on initial publish#4903
Conversation
|
Warning Review limit reached
More reviews will be available in 23 minutes and 54 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more credits in the billing tab to continue. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe publish dialog now selects the initial publishing target based on published status, and the publishing target options update their disabled state and labels to reflect staging behavior on first publish. ChangesPublish dialog target behavior
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@ui/app/src/components/PublishDialog/PublishDialogContainer.tsx`:
- Around line 122-124: The target selection logic in PublishDialogContainer
should not default to a disabled staging option on first publish. Update the
branch that sets `target` so it uses `published` only to allow staging, but when
`published` is false it selects the first non-`staging` entry from
`publishingTargets` and leaves the value empty if no other target exists. Use
the existing `publishingTargets` lookup and `PublishDialogForm` behavior to
ensure `state.publishingTarget` is not prefilled with a disabled option.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: bba03b3f-3dcb-4b4c-a6d1-afe8beec8234
📒 Files selected for processing (2)
ui/app/src/components/PublishDialog/PublishDialogContainer.tsxui/app/src/components/PublishDialog/PublishDialogForm.tsx
|
@coderabbitai can you check if everything looks good? Please give it a final review before I hand over for human review |
🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
printf "\n== Changed files ==\n"
git diff --name-only origin/develop...HEAD || git diff --name-only HEAD~1...HEAD
printf "\n== PublishDialogContainer outline ==\n"
ast-grep outline ui/app/src/components/PublishDialog/PublishDialogContainer.tsx --view expanded || true
printf "\n== PublishDialogForm outline ==\n"
ast-grep outline ui/app/src/components/PublishDialog/PublishDialogForm.tsx --view expanded || true
printf "\n== Diff for changed files ==\n"
git diff --unified=80 origin/develop...HEAD -- \
ui/app/src/components/PublishDialog/PublishDialogContainer.tsx \
ui/app/src/components/PublishDialog/PublishDialogForm.tsx || \
git diff --unified=80 HEAD~1...HEAD -- \
ui/app/src/components/PublishDialog/PublishDialogContainer.tsx \
ui/app/src/components/PublishDialog/PublishDialogForm.tsx
printf "\n== Relevant snippets: publishing target logic and messages ==\n"
rg -n -C4 'publishingTarget|publishingTargets|isPromote|published|staging|Publishing Target' \
ui/app/src/components/PublishDialog/PublishDialogContainer.tsx \
ui/app/src/components/PublishDialog/PublishDialogForm.tsx \
ui/app/src/components/PublishDialog -g '!**/*.test.*' || trueLength of output: 88397
What I checked:
I didn’t find any blocking issues in the updated flow. ✅ Action performedReview finished.
|
|
@coderabbitai can you check if everything looks good? Please give it a final review before I hand over for human review |
|
✅ Action performedFull review finished. |
|
@coderabbitai, the last commit hasn't been reviewed. Please review and report findings. |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== PR branch HEAD commit =="
git log --oneline -n 5
echo
echo "== Files changed in last commit =="
git diff --name-only HEAD~1..HEAD
echo
echo "== Last commit diff =="
git diff --unified=80 HEAD~1..HEAD -- \
ui/app/src/components/PublishDialog/PublishDialogContainer.tsx \
ui/app/src/components/PublishDialog/PublishDialogForm.tsx
echo
echo "== AST outline: PublishDialogContainer =="
ast-grep outline ui/app/src/components/PublishDialog/PublishDialogContainer.tsx --view expanded || true
echo
echo "== AST outline: PublishDialogForm =="
ast-grep outline ui/app/src/components/PublishDialog/PublishDialogForm.tsx --view expanded || true
echo
echo "== PublishDialogContainer relevant slice =="
sed -n '100,250p' ui/app/src/components/PublishDialog/PublishDialogContainer.tsx
echo
echo "== PublishDialogForm relevant slice =="
sed -n '260,380p' ui/app/src/components/PublishDialog/PublishDialogForm.tsx
echo
echo "== Search for publishing target submit validation and initial value usage =="
rg -n -C3 'publishingTarget|setFieldValue|onSubmit|validationSchema|disabled:|isPromote|published' \
ui/app/src/components/PublishDialog/PublishDialogContainer.tsx \
ui/app/src/components/PublishDialog/PublishDialogForm.tsxLength of output: 50798
Findings: no new issues from that commit. What I verified:
So from this final pass, I don’t have any remaining findings on the latest commit. This looks good to hand over for human review. |
craftercms/craftercms#8571
Summary by CodeRabbit