Closed YasasRangika closed 8 months ago
Analyzed the flow of Operation level policies feature works and had a few meetings with Lakshitha and Isuru. Started this feature implementation from the REST level and added OAS changes to the publisher-API specification. Had an initial coding review with generated classes and DTOs with Lakshitha. He suggested reducing some implementation at this level and pointed out the required REST APIs. Starting implementations of the persistence layer changes.
Completed:
In progress:
Completed:
In progress:
Completed:
In progress:
Completing the policy aggregation process by creating the final artifact file to be deployed in the gateway.
[1] mail: "Re: [Architecture] [New Feature] Support Deploy/Undeploy Gateway-Specific Global Policies from UI/REST APIs"
Completed:
In progress:
Implemented the basic UIs / Routing / Data handling and updating.
Please note that
Please find the implemented UIs.
Landing Page
Create Page
Edit Page
Please find the below diagram in order to get a rough idea about the React:TSX component structure of the implementation.
Improved the UI and implemented the front-end validations.
Please note that since the backend implementation for this is still not merged, connecting the backend to frontend for dummy promises is yet to be done.
Some concerns are needed to be clarify and depending on that, further implementation on front-end will be required if backend implementation is changed.
Hi @piyumaldk,
First and foremost, I must commend you on the outstanding work you've done on the UI for the feature. Your design and implementation are truly impressive, and the refactoring you carried out will significantly improve the overall codebase.
I've just returned from medical leave today and haven't had the chance to review the UI changes you have made.
Given that I'm catching up after my absence, I think it would be helpful for us to have a quick call to sync up. I'd love to hear more about your thought process behind certain design decisions and any concerns you might have regarding the UI. Additionally, it would be a good way for me to provide insights into the backend changes I've made.
As for the backend, the majority of it is now complete, and I've conducted the final code review. There were some last-minute changes requested by the leads, and I incorporated those within the given timeframe. However, I also took some time to enhance certain aspects of the feature for better performance and maintainability. As a result, I had to revise the unit tests and integration tests.
Furthermore, due to the nature of the changes, I'll be testing the backend with all the supported databases to ensure compatibility. There were query-level modifications as well, as per the feedback received during the final code review. I appreciate your understanding, and I'm confident these refinements will contribute to the overall robustness of the feature.
Since I've allocated for patches this week, starting from next week onwards, I will also allocate for RnD, allowing me to give my full focus to this project. Until then, if the backend is a blocker for you to complete the feature, I can provide a working backend within a short timeframe.
Looking forward to our call and to further discussing about this feature.
Thanks and Regards, Yasas
Please find the new react component structure here.
[x] Design a new UI/UX for deploying and un-deploying.
[x] To shorten the name content in Gateway chips, use CSS (text-overflow) rather than a TSX function.
[x] Internationalise the component using React Intl.
[x] Remove response.body.message from Error Messages.
[x] Differentiate column header names from data of the table.
[x] Scope for Global Policies.
[x] Change the Gateway identifier from name to ID.
[x] Implement new design (For expand area (deploy) and un-deploy.
[x] Test the UI/UX.
[x] Write UI tests in cypress.
[x] Documentation.
Here is the progress on the feature implementation, incorporating various suggestions and feedback received during and after the code review:
Completed the implementation of UUID generation for policy mapping. Also, altered the approach by separating the addition and update paths for the new policy mapping, aligning with the discussed code review feedback.
Revised the update flow to perform delete and insert actions solely for the policy mapping table while conducting updates only on the policy metadata table, in accordance with review comments.
Refactored HTTP response handling by changing the status from OK to 201 CREATED for new policy mapping creation. Moreover, the get-all policy mapping API was optimized to reduce response bulkiness by providing only metadata.
Modified the handling of deletion for active deployments in the policy mapping, shifting from a 500 Internal Server Error to more appropriate 401 and 403 error codes for specific cases as suggested in the code review.
Implemented query support for filtering deployments based on gateway labels, meeting the specific requirements identified in the review.
Addressed comments from review meetings by incorporating persistence layer changes, enhancing error logs, adjusting user roles, and removing unnecessary validation parts.
Added changes for gateway label identification based on the UI implementation, introducing a new property in the response object.
To-Do:
Consider using the gateway label ID instead of the name during deployment. Further discussion is needed on this topic.
Incorporate necessary changes to user roles, introducing a new scope to fulfill a recent requirement.
Revisit and reintroduce the policy artifact name change in Synapse, previously removed due to testing inconsistencies. Validate to ensure the issues no longer persist.
Ensure all test changes cover all flows.
Perform a round of DB tests with the recent backend changes, considering the updated functionalities and refinements introduced. This testing phase includes verification across all supported databases to ensure the functionality of the system with the recent modifications.
To-Do:
Problem
In previous versions of API Manager releases, if we want to add a global-level policy to a gateway node, users have to put the manually written xml-type policy file to the location:/repository/deployment/server/synapse-configs/default/sequences with the naming pattern WSO2AM--Ext--.
An example Synapse configuration of a global policy is as follows:
But this approach is no longer promoted with the API Manager 4.3.0 release.
Solution
If the logged-in user has sufficient permission, future API Manager products (from APIM-4.3.0 onwards) will provide a separate UI for adding ( /enabling ) and removing ( /disabling ) the global-level policies under the gateway label.
Affected Component
APIM
Version
No response
Implementation
Related Issues
No response
Suggested Labels
No response