You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by GitBox <gi...@apache.org> on 2022/08/26 19:13:16 UTC

[GitHub] [incubator-devlake] e2corporation opened a new issue, #2861: [Feature][Config-UI] Implement Gitlab API Proxy Access on UI

e2corporation opened a new issue, #2861:
URL: https://github.com/apache/incubator-devlake/issues/2861

   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/incubator-devlake/issues?q=is%3Aissue) and found no similar feature requirement.
   
   
   ### Description
   
   The BE Team has previously added **GitLab API Proxy support** (See PR #2705 for BE Implementation Details). Config-UI can now adopt this endpoint by creating a `useGitlab.jsx` Hook (Modeled after JIRA's API Proxy -- see (`hooks/useJIRA.jsx`) to access Gitlab Project Information. This will allow enhanced Project Selection for Gitlab by either **a)** using auto-completed searchable results so projects can be identified/selected quickly or **b)** Create a Dropdown Project Selector just like JIRA's implementation where a **MultiSelect** component is used. 
   
   The caveat is that we are potentially lots of projects received by the API, so this multi-selector may not be equipped to handle all of that data being rendered in one cycle out-of-the-box, in which case we'll have to enhance that widget with inline pagination. I think option a) which is to upgrade the input tag component with auto-complete capability maybe the first route to try. 
   
   **Important Note**: Another thing to consider is that GitHub may not have API proxy endpoint as yet (?), so for GitHub the project objects will still be user-driven, not api driven but internally those references will still be treated like an Object form so the project input component should be behave normally like it does today for GitHub (let's call that "pure mode"), but for GitLab we'll want to use "api-mode" since we have live data backing it.
   
   ### Core Development Tasks
   
   - [ ] Create and Implement new Gitlab API Hook  (`hooks/useGitlab.jsx`)
   - [ ] Update Project Selector Form Component + Auto-complete Tag Input and/or Searchable Select
   - [ ] Update Related Hooks
   - [ ] Alter Validation Rules
   - [ ] Refactor `configuredProject` to be a formal **Object** since these selections will be data-driven  
      - [ ] Upgrade/Enhance Workflow Components
      - [ ] Update Gitlab Provider Input Widget to use _API_ Mode
      - [ ] Keep Gitlab Provider Input Widget "as-is" in _Pure_ Mode
   - [ ] Restrict API Resource Fetching to Gitlab Provider **ONLY**
   - [ ] Test Blueprint Create Workflow + GITLAB
   
   ### Milestone
   `TBD` Potentially `v0.14.0`
   
   ### BlueprintJS Documentation / Resources (V3)
   Here are doc references to the core underlying components that will be used to implement this feature.
   
   **MultiSelect**
   https://blueprintjs.com/docs/versions/3/#select/multi-select
   
   **TagInput**
   https://blueprintjs.com/docs/versions/3/#core/components/tag-input
   
   ### Use case
   
   Users creating Blueprints with a Gitlab connection now have a formal means of selecting projects available on the Gitlab Platform. Currently users are required to manually enter project-ids after having looking them up themselves manually by leaving Config-UI if they don't already have the information on hand. The idea is to enrich the Gitlab user experience by making it easier to select their projects.
   
   ### Related issues
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] e2corporation commented on issue #2861: [Feature][Config-UI] Implement Gitlab API Proxy Access on UI

Posted by GitBox <gi...@apache.org>.
e2corporation commented on issue #2861:
URL: https://github.com/apache/incubator-devlake/issues/2861#issuecomment-1232847768

   https://blueprintjs.com/docs/versions/3/#select/omnibar 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] e2corporation closed issue #2861: [Feature][Config-UI] Implement Gitlab API Proxy Access on UI

Posted by GitBox <gi...@apache.org>.
e2corporation closed issue #2861: [Feature][Config-UI] Implement Gitlab API Proxy Access on UI
URL: https://github.com/apache/incubator-devlake/issues/2861


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] e2corporation commented on issue #2861: [Feature][Config-UI] Implement Gitlab API Proxy Access on UI

Posted by GitBox <gi...@apache.org>.
e2corporation commented on issue #2861:
URL: https://github.com/apache/incubator-devlake/issues/2861#issuecomment-1234994771

   > No, I means when editing blueprint, backend only tell UI what ids are. How to display them. @e2corporation
   
   I think we'll need to hit the Gitlab API, search for each stored Project ID and then retrieve that metadata to rebuild the list of saved projects.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] e2corporation commented on issue #2861: [Feature][Config-UI] Implement Gitlab API Proxy Access on UI

