Skip to content
This repository has been archived by the owner on Jul 4, 2024. It is now read-only.

Maintain lastUpdate property of ORD resources #3576

Merged
merged 12 commits into from
Jan 16, 2024
Merged

Maintain lastUpdate property of ORD resources #3576

merged 12 commits into from
Jan 16, 2024

Conversation

emmakarova
Copy link
Contributor

@emmakarova emmakarova commented Jan 12, 2024

Description
ORD resources have the lastUpdate field for saving the information about the time when the resources (or its resource definitions if it has such) have changed since the last aggregation. The lastUpdate is not always maintained by the ORD providers, so UCL now will set the right timestamp regarding the state of the resources.

Resources that have the property lastUpdate in the ORD spec - API, Event, Consumption Bundle, Capability, Integration Dependency, Entity Type, Data Product.

Changes proposed in this pull request:

  • set lastUpdate to time.Now when creating the resource (on aggregation when the resource is not present in the DB)
  • find the newest value for the lastUpdate comparing its value in the document and in the db
  • exclude the lastUpdate field from the hash of the resources
  • if the hash of the resource has changed, set the lastUpdate to time.Now
  • add lastUpdate field to Consumption bundle
  • adapt unit tests
  • add migration for altering the bundles table

Related issue(s)

Pull Request status

  • Implementation
  • Unit tests
  • Integration tests
  • chart/compass/values.yaml is updated
  • Mocks are regenerated, using the automated script

@kyma-bot kyma-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 12, 2024
@kyma-bot
Copy link

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@kyma-bot kyma-bot added 🦅 team-falcon Team Falcon Label size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 12, 2024
@kyma-bot kyma-bot added the cla: yes Indicates the PR's author has signed the CLA. label Jan 12, 2024
@emmakarova emmakarova marked this pull request as ready for review January 12, 2024 09:18
@emmakarova emmakarova requested review from a team as code owners January 12, 2024 09:18
@kyma-bot kyma-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 12, 2024
@emmakarova
Copy link
Contributor Author

/retest

@kyma-bot kyma-bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 12, 2024
@emmakarova
Copy link
Contributor Author

/test pre-main-compass-integration-no-dump

@alextargov alextargov self-assigned this Jan 16, 2024
@emmakarova
Copy link
Contributor Author

/test pre-main-compass-integration-no-dump

@emmakarova
Copy link
Contributor Author

/retest

@kyma-bot kyma-bot added the lgtm Looks good to me! label Jan 16, 2024
@kyma-bot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alextargov

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kyma-bot kyma-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 16, 2024
@kyma-bot kyma-bot merged commit 203cb8c into main Jan 16, 2024
11 of 12 checks passed
@alextargov alextargov deleted the CMP-5174 branch February 15, 2024 12:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cla: yes Indicates the PR's author has signed the CLA. 🦅 team-falcon Team Falcon Label lgtm Looks good to me! size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. to be released 🚀 👋 request review Review required
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants