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

SCMOD-8730: Support expiry policies #235

Open
wants to merge 197 commits into
base: develop
Choose a base branch
from
Open

SCMOD-8730: Support expiry policies #235

wants to merge 197 commits into from

Conversation

xbreizh
Copy link
Contributor

@xbreizh xbreizh commented Mar 8, 2021

@xbreizh xbreizh self-assigned this Mar 8, 2021
@buildmachine-sou-jenkins2
Copy link
Contributor

@buildmachine-sou-jenkins2
Copy link
Contributor

The Documentation QA site for this branch has been built:
https://pages.github.houston.softwaregrp.net/sepg-docs-qa/JobService_CI_job-service_SCMOD-8730

@xbreizh xbreizh requested a review from dermot-hardy March 9, 2021 21:30
@xbreizh
Copy link
Contributor Author

xbreizh commented Mar 9, 2021

@dermot-hardy I think that I understand what you mean with the RFC 3339 but that would mean passing a date directly so the calculation would have to be made on client's end.
What I was thinking of was to make it easier on client's side and have them specify the date reference as a string then a number of days as integer and the calculation would be done whenever we run the checkExpiration job.
But I can go with a date if you prefer, Swagger uses RFC339 as default already
Here, I use the same object in and out (for newJob and job), but I could return an expirationDate instead for the job. I suppose that it would make more sense.
I tried having a default object to return but failed to find it so I am passing the different statuses and set a default for each element.

An example on json would be:

  "name": "Ingest documents submitted in batches A and B",
  "description": "This job ingests all of the documents that were in the A and B batches.",
  "expiration-policy": {
    "Active": {
      Policy:{
        "action": "delete",
        "referenceDate": "createDate",
        "duration": "70"
      }
    },
    "Failed": {
      Policy:{
        "action": "keep",
        "referenceDate": "lastUpdateDate",
        "duration": "7"
      }
    },
    "Completed": {
      Policy:{
        "action": "delete",
        "referenceDate": "lastUpdateDate",
        "duration": "7"
      }
    },
    "Waiting": {
      Policy:{
        "action": "delete",
        "referenceDate": "lastUpdateDate",
        "duration": "7"
      }
    },
    "Cancelled": {
      Policy:{
        "action": "delete",
        "referenceDate": "createDate",
        "duration": "7"
      }
    },
    "Paused": {
      Policy:{
        "action": "delete",
        "referenceDate": "lastUpdateDate",
        "duration": "7"
      }
    }  
  }, 
  "labels": {
    "repoId": "x37",
    "runNumber": "12",
    "workUnitId": "371"
  },
  "type": "batch-ingestion-job",
  "parameters": {
    "batches": ["batch-a", "batch-b"],
    "operationMode": "EXTRACT",
    "grammarMap": {
      "pii": []
    },
    "extractMaxMatches": 100
  }
}```

for the whole policy setup. But using the default, we should be able to pass only:

```json{
  "name": "Ingest documents submitted in batches A and B",
  "description": "This job ingests all of the documents that were in the A and B batches.",
  "expiration-policy": {
    "Active": {
      Policy:{
        "action": "delete",
        "referenceDate": "createDate",
        "duration": "70"
      }
    },
    "Failed": {
      Policy:{
        "action": "keep",
        "referenceDate": "lastUpdateDate",
        "duration": "7"
      }
    }
  }, 
  "labels": {
    "repoId": "x37",
    "runNumber": "12",
    "workUnitId": "371"
  },
  "type": "batch-ingestion-job",
  "parameters": {
    "batches": ["batch-a", "batch-b"],
    "operationMode": "EXTRACT",
    "grammarMap": {
      "pii": []
    },
    "extractMaxMatches": 100
  }
}```

@xbreizh xbreizh requested a review from dermot-hardy March 10, 2021 13:58
@xbreizh xbreizh requested a review from dermot-hardy March 11, 2021 14:48
@xbreizh
Copy link
Contributor Author

xbreizh commented Jun 23, 2021

New Explain Analyse
Source 1
Source 2

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

Successfully merging this pull request may close these issues.

3 participants