Posted by GitBox <gi...@apache.org>.
e2corporation commented on issue #2861:
URL: https://github.com/apache/incubator-devlake/issues/2861#issuecomment-1234994078

   > > Once item is selected, the Gitlab Project ID is entered as a new Tag.
   > 
   > You mean, If use search by project name, we only display the id? But if we do this, why we should replace `xxxProject` to object?
   
   If the user searches by ID or Name, the set tag value should still be the Project ID as Backend expects Project ID values.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] e2corporation commented on issue #2861: [Feature][Config-UI] Implement Gitlab API Proxy Access on UI

Posted by GitBox <gi...@apache.org>.
e2corporation commented on issue #2861:
URL: https://github.com/apache/incubator-devlake/issues/2861#issuecomment-1234271157

   > > Got switched up this should all be Gitlab Docs will update
   > 
   > Sorry, I cannot understand what it means. Pardon?
   
   I got confused with the Provider and thought I was dealing with GitHub Instead.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] likyh commented on issue #2861: [Feature][Config-UI] Implement Gitlab API Proxy Access on UI

Posted by GitBox <gi...@apache.org>.
likyh commented on issue #2861:
URL: https://github.com/apache/incubator-devlake/issues/2861#issuecomment-1234464941

   Now UI can request projects by query when adding blueprint.
   But how can UI get these projects by ids?
   Jira requested all of the board but GitLab cannot.
   
   Request by id one by one? @e2corporation 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] e2corporation commented on issue #2861: [Feature][Config-UI] Implement Gitlab API Proxy Access on UI

Posted by GitBox <gi...@apache.org>.
e2corporation commented on issue #2861:
URL: https://github.com/apache/incubator-devlake/issues/2861#issuecomment-1232843614

   > I'm preparing to do this. But I have some questions now. @e2corporation
   > 
   > 1. I haven't understand how to deal with so many projects. Is it considered by the author of `blueprint.js`?
   In part yes, I have provided documentation links to the InputTag and MultiSelect component. Both should support call back methods / handlers for the when value is changed or searched for, to control what data is presented in the list I imagine. How we deal with the large amounts of data is on our implementation however. Dig a bit more in the blueprint js docs to see more details on the handler events.
   
   A key part of this is developing the "AutoComplete" search logic. When the user types a value, that should trigger a method that a) Fetches a Defined # of results from the API, and selectively displays matching results. At the basic level the auto-complete search results rendered will contain the Gitlab Project Name, and importantly the ID. Alternatively, if the Gitlab API has a search resource built in, it would be better to leverage that endpoint.
   
   > 2. gitlab.com may return public projects here. Is this API confirmed the max number of projects that will return?
   We don't know what the max projects will be as yet, our auto-complete fetching logic will need a way to safely page this. As a starter maybe we can limit the result set to just the private projects the user owns, or a hard set slice amount of just 100 for testing until the search logic is built, then discuss how to handle a larger project volume. 
   
   > 3. I want to merge `configuredProject` and `configuredBoard`. Can I do it in this PR or another new PR?
   I thought about doing this but let's hold on combing these entities, there's already enough to change/add on this ticket, for now just proceed to upgrading configuredProject to an object so `configuredProject?.id` will be consistent with `configuredBoard?.id`.  I have to add TAPD settings soon, so anything related to Transformation Design I want to remain as-is for now. I think I will be creating a few Data Models for this ticket to represent Projects and Boards that you'll be able to implement.
   
   This feature should be done cleanly so the least amount of refactoring is done to existing areas, and lessen merge conflicts with the other outstanding refactor effort with regard to dynamic plugin registry.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] e2corporation commented on issue #2861: [Feature][Config-UI] Implement Gitlab API Proxy Access on UI

Posted by GitBox <gi...@apache.org>.
e2corporation commented on issue #2861:
URL: https://github.com/apache/incubator-devlake/issues/2861#issuecomment-1234541397

   Sidenote: Later down the development process, we can still let the user enter an invalid project ID if they wish to ignore search results altogether. But we'll have the ability to cross-check the entered tags against the Search API and if one of the entered projects isn't valid we can set a validation error and prevent the user from going Next. In the system today, user can enter an invalid project ID... if they try to save, backend will return a 404 error and the save process will be halted anyway.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] e2corporation commented on issue #2861: [Feature][Config-UI] Implement Gitlab API Proxy Access on UI

