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

Fixes #8534: Add an technique API endpoint to display directives based on a technique #1117

Conversation

VinceMacBuche
Copy link
Member

directive <- directives
if ( versions match {
case None => true
case Some(versions) => versions.contains(directive.techniqueVersion)
Copy link
Member

Choose a reason for hiding this comment

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

would be clearer to not override versions variable name

@FlorianHeigl
Copy link
Contributor

<3 this will make life easier.

@VinceMacBuche
Copy link
Member Author

Commit modified

@VinceMacBuche VinceMacBuche force-pushed the ust_8534/add_an_technique_api_endpoint_to_display_directives_based_on_a_technique branch from 41079a3 to 51458d4 Compare June 21, 2016 10:30
@VinceMacBuche
Copy link
Member Author

Commit modified

@VinceMacBuche VinceMacBuche force-pushed the ust_8534/add_an_technique_api_endpoint_to_display_directives_based_on_a_technique branch from 51458d4 to 43aa519 Compare June 21, 2016 10:30
@fanf
Copy link
Member

fanf commented Jun 21, 2016

The two endpoints works as advertised, but I find it very hard to use them without an "index" endpoint in /techniques/, which would just output techniques -> [versions] for example. Would it be hard to add ?

@fanf
Copy link
Member

fanf commented Jun 21, 2016

Well, or you need to have a rudder UI open, which is a little sad for an API ;(

@fanf fanf closed this Jun 21, 2016
@fanf
Copy link
Member

fanf commented Jun 21, 2016

(oups)

@fanf fanf reopened this Jun 21, 2016
@VinceMacBuche
Copy link
Member Author

Commit modified

@VinceMacBuche VinceMacBuche force-pushed the ust_8534/add_an_technique_api_endpoint_to_display_directives_based_on_a_technique branch from 43aa519 to 536aec0 Compare June 22, 2016 10:52
}

def listDirectives (techniqueName : TechniqueName, wantedVersions: Option[List[TechniqueVersion]]) : Box[JValue] = {
def serializeDirectives (directives : Seq[Directive], techniques : SortedMap[TechniqueVersion, Technique]) = {
Copy link
Member

Choose a reason for hiding this comment

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

I don't like having closed parameters used in subfunction. It's harder to refactor, and closure leaks all around in scala. Could you add the wantedVersions parameter to parameters of serializeDirectives?

@fanf
Copy link
Member

fanf commented Jun 23, 2016

Appart for the cosmetic remarks, it's ok: you can mark it as mergeable when ready!

@VinceMacBuche
Copy link
Member Author

Commit modified

@VinceMacBuche VinceMacBuche force-pushed the ust_8534/add_an_technique_api_endpoint_to_display_directives_based_on_a_technique branch from 536aec0 to 02f0dca Compare June 23, 2016 15:37
@Normation-Quality-Assistant
Copy link
Contributor

This PR is not mergeable to upper versions.
Since it is "Ready for merge" you must merge it by yourself using the following command:
rudder-dev merge https://github.com/Normation/rudder/pull/1117
-- Your faithful QA

@VinceMacBuche
Copy link
Member Author

OK, merging this PR

@VinceMacBuche VinceMacBuche merged commit 02f0dca into Normation:branches/rudder/3.1 Jun 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants