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

CHE-2654: Changing Agent REST API (adding 'id' and 'description' fiel… #2861

Merged
merged 1 commit into from
Oct 28, 2016

Conversation

ibuziuk
Copy link
Member

@ibuziuk ibuziuk commented Oct 21, 2016

What does this PR do?

Changes Agent REST API for using 'id' instead of 'name' (adding 'id' and 'description' fields). Updating "Agents" section in the dashboard for using new API

What issues does this PR fix or reference?

#2654

Previous behavior

Agent names looked more like internal ids / No description field

New behavior

agents

Signed-off-by: Ilya Buziuk [email protected]

@codenvy-ci
Copy link

Can one of the admins verify this patch?

@ibuziuk
Copy link
Member Author

ibuziuk commented Oct 24, 2016

Agent's descriptions might be different (please, advice more suitable options in this case)

let agent = this.cheAgent.getAgentById(id);

let isEnabled = this.isEnabled(agent.id, this.agents);
this.agentsList.push({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we can do :

let agentItem = angular.copy(agent);
agentItem.isEnable = isEnabled;
this.agentsList.push(agentItem);

@ashumilova
Copy link
Contributor

ashumilova commented Oct 24, 2016

@tolusha , @ibuziuk can List<String> getAgents() return list of agent objects? (this will avoid fetching agent's details for each item from the list)

@ibuziuk
Copy link
Member Author

ibuziuk commented Oct 24, 2016

@ashumilova @tolusha this can be done, but probably returning ids instead has been done deliberately for some reason ?

  1. AgentRegistryImpl.java
  2. LocalAgentRegistryImpl.java

@tolusha
Copy link
Contributor

tolusha commented Oct 24, 2016

@ibuziuk @ashumilova
List<Agents> getAgents() it is ok for me.

@ibuziuk
Copy link
Member Author

ibuziuk commented Oct 24, 2016

@tolusha how the AgentRegistryImpl.java should be refactored in this case?

@tolusha
Copy link
Contributor

tolusha commented Oct 24, 2016

@ibuziuk
Let's remove it. It isn't used at all.

@ibuziuk
Copy link
Member Author

ibuziuk commented Oct 24, 2016

@tolusha sounds good ;-)
I will update PR

@ashumilova
Copy link
Contributor

Thank's a lot

@tolusha
Copy link
Contributor

tolusha commented Oct 24, 2016

@ibuziuk Do we need name field along with id ?

@ibuziuk
Copy link
Member Author

ibuziuk commented Oct 24, 2016

@tolusha yes IMO. "name": "Terminal" vs. "id": "org.eclipse.che.terminal"
#2654

@tolusha
Copy link
Contributor

tolusha commented Oct 24, 2016

It duplicates a bit description field then but OK.

@ibuziuk
Copy link
Member Author

ibuziuk commented Oct 24, 2016

@tolusha that is why I commented above:

Agent's descriptions might be different (please, advice more suitable options in this case)

Agent's name + " support" does not seem to be the right thing. However, we can also leave it this way for now, because changing description is just updating the json file (can be done once the right description will be found"

@ashumilova
Copy link
Contributor

+1 on keeping name - it is display human readable name. And some widgets may not contain description - only names as short form.

@ibuziuk
Copy link
Member Author

ibuziuk commented Oct 24, 2016

@ashumilova @tolusha PR has been updated

@@ -1,5 +1,7 @@
{
"name": "org.eclipse.che.ls.csharp",
"id" : "org.eclipse.che.ls.csharp",
"name": "C#",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C# language server

@@ -1,5 +1,7 @@
{
"name": "org.eclipse.che.ls.json",
"id": "org.eclipse.che.ls.json",
"name": "JSON",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JSON language server

@@ -1,5 +1,7 @@
{
"name": "org.eclipse.che.ls.php",
"id": "org.eclipse.che.ls.php",
"name": "PHP",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PHP language server

@ibuziuk
Copy link
Member Author

ibuziuk commented Oct 24, 2016

@tolusha thanks for review - I will update PR later today

@ibuziuk
Copy link
Member Author

ibuziuk commented Oct 24, 2016

@tolusha @ashumilova PR has been updated

@ibuziuk
Copy link
Member Author

ibuziuk commented Oct 25, 2016

PR has been rebased with minor corrections

@ashumilova
Copy link
Contributor

@ibuziuk thank you, we are waiting for M6 to release and will merge it.

@ibuziuk
Copy link
Member Author

ibuziuk commented Oct 25, 2016

@ashumilova most welcome ;-)

@slemeur
Copy link
Contributor

slemeur commented Oct 25, 2016 via email

@ashumilova
Copy link
Contributor

@ibuziuk can you align PR with master and let's merge it?

…ds). Updating "Agents" section in the dashboard for using new API

Signed-off-by: Ilya Buziuk <[email protected]>
@ibuziuk
Copy link
Member Author

ibuziuk commented Oct 28, 2016

@ashumilova done

@ashumilova ashumilova merged commit 3a43fad into eclipse-che:master Oct 28, 2016
@bmicklea bmicklea mentioned this pull request Nov 16, 2016
66 tasks
JPinkney pushed a commit to JPinkney/che that referenced this pull request Aug 17, 2017
CHE-2654: Changing Agent REST API (adding 'id' and 'description' fiel…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants