Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 1
feat(datasource-pylon): custom fields introspection (EXT-10)#359
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
Merged
christophebrun-forest
merged 10 commits into
feat/datasource-pylon
from
ext-10-custom-fieldsAug 19, 2026
Uh oh!
There was an error while loading. Please reload this page.
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
fd6bcbe
feat(pylon): client endpoint for custom fields
christophebrun-forest 273f82b
feat(pylon): custom fields introspection
christophebrun-forest e788f56
feat(pylon): register the custom fields on the collections
christophebrun-forest 186fc95
test(pylon): round trip of an introspected custom field
christophebrun-forest 3571e0f
test(pylon): expect MISSING on every custom field carrying presence
christophebrun-forest 10ee33e
fix(pylon): keep custom fields out of group-by
christophebrun-forest d1054c7
fix(pylon): read a custom field as the filter compares it
christophebrun-forest a5aa09a
fix(pylon): normalize the number and date a filter sends
christophebrun-forest 72a916b
docs(pylon): TIME_OPS cannot keep `in` off a date column
christophebrun-forest 2e6a53f
fix(pylon): read an integer custom field as an integer
christophebrun-forest File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
23 changes: 21 additions & 2 deletions
23 packages/forest_admin_datasource_pylon/lib/forest_admin_datasource_pylon/client.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -98,6 +98,21 @@ def fetch_team(id) | ||
| fetch_resource('teams', id) | ||
| end | ||
| # The custom-field definitions of one object type. `object_type` is | ||
| # mandatory on this endpoint, so a schema spanning several collections costs | ||
| # one call per collection rather than one call in total. | ||
| # | ||
| # Degrades to an empty list: this is read while the agent boots, and a token | ||
| # missing the permission — or a Pylon that happens to be down right then — | ||
| # has to cost the operator the custom columns, not the whole datasource. | ||
| def fetch_custom_fields(object_type) | ||
| params = { 'object_type' => object_type } | ||
| best_effort("fetch_custom_fields(#{object_type})", default: []) do | ||
| must_succeed('custom-fields') { collect_pages('custom-fields', params) } | ||
| end | ||
| end | ||
| private | ||
| def search_resource(path, limit:, cursor: nil, filter: nil, search_text: nil) | ||
qltysh[bot] marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| @@ -126,15 +141,19 @@ def fetch_all(path, params = {}) | ||
| # sent. `CursorWalker` answers the other question — the offset/limit window a | ||
| # list view asks for — and is not what this needs. | ||
| # | ||
| # `params` ride along on every page, cursor included: a mandatory parameter | ||
| # dropped on the second request answers a different question than the first. | ||
| # | ||
| # An empty page and a cursor that does not move both stop the loop: neither | ||
| # happens today, but a walk driven by a remote value stops on its own terms. | ||
| def collect_pages(path) | ||
| def collect_pages(path, params = {}) | ||
| records = [] | ||
| cursor = nil | ||
| pages = 0 | ||
| loop do | ||
| page = to_search_page(connection.get(path, cursor.nil? ? {} : { 'cursor' => cursor }).body) | ||
| query = cursor.nil? ? params : params.merge('cursor' => cursor) | ||
| page = to_search_page(connection.get(path, query).body) | ||
| records.concat(page.records) | ||
| pages += 1 | ||
| break if page.next_cursor.nil? || page.next_cursor == cursor || page.records.empty? | ||
48 changes: 47 additions & 1 deletion
48 ...in_datasource_pylon/lib/forest_admin_datasource_pylon/collections/record_serialization.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 18 additions & 3 deletions
21 packages/forest_admin_datasource_pylon/lib/forest_admin_datasource_pylon/datasource.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 8 additions & 1 deletion
9 ...min_datasource_pylon/lib/forest_admin_datasource_pylon/query/condition_tree_translator.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 48 additions & 9 deletions
57 ...ges/forest_admin_datasource_pylon/lib/forest_admin_datasource_pylon/query/filter_value.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.