Skip to content
This repository has been archived by the owner on Sep 10, 2022. It is now read-only.

Add getPluginList Controller API #46

Merged
merged 2 commits into from
Jun 16, 2020
Merged

Conversation

sladyn98
Copy link
Contributor

This PR adds the controllers for pulling in the update center.json.

@sladyn98 sladyn98 requested a review from a team as a code owner June 10, 2020 09:43
public PluginController(UpdateCenterService updateCenterService) {
this.updateCenterService = updateCenterService;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should I put its usage here ? like a sort of api docs

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes! Always include extra documentation, it's never bad to leave notes for people (and even yourself!) who will be looking at this later.

@sladyn98 sladyn98 added feature A PR that adds a feature backend Related to the backend service labels Jun 10, 2020
@sladyn98 sladyn98 added this to the [GSoC Phase 1] milestone Jun 10, 2020
@sladyn98 sladyn98 linked an issue Jun 10, 2020 that may be closed by this pull request
Copy link
Contributor

@kwhetstone kwhetstone left a comment

Choose a reason for hiding this comment

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

There's a few things that could be updated around the try/catch. Essentially every time you have a try, catch!

public PluginController(UpdateCenterService updateCenterService) {
this.updateCenterService = updateCenterService;
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes! Always include extra documentation, it's never bad to leave notes for people (and even yourself!) who will be looking at this later.

@sladyn98 sladyn98 requested a review from kwhetstone June 12, 2020 06:08
public ResponseEntity<?> getPlugins() {
LOGGER.info("Request Received");
try {
return new ResponseEntity<>(updateCenterService.downloadUpdateCenterJSON().toMap(), HttpStatus.OK);
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this generic have a type?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is returning a Hash map, but I read it is best practise to leave it generic, if you want I could change it :)

@sladyn98 sladyn98 merged commit df32167 into jenkinsci:master Jun 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backend Related to the backend service feature A PR that adds a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Controller API for plugin extraction.
2 participants