Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Engaging an Approval Workflow for API revision deployment #2137

Closed
tgtshanika opened this issue Aug 31, 2023 · 25 comments
Closed

[Feature] Engaging an Approval Workflow for API revision deployment #2137

tgtshanika opened this issue Aug 31, 2023 · 25 comments
Assignees
Milestone

Comments

@tgtshanika
Copy link
Contributor

Problem

Currently, API revision deployment can be directly performed by the API Publisher and there is no approval workflow engaged with it. Hence, there is no way for the admin to control or review the API gateway artifacts, before deploying into production.

Solution

A revision deployment workflow should be engaged with the product. By default, the API publishers should be able to deploy the revisions to desired gateways. When the revision deployment workflow is enabled, the revision should be moved into a pending state and should be deployed or rejected from deploying into the gateway, based on the admin's approval.

Affected Component

APIM

Version

4.3.0

Implementation

No response

Related Issues

No response

Suggested Labels

No response

@GihanAyesh
Copy link

GihanAyesh commented Sep 1, 2023

Developer comments - Progress update

Conducted a design review. Please find the design document below.
https://docs.google.com/document/d/1SP_vJ5QDq9FRd6Gs-XkXyZ9uYDzibVibtr7qrM8uKm0/edit?usp=sharing

@GihanAyesh
Copy link

GihanAyesh commented Sep 1, 2023

Sub tasks for the feature

  • Learn the related material
  • Initial design and discussion
  • Add revision creation via simple workflow
  • Add revision deletion via simple workflow
  • Add revision creation via approval workflow for publisher portal
  • Add revision deletion via approval workflow for publisher portal
  • Add revision approval flow for admin
  • Add revision rejection flow for admin
  • Get revision pages changes for backend
  • UI changes for publisher portal
  • UI changes for admin portal
  • Mapping UI changes to backend
  • Testing
  • Documentation

@GihanAyesh
Copy link

Developer comments - Progress update

Started implementing the API revision creation via simple workflow. The application creation workflow will be used as the guideline for the implementation. This will introduce new classes,

  • APIRevisionDeploymentSimpleWorkflowExecutor
  • APIRevisionWorkflowDTO

@GihanAyesh
Copy link

Developer comments - Progress update

Continue implementing the simple workflow. Made changes to the folllowing classes,

  • APIProviderImpl
  • ApiMgtDAO
  • TenantWorkflowConfigHolder
  • WorkflowConstants
  • APIConstants
  • default-workflow-extensions
  • h2.sql

@GihanAyesh
Copy link

Developer comments - Progress update

The simple workflow is working. Started working on the approval flow.

@GihanAyesh
Copy link

Developer comments - Progress update

Currently writing the logic of the APIRevisionDeploymentApprovalWorkflowExecutor

@GihanAyesh
Copy link

Developer comments - Progress update

The logic is implemented for the db entry to be created. Still working on finalizing the approval flow.

@GihanAyesh
Copy link

Developer comments - Progress update

When implementing the admin approval workflow, a variable mismatch happens. Currently trying to resolve that issue.

@GihanAyesh
Copy link

Developer comments - Progress update

Resolved the issue with admin approval flow. The implementation of the admin flow is almost done. Also sent the architecture mail. Also done the revision deletion via approval workflow for publisher portal.

@GihanAyesh
Copy link

Developer comments - Progress update

Completed the admin approval flow and discussed with @chamilaadhi about the implementation. Apparently, adding the logic to executor complete function is the old method. Refactoring that now.

@GihanAyesh
Copy link

Developer comments - Progress update

Had a design discussion regarding the deployment revision page. Two options were given.

Option 1

Image

Option 2

Image

The first option was picked with few alterations.

@GihanAyesh
Copy link

Developer comments - Progress update

Admin portal UI changes are complete. Currently working on publisher portal UI changes.
With that following tasks needs to be done

  • Cancel workflow request from publisher portal backend logic
  • Hide a gateway from deploy new revision when it has revision with created status
  • API Publisher Get logics
  • Delete API logic

@GihanAyesh
Copy link

Developer comments - Progress update

Implemented the cancel workflow request from publisher portal backend logic and tested it in the rest level. Faced with an error and resolved that. Working on delete API logic and main publisher portal UI changes.

@Kamidu
Copy link

Kamidu commented Sep 28, 2023

@GihanAyesh ,

Small suggestion on this feature, will it be a possibility to provide an option where an admin can provide feedback to the API provider on the approval? specially when an API publication or revision is rejected what is the reason behind it so they can apply necessary changes promptly? WDYT?

@GihanAyesh
Copy link

Hello @Kamidu,
Since this suggestion is common for every workflow, it is under discussion on adding to APIM 4.3.0. Once the discussion is finalized I will give an update on that.

@GihanAyesh
Copy link

Developer comments - Progress update

The delete API logic is completed. Currently working on the publisher portal UI and backend GET changes.

@GihanAyesh
Copy link

Developer comments - Progress update

Added changes to the deployment UI page with pending updates and removing gateway which has pending revisions from the 'Deploy New Revision' page.

@GihanAyesh
Copy link

Developer comments - Progress update

Completed the implementation.
Made the changes to deployment, overview, deploy sample API, try out UI pages. Tested the flows and fixed the bugs occurred.
Tested multiple gateways, tenants and API Product flows.

Scheduled the code review on 9th of October.

@GihanAyesh
Copy link

GihanAyesh commented Oct 9, 2023

Developer comments - Progress update

The carbon apimgt PR : wso2/carbon-apimgt#12169
The APIM apps PR : wso2/apim-apps#509

Conducted the code review and few changes are suggested. Currently working on the said changes.

@GihanAyesh
Copy link

Developer comments - Progress update

The new UI is designed.

Image

A code review is scheduled for today.

@GihanAyesh
Copy link

Developer comments - Progress update

A discussion was happened since the design that was selected on last Friday code review was not adequate. After the discussion a design with the two column structure with one column handling select revision drop down and the pending revisions and the other column solely handling deployed revisions is finalised. Currently developing that.

@GihanAyesh
Copy link

GihanAyesh commented Oct 18, 2023

Developer comments - Progress update

The new design is finalized.

Image

Started working on writing new test cases and fixing broken tests.

@GihanAyesh
Copy link

Developer comments - Progress update

Will close the issue once the PRs are merged.

@GihanAyesh
Copy link

GihanAyesh commented Oct 25, 2023

@GihanAyesh
Copy link

Developer comments - Progress update

Closing this as PRs are merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants