Skip to content

feat(augment): Phase 1 - consolidate agent lifecycle backend types and plumbing#3222

Merged
pkliczewski merged 1 commit into
redhat-developer:mainfrom
rrbanda:pr/lifecycle-hardening-phase1
May 21, 2026
Merged

feat(augment): Phase 1 - consolidate agent lifecycle backend types and plumbing#3222
pkliczewski merged 1 commit into
redhat-developer:mainfrom
rrbanda:pr/lifecycle-hardening-phase1

Conversation

@rrbanda
Copy link
Copy Markdown
Contributor

@rrbanda rrbanda commented May 21, 2026

Summary

Phase 1 of the Deep-Dive Lifecycle Hardening stack. Builds on and consolidates improvements over already-merged upstream PRs #3205#3214 (DELETE route, createdBy/My Agents scoping, GET /agents filtering, orphan wizard removal, lifecycle docs).

This PR adds the full backend lifecycle plumbing in one place:

  • shared.ts: createdBy, createdAt, rejectionReason, rejectedBy, rejectedAt
  • agentRoutes.ts: ownership checks, phantom-draft blocking, non-admin GET scoping, rejection fields on demote, ownership-gated DELETE
  • AugmentApi.ts: deleteAgentConfig, reason on demoteAgent
  • Tests: agentRoutes.test.ts (41 tests)
  • Changeset: lifecycle-hardening.md

Stacked PRs: #3223 (Phase 2 UX) → #3224 (polling) → #3225 (cascading delete) → #3226 (SonataFlow workflow).

Test plan

  • npx tsc --noEmit in workspaces/augment
  • yarn backstage-cli repo test --testPathPattern='agentRoutes.test'
  • yarn prettier:check in augment workspace

@github-actions
Copy link
Copy Markdown
Contributor

This pull request adds a new top-level directory under workspaces/. Please follow Submitting a Pull Request for a New Workspace in CONTRIBUTING.md.

@rhdh-gh-app
Copy link
Copy Markdown

rhdh-gh-app Bot commented May 21, 2026

Important

This PR includes changes that affect public-facing API. Please ensure you are adding/updating documentation for new features or behavior.

Changed Packages

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

@rrbanda rrbanda force-pushed the pr/lifecycle-hardening-phase1 branch from d041eb9 to 5e3cebe Compare May 21, 2026 17:18
Phase 1 of lifecycle hardening: single PR consolidating all backend
type changes and plumbing that were previously split across PRs A/B/E.

Backend types (shared.ts):
- Add createdBy, createdAt to ChatAgentConfig and ChatAgent
- Add rejectionReason, rejectedBy, rejectedAt for rejection tracking

Agent routes (agentRoutes.ts):
- overlayConfig surfaces all new lifecycle fields
- GET /agents scoped for non-admins: published + own + legacy unowned
- Promote: ownership checks, phantom draft blocking for non-admins,
  createdBy set on new config entries, rejection fields cleared on re-promote
- Demote: accepts optional reason param, stores rejection fields on
  review → draft transitions
- DELETE /agents/:agentId: ownership-gated draft deletion for non-admins,
  full deletion for admins, with audit logging

Frontend API (AugmentApi.ts):
- Add deleteAgentConfig(agentId) method
- Add reason param to demoteAgent signature

Audit logger:
- Add 'agent.delete' audit action

API reports updated for both augment-common and augment plugins.
@codecov
Copy link
Copy Markdown

codecov Bot commented May 21, 2026

Codecov Report

❌ Patch coverage is 92.72727% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 53.82%. Comparing base (3ae6323) to head (2593801).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3222      +/-   ##
==========================================
+ Coverage   53.55%   53.82%   +0.26%     
==========================================
  Files        2362     2362              
  Lines       84709    84735      +26     
  Branches    23464    23475      +11     
==========================================
+ Hits        45367    45606     +239     
+ Misses      39085    37691    -1394     
- Partials      257     1438    +1181     
Flag Coverage Δ *Carryforward flag
adoption-insights 83.58% <ø> (ø) Carriedforward from 3ae6323
ai-integrations 70.03% <ø> (ø) Carriedforward from 3ae6323
app-defaults 69.60% <ø> (ø) Carriedforward from 3ae6323
augment 47.61% <92.72%> (+0.63%) ⬆️
bulk-import 72.86% <ø> (ø) Carriedforward from 3ae6323
cost-management 16.49% <ø> (ø) Carriedforward from 3ae6323
dcm 32.85% <ø> (ø) Carriedforward from 3ae6323
extensions 61.79% <ø> (ø) Carriedforward from 3ae6323
global-floating-action-button 74.30% <ø> (ø) Carriedforward from 3ae6323
global-header 61.68% <ø> (ø) Carriedforward from 3ae6323
homepage 50.92% <ø> (ø) Carriedforward from 3ae6323
konflux 91.01% <ø> (ø) Carriedforward from 3ae6323
lightspeed 68.33% <ø> (ø) Carriedforward from 3ae6323
mcp-integrations 81.59% <ø> (ø) Carriedforward from 3ae6323
orchestrator 36.36% <ø> (ø) Carriedforward from 3ae6323
quickstart 62.88% <ø> (ø) Carriedforward from 3ae6323
sandbox 79.56% <ø> (ø) Carriedforward from 3ae6323
scorecard 83.84% <ø> (ø) Carriedforward from 3ae6323
theme 64.54% <ø> (ø) Carriedforward from 3ae6323
translations 8.49% <ø> (ø) Carriedforward from 3ae6323
x2a 78.59% <ø> (ø) Carriedforward from 3ae6323

*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 3ae6323...2593801. 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 rrbanda force-pushed the pr/lifecycle-hardening-phase1 branch from 5e3cebe to 2593801 Compare May 21, 2026 17:27
@sonarqubecloud
Copy link
Copy Markdown

@pkliczewski pkliczewski merged commit 3e18b17 into redhat-developer:main May 21, 2026
62 checks passed
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.

3 participants