backstage: π Bug Report: Github events support should cause the changed catalog entity to be immediately processed
π Description
Iβm seeing some interplay between GitHub events support and the catalog processing interval. To stay within GitHub rate limits, we have had to use builder.setProcessingIntervalSeconds
to set the processing interval to 2 hours. Otherwise, with an organization of our size the processing where the catalog wakes up and calls out to GitHub to see if a known, existing catalog entity may have changed is what drives our hitting rate limits.
Note this is separate from any scheduled scan for GitHub Discovery, which looks for new catalog-info.yaml
files. This is about how often we look for updates to catalog files we already know about.
I believe the events mechanism should force immediate processing of the catalog-info.yaml
files in the event, basically marking that the processing interval is due immediately, moving entities in the (possibly multiple) files to the top of the reprocessing queue.
Presently, when we get an event for a known entity, what I see is it basically has no effect. We already know about the entity, and it waits until the next processing interval to pick up the change. So the event mechanism only seems to address discovery of new catalog files. This doesnβt help so much to overcome GitHub rate limit concerns.
π Expected behavior
When Backstage processes a GitHub change event, the changed entities should update immediately. My users should not have to wait 2 hours to see their updates.
π Actual Behavior with Screenshots
Users have to wait until the processing interval, in my case 2 hours, to see the impact of their changes to catalog-info.yaml files.
π Reproduction steps
Change the processing interval to something large, and observe the impact of a GitHub event on the updates to an entity.
π Provide the context for the Bug.
My users are complaining of the time it takes to see and test their changes.
π₯οΈ Your Environment
No response
π Have you spent some time to check if this bug has been raised before?
- I checked and didnβt find similar issue
π’ Have you read the Code of Conduct?
- I have read the Code of Conduct
Are you willing to submit PR?
No, I donβt have time to work on this right now
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 39 (30 by maintainers)
Thank you @wanisfahmyDE for sharing your experience. All my tests and cases Iβve investigated ended similarly so far.
@freben 's comment might lead to a direction that could be the source of issues for some.
If anyone has more details, we are happy to look further into the matter. However, we need more details about your case. For now, I would consider the events to work as expected.
@pjungermann we just implemented it with GitHub and can confirm that all additions, modifications and deletions are reflected instantly π
In case it helps anyone, our complete
catalog.ts
config looks like this:FYI: I did a bigger test using the BitbucketCloudEntityProvider which was the prototype for the event support and with regards to the update mechanism, others follow the same logic. However, there might be differences in provider-specific logic.
For my test, I used
catalogPath: catalog-test.yaml
Environment:
catalog.providers.bitbucketCloud
builder.addEntityProvider(provider);
)env.eventBroker.subscribe(provider);
)BitbucketCloudEventRouter
,GithubEventRouter
, etc.)HttpPostIngressEventPublisher
and/orAwsSqsConsumingEventPublisher
to retrieve events from externalScenario:
All changes were applied immediately.
Originally, I assumed that there might be some issue with the difference between modification and add/remove as modifications will issue a refresh for the already existing entry (similar to the refresh button at the UI) while add/remove use the delta mutation.
However, as described, all cases worked as expected and updates were applied immediately.
@benkeil re your open points:
the event support is a rather recent addition.
I think it is still good to have a full refresh to recover from any potentially missed event.
The processing interval is global and affects all Location entities. This and many other entity providers are based on these under the hood.
Basically, the providers discover catalog files and (de)register Location entities for these.
The processing interval refreshes what their targets (catalog files) contain.
There are a couple of discussions around that matter on different issues with different scopes.
Hey @vonjones and @benkeil can you share more info about the problem?
I tried a really simple reproduction and works as expected. I enabled the Github event (PR) configured webhook in the org and pushed a change in the description . I can see the result after the event is processed.
Did you can see the logs in your app? Something like that:
Maybe we are missing something more specific about the problem.
Can you try to setup a example so we can see the issue happening and reproduce that?
CC: @angeliski
I would be interested to participate.
And just double checking - these are the instructions I referred to https://github.com/backstage/backstage/blob/master/plugins/events-backend-module-github/README.md