backstage icon indicating copy to clipboard operation
backstage copied to clipboard

feat: delete unprocessed entity from refresh_state table

Open kurtaking opened this issue 1 year ago • 16 comments

Hey, I just made a Pull Request!

re: https://github.com/backstage/backstage/issues/21858

Add the ability to delete a record from the refresh_state table.

image

:heavy_check_mark: Checklist

  • [x] A changeset describing the change and affected packages. (more info)
  • [ ] Added or updated documentation
  • [ ] Tests for new functionality and regression tests for bug fixes
  • [x] Screenshots attached (for UI changes)
  • [x] All your commits have a Signed-off-by line in the message. (more info)

Remaining todos

  • [x] add support for permissions
  • [x] determine - do we need this functionality on both the Failed and Pending tabs?
  • [ ] address breaking change concerns

kurtaking avatar Feb 02 '24 18:02 kurtaking

Changed Packages

Package Name Package Path Changeset Bump Current Version
example-backend packages/backend none v0.2.93-next.2
@backstage/plugin-catalog-backend-module-unprocessed plugins/catalog-backend-module-unprocessed minor v0.3.11-next.2
@backstage/plugin-catalog-unprocessed-entities-common plugins/catalog-unprocessed-entities-common patch v0.0.0
@backstage/plugin-catalog-unprocessed-entities plugins/catalog-unprocessed-entities minor v0.1.9-next.2

backstage-goalie[bot] avatar Feb 02 '24 18:02 backstage-goalie[bot]

Uffizzi Cluster pr-22667 was deleted.

github-actions[bot] avatar Feb 02 '24 18:02 github-actions[bot]

@kurtaking, this is awesome! I know this is Draft but just want to mention that this should probably have support for being locked down with permissions. 👍

awanlin avatar Feb 02 '24 19:02 awanlin

I could use feedback on what we want to do with the <PendingEntities /> component (tab).

kurtaking avatar Feb 02 '24 19:02 kurtaking

What's the use case for deleting unprocessed_entities?

I'm might be misunderstanding here, but I think that having many unprocessed_entities is a symptom of a larger issue that the things on the queue are not being processed in a timely manner. They should eventually be moved from there into final_entities I believe. @freben to confirm?

benjdlambert avatar Feb 02 '24 19:02 benjdlambert

Not quite, could also be that they are in a corner case where they never successfully get processed or so, for example.

freben avatar Feb 02 '24 19:02 freben

hey @benjdlambert, does the info in this issue provide enough context?

kurtaking avatar Feb 02 '24 19:02 kurtaking

I'm pausing this work until I hear back.

kurtaking avatar Feb 06 '24 16:02 kurtaking

@alde think this one is something that you might find interesting

benjdlambert avatar Feb 13 '24 09:02 benjdlambert

@kurtaking, please keep going, I think this is a totally valid feature to add and I know it would have helped a few people recently on Discord. 👍

awanlin avatar Feb 13 '24 12:02 awanlin

I like this, the plugin was meant as a bit of an admin tool to get some insights into why entities don't show up, but it certainly could make sense to be able to remove things too. Worst case scenario if you delete something that's still tracked it'll come back with the same issue, so not really a big problem I believe.

alde avatar Feb 13 '24 13:02 alde

I could use feedback on what we want to do with the <PendingEntities /> component (tab).

Pending entities I don't really think should be deleted - they should either get processed or failed. Ideally they shouldn't be pending for very long.

alde avatar Feb 13 '24 13:02 alde

hey @awanlin, any recommendation on resolving the failed Preview (build) / Build PR image (pull_request) step?

kurtaking avatar Feb 13 '24 16:02 kurtaking

Honestly not sure but I triggered it to run again and we'll see how that goes 🤔

awanlin avatar Feb 13 '24 17:02 awanlin

Looks like that did it, builds are green! 🚀

awanlin avatar Feb 13 '24 18:02 awanlin

@alde gonna leave this for you and @backstage/catalog-maintainers to review and ship :tada:

benjdlambert avatar Feb 16 '24 10:02 benjdlambert

@kurtaking given a breaking change isn't a deal breaker, is there anything left to do?

alde avatar Mar 01 '24 15:03 alde

@kurtaking given a breaking change isn't a deal breaker, is there anything left to do?

@alde, I was out moving last week. I will update the changelog to be a major bump and we should be good to go 👍🏼

kurtaking avatar Mar 04 '24 15:03 kurtaking

@kurtaking think that the changeset should still be minor if it's a breaking change. The package is still 0.x I think, so minor is effectively for breaking changes when the package is less than stable.

benjdlambert avatar Mar 04 '24 15:03 benjdlambert

@kurtaking think that the changeset should still be minor if it's a breaking change. The package is still 0.x I think, so minor is effectively for breaking changes when the package is less than stable.

@benjdlambert - TIL, thank you! I'll get that updated.

kurtaking avatar Mar 04 '24 15:03 kurtaking

Looking for another review from the maintainers / codeowners 👋🏼 ❤️

kurtaking avatar Mar 05 '24 16:03 kurtaking

@vinzscam, I see you are listed as codeowner under the reviewers. Can you help with the second review?

kurtaking avatar Mar 06 '24 17:03 kurtaking

@awanlin, can you help get me traction with the required reviews?

kurtaking avatar Mar 12 '24 14:03 kurtaking

@kurtaking can you rebase the PR? :pray:

benjdlambert avatar Mar 12 '24 14:03 benjdlambert

@kurtaking can you rebase the PR? 🙏

@benjdlambert, doing so is causing some unexpected failures.

kurtaking avatar Mar 12 '24 14:03 kurtaking

@kurtaking I think I might have fixed it 🤞

benjdlambert avatar Mar 12 '24 14:03 benjdlambert

@kurtaking I think I might have fixed it 🤞

@benjdlambert, your update contained a few errors, so I rebased it again. Still running into issues 😢

kurtaking avatar Mar 13 '24 13:03 kurtaking

thank you, @benjdlambert!! 🙌🏼

kurtaking avatar Mar 13 '24 16:03 kurtaking

@kurtaking I just want to make the changes to support the new auth system with this before shipping, apologies for the delay, will try and get to this in the next day or so :pray:

benjdlambert avatar Mar 15 '24 14:03 benjdlambert

@kurtaking I think this should be good to go now. Sorry for the delay - I've also just updated the changeset to reflect a little update in the APIs. Thought it was better to wrap this up in a create static method similar to the .fromConfig statics that we have so that we can evolve the API a little easier rather than using a constructor for this.

benjdlambert avatar Mar 19 '24 08:03 benjdlambert