Posted by GitBox <gi...@apache.org>.
e2corporation commented on issue #2861:
URL: https://github.com/apache/incubator-devlake/issues/2861#issuecomment-1234566697

   Some additional food for thought, we can add 2 Radio Options below the Input widget.  
   `(x) Private Projects ( ) Public Projects`
   
   Then use that as a mode flag to handle different scenarios such as large data returned from API or simply to limit behavior and scope (private|public)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] likyh commented on issue #2861: [Feature][Config-UI] Implement Gitlab API Proxy Access on UI

Posted by GitBox <gi...@apache.org>.
likyh commented on issue #2861:
URL: https://github.com/apache/incubator-devlake/issues/2861#issuecomment-1234970939

   > Once item is selected, the Gitlab Project ID is entered as a new Tag.
   
   You mean, If use search by project name, we only display the id? But if we do this, why we should replace `xxxProject` to object?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] e2corporation commented on issue #2861: [Feature][Config-UI] Implement Gitlab API Proxy Access on UI

Posted by GitBox <gi...@apache.org>.
e2corporation commented on issue #2861:
URL: https://github.com/apache/incubator-devlake/issues/2861#issuecomment-1228832112

   @likyh If you're hungry for more, you can take this on yourself or I can start a Draft PR to get some of initial pieces in place and you can complete Implementation. Many different aspects to this feature, one of which allows you to refactor `configuredProject` to be more Object-like finally.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] likyh commented on issue #2861: [Feature][Config-UI] Implement Gitlab API Proxy Access on UI

Posted by GitBox <gi...@apache.org>.
likyh commented on issue #2861:
URL: https://github.com/apache/incubator-devlake/issues/2861#issuecomment-1232802100

   I'm preparing to do this. But I have some questions now. @e2corporation 
   1. I haven't understand how to deal with so many projects. Is it considered by the author of `blueprint.js`?
   2. gitlab.com may return public projects here. Is this API confirmed the max number of projects that will return?
   3. I want to merge `configuredProject` and `configuredBoard`. Can I do it in this PR or another new PR?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] e2corporation commented on issue #2861: [Feature][Config-UI] Implement Gitlab API Proxy Access on UI

Posted by GitBox <gi...@apache.org>.
e2corporation commented on issue #2861:
URL: https://github.com/apache/incubator-devlake/issues/2861#issuecomment-1234546966

   Potentially all this behavior could be applied to either TagInput or MultiSelect. The resulting difference is that with MultiSelect user has lost control of manually entering the value. The other benefit of going the TagInput route is that we don't have to worry about Fetching Projects in Bulk at all, only results we worry about is what comes back from the Search API, and if its within the hundreds the built in scrolling on the drop down will be sufficient.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] e2corporation commented on issue #2861: [Feature][Config-UI] Implement Gitlab API Proxy Access on UI

Posted by GitBox <gi...@apache.org>.
e2corporation commented on issue #2861:
URL: https://github.com/apache/incubator-devlake/issues/2861#issuecomment-1234172967

   > > @likyh Here are the **GitHub REST API Search** Docs https://docs.github.com/en/rest/search. I think the first POC to draft is to take the user's query/search value from the input/select component field, Post that to the API search proxy onKeyUp maybe wrapped with a 3-second delay between each api live query.
   > > Whatever search results are returned by the API, process it into an Array of search result objects that get mounted to the select drop down of available results. User should then be able to click one of the search result entries, that value gets selected as one of the project tags (behind the scenes an the selected value is wrapped in a project object, and then state is set)
   > > **GitHub REST API Search** https://docs.github.com/en/rest/search
   > > **GitLab Rest API Projects** https://docs.github.com/en/rest/projects/projects
   > 
   > Github? Do you want to add search in Github this time too?
   
   Got switched up this should all be Gitlab Docs will update


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] likyh commented on issue #2861: [Feature][Config-UI] Implement Gitlab API Proxy Access on UI

Posted by GitBox <gi...@apache.org>.
likyh commented on issue #2861:
URL: https://github.com/apache/incubator-devlake/issues/2861#issuecomment-1234964702

   No, I means when editing blueprint, backend only tell UI what ids are. How to display them.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] e2corporation commented on issue #2861: [Feature][Config-UI] Implement Gitlab API Proxy Access on UI

