Skip to content

REST API allows unsafe branch archiving via PATCH #353

@jnovinger

Description

@jnovinger

Plugin Version

v0.7.1

NetBox Version

v4.4.5

Python Version

3.13.9

Steps to Reproduce

  1. Create and merge a branch via the API
  2. Send a PATCH request to /api/plugins/branching/branches/{id}/ with body:
    {
      "status": "archived"
    }
  3. Observe that the branch status changes to "archived" but the schema remains provisioned

Expected Behavior

The API should either:

  • Reject the PATCH with a 400 error indicating that archiving requires using a dedicated endpoint
  • OR automatically trigger the full deprovisioning workflow when status is changed to "archived"

The UI archive flow properly calls branch.archive(user) which deprovisions the schema before setting the status.

Observed Behavior

The API accepts the PATCH and changes the status to "archived" without deprovisioning the branch's schema. Thisleaves the PostgreSQL schema and tables orphaned in the database, creates potential data exposure risks, and bypasses the proper branch.archive() method which handles cleanup.

Metadata

Metadata

Assignees

Labels

app: branchingseverity: lowDoes not significantly disrupt application functionality, or a workaround is availablestatus: acceptedtype: bugA confirmed report of unexpected behavior in the application

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions