Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow specifying the page size and filter for Backstage entities #164

Merged
merged 1 commit into from
Feb 20, 2025

Conversation

samstarling
Copy link
Contributor

Allows you to customise the limit and filter parameters that we pass to the Backstage API. Fixes #60.

Allows you to customise the `limit` and `filter` parameters that we
pass to the Backstage API. Fixes #60.
Comment on lines -57 to +59
Load(ctx context.Context, logger kitlog.Logger) ([]*SourceEntry, error)
Load(ctx context.Context, logger kitlog.Logger, client *http.Client) ([]*SourceEntry, error)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change to the interface makes it much easier to use a client with a mocked transport.

Comment on lines +64 to +66
if s.PageSize != 0 {
limit = s.PageSize
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we be validating this somewhere to check it's under a defined maximum?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could, but I don't know what the maximum is. This is going directly from wherever the catalog-importer runs to Backstage, so I don't think we need to introduce a maximum for performance reasons: I think you'd just get a 400 or similar from Backstage in the logs.

So I'm inclined to leave it I think!

@samstarling samstarling merged commit eb6e67c into master Feb 20, 2025
1 check passed
@samstarling samstarling deleted the sam/backstage-filter branch February 20, 2025 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow more customization of query parameters for backstage source
2 participants