Skip to content

support index queries with generic actions #363

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
merged 4 commits into from
Jul 21, 2025

Conversation

barnabasJ
Copy link
Contributor

@barnabasJ barnabasJ commented Jul 17, 2025

Contributor checklist

Leave anything that you believe does not apply unchecked.

  • I accept the AI Policy, or AI was not used in the creation of this PR.
  • Bug fixes include regression tests
  • Chores
  • Documentation changes
  • Features include unit/acceptance tests
  • Refactoring
  • Update dependencies

@barnabasJ barnabasJ force-pushed the feature/support-using-generic-actions-with-index branch from 95eddc4 to 75a7a8b Compare July 17, 2025 15:59
@barnabasJ barnabasJ force-pushed the feature/support-using-generic-actions-with-index branch from 75a7a8b to 1d1d6a3 Compare July 17, 2025 16:01
@barnabasJ barnabasJ force-pushed the feature/support-using-generic-actions-with-index branch from 5d1e1d4 to b2b7000 Compare July 17, 2025 19:49
Comment on lines 62 to 64
request
|> fields(request.resource)
|> Enum.filter(&(&1 not in Ash.Resource.Info.attribute_names(request.resource))),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

So this was actually why it tried to load when I ran into the problem with the index query. Can we do this, or are there potential side-effects.

If so, there are more places with the same logic that I need to update.

Copy link
Contributor

Choose a reason for hiding this comment

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

🤔 No, this load is also effetcively doing an "ensure selected" on the fields in question. You can do this conditionally if there is no primary read action perhaps?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That would probably only be relevant for generic actions here? No need to change it for other actions?

Copy link
Contributor

Choose a reason for hiding this comment

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

🤔 yes, correct.

@barnabasJ barnabasJ marked this pull request as ready for review July 21, 2025 10:19
@barnabasJ barnabasJ self-assigned this Jul 21, 2025
@barnabasJ barnabasJ added the bug Something isn't working label Jul 21, 2025
@barnabasJ barnabasJ requested a review from zachdaniel July 21, 2025 10:20
Copy link
Contributor

@zachdaniel zachdaniel left a comment

Choose a reason for hiding this comment

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

Merge at your liesure

@barnabasJ barnabasJ merged commit 2e7f361 into main Jul 21, 2025
22 checks passed
@barnabasJ barnabasJ deleted the feature/support-using-generic-actions-with-index branch July 21, 2025 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants