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 #22338: Refactor some code and changes API url for compliance by directive #4674

Conversation

ElaadF
Copy link
Member

@ElaadF ElaadF commented Feb 28, 2023

val z = implicitly[Line].value
val description = "Get a directive's compliance to CSV format"
val (action, path) = GET / "compliance" / "directives" / "export" / "{id}"
val (action, path) = GET / "compliance" / "directives" / "{id}"
Copy link
Member Author

@ElaadF ElaadF Feb 28, 2023

Choose a reason for hiding this comment

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

@VinceMacBuche you mentioned here that you will prefer this format: /compliance/directives/{id}?format=csv
I think it could be problematic because:

  • the endpoint is the same as directive's compliance by ID, the two requests are the same for the webapp, since ?format=csv is not defined in the endpoint definition but we capture it at the moment we received the request
  • the archive API use the format /archives/export?object=robject_id

Copy link
Member

Choose a reason for hiding this comment

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

Yes i meant that csv and json should be the same endpoint, with a default format value to be json. I made a second commit with refactoring

@ElaadF
Copy link
Member Author

ElaadF commented Feb 28, 2023

Commit modified

@ElaadF ElaadF force-pushed the arch_22338/refactor_some_code_and_changes_api_url_for_compliance_by_directive branch from 69199ad to 4664db2 Compare February 28, 2023 14:22
@ElaadF ElaadF added the WIP Use that label for a Work In Progress PR that must not be merged yet label Feb 28, 2023
@VinceMacBuche
Copy link
Member

PR updated with a new commit

3 similar comments
@VinceMacBuche
Copy link
Member

PR updated with a new commit

@VinceMacBuche
Copy link
Member

PR updated with a new commit

@VinceMacBuche
Copy link
Member

PR updated with a new commit

@VinceMacBuche
Copy link
Member

Commit modified

@VinceMacBuche VinceMacBuche force-pushed the arch_22338/refactor_some_code_and_changes_api_url_for_compliance_by_directive branch 2 times, most recently from 2920bed to c36ee28 Compare March 6, 2023 15:33
@ElaadF
Copy link
Member Author

ElaadF commented Mar 6, 2023

PR rebased

@ElaadF ElaadF force-pushed the arch_22338/refactor_some_code_and_changes_api_url_for_compliance_by_directive branch from c36ee28 to 1bf6f1a Compare March 6, 2023 16:59
@VinceMacBuche VinceMacBuche force-pushed the arch_22338/refactor_some_code_and_changes_api_url_for_compliance_by_directive branch from 1bf6f1a to e986730 Compare March 7, 2023 08:59
…y directive

fixup! Fixes #22338: Refactor some code and changes API url for compliance by directive

Fixes #22338: Refactor some code and changes API url for compliance by directive
@ElaadF ElaadF force-pushed the arch_22338/refactor_some_code_and_changes_api_url_for_compliance_by_directive branch from e986730 to abe64ee Compare March 7, 2023 13:27
@ElaadF ElaadF removed the WIP Use that label for a Work In Progress PR that must not be merged yet label Mar 7, 2023
@Normation-Quality-Assistant
Copy link
Contributor

OK, merging this PR

@Normation-Quality-Assistant Normation-Quality-Assistant merged commit abe64ee into Normation:branches/rudder/7.3 Mar 7, 2023
precision.getOrElse(CompliancePrecision.Level2)
) // by default, all details are displayed
val t4 = System.currentTimeMillis
TimingDebugLogger.trace(s"API DirectiveCompliance - serialize to json in ${t4 - t3} ms")
Copy link
Member

Choose a reason for hiding this comment

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

I have 5,5s on this part to show compliance per directive on load platform

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants