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

JENKINS-42854: Added description field to the 'Computer' api #2807

Merged
merged 1 commit into from Sep 15, 2017

Conversation

istrangiu
Copy link
Contributor

Description

When creating a new slave node it is possible to add a description, however the description is not available when querying the api for the list of nodes.

See JENKINS-42854.

Details:

I have exposed the description field of a Slave Node that was previously missing in the api.

I have not provided new unit tests as the patch is trivial, also I have not found existing tests for that area of code.

Changelog entries

Proposed changelog entries:

  • API: Added description field to Slave Nodes

Submitter checklist

  • JIRA issue is well described
  • Link to JIRA ticket in description, if appropriate
  • Appropriate autotests or explanation to why this change has no tests
  • For new API and extension points: Link to the reference implementation in open-source (or example in Javadoc)

Desired reviewers

@jglick @kohsuke @stephenc

@daniel-beck
Copy link
Member

FWIW I'd much prefer a more description-like description (with formatting and all), rather than the weird one we currently have. I looked into this a few years back and it wasn't straightforward, don't remember why unfortunately. Could have been related to assumptions in the description widget?

@oleg-nenashev oleg-nenashev added the needs-more-reviews Complex change, which would benefit from more eyes label Mar 16, 2017
@istrangiu
Copy link
Contributor Author

@daniel-beck Could you please elaborate?I don't really understand what you mean. Many thanks.

@istrangiu istrangiu force-pushed the AddApiNodeDescription branch 2 times, most recently from d7841cb to f44e236 Compare March 21, 2017 14:25
@Exported
public @Nonnull String getDescription() {
Node node = getNode();
return (node != null) ? node.getNodeDescription() : "";
Copy link
Member

Choose a reason for hiding this comment

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

Maybe better to return null

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@oleg-nenashev Please could you explain to me why do you think is better to return null instead of an empty string?Thank you in advance.

Copy link
Member

Choose a reason for hiding this comment

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

It is a public API, and without "null" API users may be confused, because empty description is not a undefined description. It is not that important anyway

@oleg-nenashev
Copy link
Member

I suppose @daniel-beck is concerned about the current design of Jenkins where descriptions have a limited functionality. Once and if description becomes a formatted text, returning it via REST API will become not that user-friendly

@oleg-nenashev
Copy link
Member

@daniel-beck gentle ping

@oleg-nenashev
Copy link
Member

Assigned to @daniel-beck since the PR is kinda blocked by his comment

@oleg-nenashev
Copy link
Member

I consider review from @daniel-beck as dismissed, no response after the month. @jenkinsci/code-reviewers please provide the feedback

@daniel-beck
Copy link
Member

Last time I looked into this I couldn't get node descriptions to work, IIRC due to the field/property name which is assumed to be 'description'.

I worry whether this change will result in additional problems moving to a real node description, but haven't had the time to investigate.

In particular, if this is only for the remote API, @Restricted(DoNotUse.class) seems appropriate, to not make this part of the (Java) API.

@daniel-beck daniel-beck removed their request for review May 24, 2017 16:09
@oleg-nenashev oleg-nenashev self-assigned this Jun 22, 2017
@istrangiu
Copy link
Contributor Author

@oleg-nenashev @daniel-beck Sorry for the late reply, I have implemented your feedback. Please review the latest changes.

@oleg-nenashev oleg-nenashev added ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback and removed needs-more-reviews Complex change, which would benefit from more eyes labels Sep 6, 2017
@oleg-nenashev oleg-nenashev merged commit 0b2c682 into jenkinsci:master Sep 15, 2017
@oleg-nenashev
Copy link
Member

@istrangiu thanks for your efforts and patience!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback
Projects
None yet
4 participants