Implement complete API publication state management for unpublishing flow
Open
@DakshithaS is already working on this.
Since Nov 11, 2025.
- Dominant language
- Go
- Stars
- 71
- Forks
- 111
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 110
Description
Context
This issue tracks the implementation of complete API publication state management during the unpublishing flow, as deferred from PR #136.
Background
The UnpublishAPIFromDevPortal method in platform-api/src/internal/service/devportal_service.go currently unpublishes an API from the DevPortal backend but does not persist the publication state transitions in the database.
Problem
Without persisting the publication state:
- The publication record remains in
publishedstatus indefinitely - The state machine lifecycle is broken (should be: Published → Unpublishing → Unpublished)
- Subsequent publish attempts will fail on the unique key constraint
- The system cannot track unpublishing history or handle failures
Required Implementation
The unpublishing flow should:
- Fetch the publication record from
api_publications - Transition to
unpublishingstate before calling the DevPortal client - Persist the
unpublishingstate - Call the DevPortal client to unpublish
- Transition to
unpublishedstate after successful client call - Persist the
unpublishedstate
Reference
- PR: #136
- Comment: https://github.com/wso2/api-platform/pull/136#discussion_r2514160181
- File:
platform-api/src/internal/service/devportal_service.go - Method:
UnpublishAPIFromDevPortal - Requested by: @DakshithaS
Acceptance Criteria
- Publication state is fetched before unpublishing
- State transitions follow the state machine: Published → Unpublishing → Unpublished
- State changes are persisted in the database
- Error handling covers both state transition and persistence failures
- Unit tests cover the state management logic
- Integration tests verify the end-to-end unpublishing flow
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.