-
Notifications
You must be signed in to change notification settings - Fork 99
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
feat(Project): New configuration make project and releases relationship more flexible for dependencies #1963
feat(Project): New configuration make project and releases relationship more flexible for dependencies #1963
Conversation
@hoangnt2 @KoukiHama "Dependency Network" tab replace existing "License Clearing” tab it was not porposed in this way, can we please discuss this.
|
Thanks for your comments. I will discuss with Qiu and give feedback you tomorrow. |
@shi9qiu any update? |
Hi @ag4ums , Thank you for your comments. I have discussed this with Tien-san, please allow me to discuss more about this issue here. We proposed this function with two modes - ON and OFF. Changes only happen when the user enables this function. If not, everything will be the same as before (at the source code level). I would like to begin with the second concern - "not seeing an option to view only the direct dependencies separately". It's easy for us to develop a new feature to show the direct dependencies only based on the developed one. For example, hide the transitive dependencies when the user clicks a button. So this would not be a problem. But we would like to discuss more on the first concern - "it will break all existing clients". Actually, besides the four APIs we modified and the dependency part in GUI, all other APIs and functions can be used as before. To achieve this, we add a new field (releaseRelationNetwork) to store the dependency network (direct dependencies and transitive dependencies) in the project and keep it in sync with the releaseIdToUsage field. The releaseIdToUsage field is not replaced by the new one and still be there. That's also the reason why other functions will not be affected. Besides, We also create a migration script to convert the data from the releaseIdToUsage field to the releaseRelationNetwork field. It will help users to switch between two modes. I think maybe we use a bad name "Dependency Network" for this new tag. It looks like we drop the "License Clearing" tab and the function in this tab. But actually, the two tabs are almost the same. All functions are kept as before. The only difference is the new tab can show and edit the transitive dependency. So maybe we can still use the name "License Clearing", and the user may even not notice the change. I don't know if my reply answers your question and resolves your concerns. Maybe we misunderstand what you mean by "existing clients". But we are so glad to hear more from you and waiting to solve anything you are worrying about. Thank you! |
So, coming back to the first point that enable this option works well, that’s good, so user can choose to enable it but I am afraid once user migrated to this new option to use dependency network functionality will they be able to switchback.... though not sure if the switching back is required, but what worries me.... if this feature is breaking the existing rest-client/s, and if someone do changes at the client side to support 'Dependency Network', that should not break the current flow(as I see the otherway its breaking now) . |
Hi @ag4ums , I have discussed these issues with @tienlee and @hoangnt2 , and got some ideas. Please let me share them with you here.
What do you think about these ideas? If you have any questions or concerns, please feel free to contact us anytime. Thank you! |
71c519c
to
6a069af
Compare
9456d5a
to
4c4ecc1
Compare
b878312
to
954a62b
Compare
Hi, @ag4ums We have finished a new version and pushed the source code to this PR. This new version is developed based on what we discussed above. Could you help to review it again? The biggest change of this new version is that we don't change any existing APIs so they can be used as before for the "ON" mode. Instead, We added 3 new APIs related to the dependency network. We also updated the description of this PR to explain this. If you have any questions or concerns, please feel free to contact us anytime! |
03f8d08
to
3a97d31
Compare
3a97d31
to
5315aff
Compare
5315aff
to
f9a6e0d
Compare
...er/src/main/java/org/eclipse/sw360/datahandler/cloudantclient/DatabaseConnectorCloudant.java
Outdated
Show resolved
Hide resolved
f9a6e0d
to
5c4f93b
Compare
@GMishx, thanks for your comments. I updated source code following your comments |
5c4f93b
to
e30ab1e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kindly look into some minor comments
backend/src-common/src/main/java/org/eclipse/sw360/datahandler/db/ComponentDatabaseHandler.java
Outdated
Show resolved
Hide resolved
backend/src-common/src/main/java/org/eclipse/sw360/datahandler/db/ComponentDatabaseHandler.java
Show resolved
Hide resolved
...360-portlet/src/main/resources/META-INF/resources/html/utils/ajax/linkedReleaseInNetwork.jsp
Outdated
Show resolved
Hide resolved
e30ab1e
to
95219ee
Compare
@smrutis1, I updated source code following your comments, please help me to check them |
…ip more flexible Signed-off-by: hoangnt2 <[email protected]>
95219ee
to
d25d35c
Compare
Thank you @smrutis1 for review codes |
How to enable this feature
To use this function, please:
Build the source code and deploy.
Add config enable.flexible.project.release.relationship=true (/etc/sw360/sw360.properties) to enable the feature.
The following changes will work when enable.flexible.project.release.relationship=true only.
Before you run the script, please change two places in the script:
(1) Line 30:
DRY_RUN = True
->DRY_RUN = False
(2) Line 32:
COUCHSERVER = 'http://localhost:5984/'
->COUCHSERVER = 'http://admin:password@localhost:5984/'
admin
andpassword
should be your username and password for CouchDB.The important information
This feature has two modes - "ON" and "OFF". If the user doesn't enable this feature, everything will be the same as before (at the source code level).
For the "ON" mode, We add three new APIs and modify an old API to help users modify the dependency network of a project. But other old APIs will work as before. Users may not notice the change if they only use the old APIs. So all clients or tools working with sw360 by APIs will work as before as well. For example, our new API 3.3.36 (Creating a project with dependencies network) will allow the user to create a new project with a dependency network, but the user can still use the old API 3.3.20 (Creating a project) to register a project with some releases (i.e. direct dependencies) linked to itself.
For the "OFF" mode, we add a new field "releaseRelationNetwork" in the database to store the dependency network. But we still keep the old filed "releaseIdToUsage" which stores the "Linked Release". What's more, we always sync these two fields. So when the user switches back to "ON" mode, no data will be lost.
1. Introduction
This manual aims to introduce the Dependency Network feature. Refer issue: #1538
The dependency network feature is a new function to make the dependency management of a project more flexible by allowing the users to customize the dependency graphs of their projects.
To help the reviewers test and review this new feature more quickly and easily, Toshiba makes this manual.
2. How to test?
This feature modify the GUI of the “Linked Releases And Projects” on the “project edits” page.
Now the “Linked Releases” table could show all dependencies of a project (both direct and transitive ones). Users can modify these dependencies as well.
2.1. The changes of edit project GUI
In this section, we will introduce the changes in GUI behaviors. We modified or added 5 sub-functions below:
a. Modify the “Add Releases” button: This button will add a direct dependency (release) in the dependency graph of this project.
b. A new icon button to add a dependency (release) to another dependency (release) in the dependency graph. Note that this dependency added is seen as the transitive dependency of this project.
c. A new icon button to load the default dependency graph of a dependency (release) by importing the dependency information stored on the component page. Note that this button will load all dependencies (both direct and transitive ones) of the corresponding dependency (release).
d. The combo box allows the user to modify the version of a dependency.
e. The “Check Dependency Network” button will compare and show the different dependency information which is not consistent with the default one stored on the component page by highlighting them. The inconsistency usually happens after users modified the dependency graph or imported an old project.
2.2. The changes of view detail project GUI
The license Clearing tab will work the same as before. But it will show the data from the dependency network we modified on the edit page.
2.3 Rest API changes
New Rest APIs
a. 3.3.35. Get a single project with dependencies network
The response will include the dependencyNetwork field(It will show the dependency network of project (direct and indirect releases)):
b. 3.3.36. Creating a project with dependencies network
If the dependencyNetwork field is included in the request body, a dependency network will be registered for the project.
c. 3.3.37. Update a project with dependencies network
Same request body as "Creating a project with dependencies network".
Modify Rest APIs
a. 3.5.18. Delete a release
Cannot delete release if it is existing in the dependency network of any project
2.4 The change in database and migrate data
2.5 Test this feature with component.visibility.restriction.enabled option (refer #1357)
3. How to review?
This chapter introduces which file is modified to achieve the corresponding function.
3.1. Rest API
Table 1: RestAPI functions
3.2. GUI
Table 2: UI functions
- frontend/sw360-portlet/src/main/resources/META-INF/resources/html/utils/includes/editLinkedReleasesInNetwork.jspf
- frontend/sw360-portlet/src/main/java/org/eclipse/sw360/portal/portlets/LinkedReleasesAndProjectsAwarePortlet.java
- frontend/sw360-portlet/src/main/java/org/eclipse/sw360/portal/portlets/projects/ProjectPortlet.java
- frontend/sw360-portlet/src/main/resources/META-INF/resources/html/projects/includes/projects/dependencyNetwork.jsp
- frontend/sw360-portlet/src/main/java/org/eclipse/sw360/portal/portlets/projects/ProjectPortlet.java
+ Used By Project table
+ Used By Project table
Reference documents:
PR.for.Dependency.network.feature.docx
A.New.Dependency.Management.Function.for.SW360_qiu.pdf