Skip to content

feat: add rejection reason fields to ChatAgentConfig and demote route#3219

Closed
rrbanda wants to merge 1 commit into
redhat-developer:mainfrom
rrbanda:pr/rejection-reason-field
Closed

feat: add rejection reason fields to ChatAgentConfig and demote route#3219
rrbanda wants to merge 1 commit into
redhat-developer:mainfrom
rrbanda:pr/rejection-reason-field

Conversation

@rrbanda
Copy link
Copy Markdown
Contributor

@rrbanda rrbanda commented May 21, 2026

Summary

  • Adds rejectionReason, rejectedBy, rejectedAt fields to ChatAgentConfig and ChatAgent interfaces
  • When admin demotes review→draft, they can include a reason in the request body which gets stored
  • Rejection fields are automatically cleared when the agent is re-submitted for review
  • demoteAgent frontend API method updated to accept optional reason parameter
  • Also adds createdBy field to both interfaces (prerequisite for ownership checks)

Part of Epic #3208. Prerequisite for PR F (rejection UI).

Test plan

  • Admin calls PUT /agents/:id/demote with { targetStage: "draft", reason: "Needs better description" } → reason is stored
  • Agent is re-promoted draft→review → rejectionReason/rejectedBy/rejectedAt are cleared
  • GET /agents returns rejection fields for agents that have been rejected

When an admin rejects an agent (demotes review→draft), they can now
provide a reason. The backend stores rejectionReason, rejectedBy, and
rejectedAt on the ChatAgentConfig. These fields are cleared when the
agent is re-submitted for review.

Changes:
- Add rejectionReason, rejectedBy, rejectedAt to ChatAgentConfig and
  ChatAgent interfaces
- Add createdBy field to both interfaces (prerequisite for downstream PRs)
- Update PUT /agents/:id/demote to accept optional 'reason' in body
- Surface rejection fields through overlayConfig in unified agent list
- Update demoteAgent API method to accept optional reason parameter
- Update report.api.md files for both augment and augment-common

Part of Epic redhat-developer#3208
@rrbanda rrbanda requested review from a team and pkliczewski as code owners May 21, 2026 15:57
@rhdh-gh-app
Copy link
Copy Markdown

rhdh-gh-app Bot commented May 21, 2026

Missing Changesets

The following package(s) are changed by this PR but do not have a changeset:

  • @red-hat-developer-hub/backstage-plugin-augment-backend
  • @red-hat-developer-hub/backstage-plugin-augment-common
  • @red-hat-developer-hub/backstage-plugin-augment

See CONTRIBUTING.md for more information about how to add changesets.

Changed Packages

Package Name Package Path Changeset Bump Current Version
@red-hat-developer-hub/backstage-plugin-augment-backend workspaces/augment/plugins/augment-backend none v0.1.0
@red-hat-developer-hub/backstage-plugin-augment-common workspaces/augment/plugins/augment-common none v0.1.0
@red-hat-developer-hub/backstage-plugin-augment workspaces/augment/plugins/augment none v0.1.0

@sonarqubecloud
Copy link
Copy Markdown

@codecov
Copy link
Copy Markdown

codecov Bot commented May 21, 2026

Codecov Report

❌ Patch coverage is 0% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 53.41%. Comparing base (7d93262) to head (53c1c1f).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3219      +/-   ##
==========================================
- Coverage   53.41%   53.41%   -0.01%     
==========================================
  Files        2373     2373              
  Lines       84895    84905      +10     
  Branches    23568    23574       +6     
==========================================
  Hits        45349    45349              
+ Misses      39200    38007    -1193     
- Partials      346     1549    +1203     
Flag Coverage Δ *Carryforward flag
adoption-insights 83.58% <ø> (ø) Carriedforward from 7d93262
ai-integrations 70.03% <ø> (ø) Carriedforward from 7d93262
app-defaults 69.60% <ø> (ø) Carriedforward from 7d93262
augment 46.66% <0.00%> (-0.02%) ⬇️
bulk-import 72.86% <ø> (ø) Carriedforward from 7d93262
cost-management 16.49% <ø> (ø) Carriedforward from 7d93262
dcm 32.85% <ø> (ø) Carriedforward from 7d93262
extensions 61.79% <ø> (ø) Carriedforward from 7d93262
global-floating-action-button 74.30% <ø> (ø) Carriedforward from 7d93262
global-header 61.68% <ø> (ø) Carriedforward from 7d93262
homepage 50.92% <ø> (ø) Carriedforward from 7d93262
konflux 91.01% <ø> (ø) Carriedforward from 7d93262
lightspeed 68.33% <ø> (ø) Carriedforward from 7d93262
mcp-integrations 81.59% <ø> (ø) Carriedforward from 7d93262
orchestrator 36.36% <ø> (ø) Carriedforward from 7d93262
quickstart 62.88% <ø> (ø) Carriedforward from 7d93262
sandbox 79.49% <ø> (ø) Carriedforward from 7d93262
scorecard 83.84% <ø> (ø) Carriedforward from 7d93262
theme 64.54% <ø> (ø) Carriedforward from 7d93262
translations 8.49% <ø> (ø) Carriedforward from 7d93262
x2a 78.59% <ø> (ø) Carriedforward from 7d93262

*This pull request uses carry forward flags. Click here to find out more.


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7d93262...53c1c1f. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@rrbanda
Copy link
Copy Markdown
Contributor Author

rrbanda commented May 21, 2026

Closing: superseded by Phase 1 (#3222) which consolidates rejection reason fields with the full backend type plumbing.

@rrbanda rrbanda closed this May 21, 2026
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