question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Track the last time when the entity was changed

See original GitHub issue

Feature Suggestion

Track the last time when the entity was changed

Possible Implementation

Maybe a new db field like last_changed_at can be added in refresh_state database table. Once an entity has been discovered, maybe based on whether the result_hash in refresh_state table is changed, the last_changed_at can be updated accordingly.

Context

This will help track the freshness of the entity. If an entity was not updated for 1 month, it can be considered as outdated. We are trying to improve the entity update process like notifying entity owners if they haven’t update their entity for long time.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:19 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
frebencommented, Nov 14, 2022

I’m arguing that instead, we should first make sure to track this in the catalog database tables. Putting (especially time based) volatile information in the catalog entities is probably unfortunate. Either way, after we have this info in the database, we could consider reading it up and adding it to entities as part of the stitching step later on.

Main task is to add columns to the proper tables (see the migrations directory), and then to make sure to write to those columns in the required places (see especially the DefaultEntitiesCatalog and Stitcher classes).

1reaction
Rugvipcommented, Oct 20, 2022

This might be as simple as adding the current timestamp to the entity around here. I think I’d vote for an annotation, e.g. backstage.io/updated-at. Not sure if it’s worth backfilling, but it could be done using a database migration of the final entities table.

Is it worth it? What do you think @backstage/catalog-core?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using Entity Framework how can i find out when the last ...
1 Answer 1 ... Add a 'last updated' column to your table and query that one for the latest change. Update: If that...
Read more >
Change Tracking in Entity Framework
Here, you will learn how Entity Framework tracks changes on entities during their life time. Entity Framework supports automatic change tracking of the...
Read more >
Tracking vs. No-Tracking Queries - EF Core | Microsoft Learn
Tracking behavior controls if Entity Framework Core will keep information about an entity instance in its change tracker.
Read more >
How to track the history of data changes using SQL Server ...
In this blog post, you are going to see how to track the history of data changes using SQL Server 2016 System-Versioned Temporal...
Read more >
Entity Change Tracking using DbContext in Entity Framework 6
The method outlined about is a good way to track and audit changes made to existing entities. It allows you to record the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found