Posted by GitBox <gi...@apache.org>.
e2corporation commented on issue #2861:
URL: https://github.com/apache/incubator-devlake/issues/2861#issuecomment-1232846494

   @likyh Also look into this BlueprintJS Component called **Suggest** https://blueprintjs.com/docs/versions/3/#select/suggest


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] e2corporation commented on issue #2861: [Feature][Config-UI] Implement Gitlab API Proxy Access on UI

Posted by GitBox <gi...@apache.org>.
e2corporation commented on issue #2861:
URL: https://github.com/apache/incubator-devlake/issues/2861#issuecomment-1233243697

   @likyh Here are the **GitHub REST API Search** Docs https://docs.github.com/en/rest/search. I think the first POC to draft is to take the user's query/search value  from the input/select component field, Post that to the API search proxy onKeyUp maybe wrapped with a 3-second delay between each api live query.
   
   Whatever search results are returned by the API, process it into an Array of search result objects that get mounted to the select drop down of available results. User should then be able to click one of the search result entries, that value gets selected as one of the project tags (behind the scenes an the selected value is wrapped in a project object, and then state is set)
   
   **GitHub REST API Search**
   https://docs.github.com/en/rest/search
   
   **GitLab Rest API Projects**
   https://docs.github.com/en/rest/projects/projects


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] likyh commented on issue #2861: [Feature][Config-UI] Implement Gitlab API Proxy Access on UI

Posted by GitBox <gi...@apache.org>.
likyh commented on issue #2861:
URL: https://github.com/apache/incubator-devlake/issues/2861#issuecomment-1233654899

   > @likyh Here are the **GitHub REST API Search** Docs https://docs.github.com/en/rest/search. I think the first POC to draft is to take the user's query/search value from the input/select component field, Post that to the API search proxy onKeyUp maybe wrapped with a 3-second delay between each api live query.
   > 
   > Whatever search results are returned by the API, process it into an Array of search result objects that get mounted to the select drop down of available results. User should then be able to click one of the search result entries, that value gets selected as one of the project tags (behind the scenes an the selected value is wrapped in a project object, and then state is set)
   > 
   > **GitHub REST API Search** https://docs.github.com/en/rest/search
   > 
   > **GitLab Rest API Projects** https://docs.github.com/en/rest/projects/projects
   
   Github?  Do you want to add search in Github this time too?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] likyh commented on issue #2861: [Feature][Config-UI] Implement Gitlab API Proxy Access on UI

Posted by GitBox <gi...@apache.org>.
likyh commented on issue #2861:
URL: https://github.com/apache/incubator-devlake/issues/2861#issuecomment-1234259297

   > Got switched up this should all be Gitlab Docs will update
   
   Sorry, I cannot understand what it means. Pardon?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] e2corporation commented on issue #2861: [Feature][Config-UI] Implement Gitlab API Proxy Access on UI

Posted by GitBox <gi...@apache.org>.
e2corporation commented on issue #2861:
URL: https://github.com/apache/incubator-devlake/issues/2861#issuecomment-1234529254

   The more I think about how this particular component should be classified is "**TagInput Selector + Live Search Assist**". We still want to preserve the TagInut behavior as it is today, meaning if the user already knows the Project IDs they can enter it numerically. As stated before, behind the scenes when user is typing, we'll require a min character count of search query of lets say 4 characters.
   
   After search char min limit is passed, API Request gets sent to GitLab Search Endpoint using the currently user typed value. If GitLab returns a > 0 result set, the "Search Result List" is created and shown in the drop down menu. Now the user can look at what matching results from the API have been found. The user could be typing an ID or a String of the project name, it doesn't matter we'll let the API determine any matching results.
   
   Now that matching results are listed, User identifies a project visually and decides to Click on the Project Result Item (which contains everything about the project, ID, name and other metadata provided by API). Once item is selected, the **Gitlab Project ID** is entered as a new Tag.
   
   The process repeats itself until user has discovered all projects they want to add. There is already logic to prevent duplicate tags from being added, so if user searches again and tries to add the same project ID, it will get ignored.
   
   JIRA is different as it uses a _MultiSelect_ Tag Component, where values are strictly predefined from a list and user cannot type or add a custom value in (only value being typed is for querying the list).
   
   The TagInput on the other hand is mainly a user-controlled value, but as they type it still has a query feature that we'll have to tap into.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org