Skip to content

#536 #537 #538 #540 Add Download Support for Config Endpoints, Cron Expression Validator, Cache Update API, and Description Field in Kind

Type of change

  • Bug Fix
  • Feature

Please provide link to gitlab issue or ADR(Architecture Decision Record)
Linked Issues: Task #538, Task #540, Task #536, Task #537

Does this introduce a change in the core logic?

  • [YES]
    The core logic for handling file downloads, cron expression validation, cache description, and update requests has been modified.

Does this introduce a change in the cloud provider implementation, if so which cloud?

  • AWS
  • Azure
  • GCP
  • IBM

Does this introduce a breaking change?

  • [NO]
    The changes are backward-compatible and do not introduce breaking changes.

What is the current behavior?

  • The generateAppYaml and generateKoopConfig methods store config files on the backend filesystem and return a status message.
  • The cronExpr field in Kind is not validated.
  • There is no API support for updating caches, either singly or as a group.
  • The Kind class does not have a description field.

What is the new/expected behavior?

  1. Transformer and Provider Config Files (Task #538 (closed)):

    • Transformer GCZ: Support for downloading the YAML file via the download=true query parameter has been added.
    • Provider GCZ: Support for downloading the JSON file via the download=true query parameter has been added.
    • A new POST method has been introduced for the generateKoopConfig endpoint to handle request bodies, fixing the spec discrepancy in the GET method as per RFC 7231, section 4.3.1.
  2. Cron Expression Validator (Task #536 (closed)):

    • The cronExpr field is validated using a custom CronValidator compatible with Spring's ConcurrentTaskScheduler and CronTrigger.
    • The implementation includes unit tests for valid, invalid, and complex CRON expressions.
  3. Single/Group Cache Update API (Task #537 (closed)):

    • API endpoints for updating a single cache (updateCacheForSingle) or a group of caches (updateCacheForList) have been implemented.
    • Detailed success and failure responses are provided for both single and group updates, with asynchronous queueing of updates.
  4. Kind Description Field (Task #540 (closed)):

    • The description field has been added to the Kind class and is available in the API and services.

Have you added/updated Unit Tests and Integration Tests?

No, unit tests have not been added yet. However, mock-based unit tests can be written to verify:

  • File downloads and status message responses.
  • Cron expression validation.
  • Cache update behavior for single and group operations.

Any other useful information

  • Swagger documentation has been updated to reflect the new endpoints and validations.
  • Test steps include:
    1. Test downloading Transformer and Provider config files with both download=true and download=false.
    2. Ensure cron expression validation in API inputs.
    3. Test single and group cache update API functionality, with success and failure cases.
    4. Ensure the description field in Kind is correctly exposed and handled.

Closes #538 (closed), #540 (closed), #536 (closed), #537 (closed)

Merge request reports

Loading