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

Delete-job-details changes #372

Conversation

MadinaBonuAlisherova
Copy link

Description

Create a Delete Job Details Rest API with documentId as a input parameter. It will help to delete job details objects with issues with the help of API

Issues Resolved

Prerequisites

Additional context

create RestDeleteJobDetailsAction in path org.opensearch.jobscheduler.action
RestDeleteJobDetailsAction should extend abstract class BaseRestHandler
Override routes() and prepareRequest() method in RestDeleteJobDetailsAction class
Define two static strings in class
public static final String DELETE_JOB_DETAILS_ACTION = "delete_job_details_action";
public static final String DOCUMENT_ID = "document_id";
In routes method return a list of route with given Route below
new Route(DELETE, String.format(Locale.ROOT, "%s/%s/{%s}", JobSchedulerPlugin.JS_BASE_URI, "_delete_job_details", DOCUMENT_ID))
Override getName() method and return DELETE_JOB_DETAILS_ACTION
Create a public constructor in RestDeleteJobDetailsAction with JobDetailsService as argument and initialize the local variable
public RestDeleteJobDetailsAction(JobDetailsService jobDetailsService){
this.jobDetailsService=jobDetailsService;
}

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@joshpalis
Copy link
Member

@MadinaBonuAlisherova this is great work! It seems that some checks are failing :

Execution failed for task ':spotlessJavaCheck'.
> The following files had format violations:
      src/main/java/org/opensearch/jobscheduler/rest/action/DeleteJobDetailsAPI.java
          @@ -32,7 +32,6 @@
           import·static·org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken;
           import·static·org.opensearch.jobscheduler.rest.request.DeleteJobDetailsRequest.DOCUMENT_ID;
           import·static·org.opensearch.rest.RestRequest.Method.DELETE;
          -import·static·org.opensearch.rest.RestRequest.Method.PUT;
           
           public·class·DeleteJobDetailsAPI·extends·BaseRestHandler·{

This error describes a format violation, in order to fix this just run ./gradlew spotlessApply and push the changes.

The Developer Certificate of Origin check is also failing, in order to fix this, ensure that you sign off on your commit using -s like so : git commit -s -m "your commit message"

@minalsha minalsha linked an issue Apr 26, 2023 that may be closed by this pull request
Signed-off-by: Alisherova Madinabonu <54506754+MadinaBonuAlisherova@users.noreply.github.com>
@codecov-commenter
Copy link

Codecov Report

Merging #372 (d1292da) into main (8eecad0) will decrease coverage by 1.49%.
The diff coverage is 0.00%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@             Coverage Diff              @@
##               main     #372      +/-   ##
============================================
- Coverage     28.77%   27.29%   -1.49%     
  Complexity       97       97              
============================================
  Files            22       24       +2     
  Lines          1178     1242      +64     
  Branches        109      116       +7     
============================================
  Hits            339      339              
- Misses          818      882      +64     
  Partials         21       21              
Impacted Files Coverage Δ
.../jobscheduler/rest/action/DeleteJobDetailsAPI.java 0.00% <0.00%> (ø)
...cheduler/rest/request/DeleteJobDetailsRequest.java 0.00% <0.00%> (ø)

... and 1 file with indirect coverage changes

@joshpalis joshpalis closed this Sep 27, 2023
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.

[Extensions] Delete Job Details API
3 participants