-
Notifications
You must be signed in to change notification settings - Fork 308
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
Fix: order_by to respect alt #1093
Open
relikd
wants to merge
3
commits into
lektor:master
Choose a base branch
from
relikd:master
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like, in this case, we are interested only in
base_record.datamodel
. The datamodel does not depend on any of the record's.lr
files (regardless of alt). Perhaps we should figure out a way that we end up only declaring a dependency on the datamodel.ini
file (and and.ini
files of datamodels from which it inherits)?More investigation is probably required to determine whether such an optimization would buy us much (in terms of reducing unnecessary recorded dependencies, and thus reducing unnecessary rebuilds).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps this is related to part of PR #1007, where dependency tracking is done in Record.getitem.
Moving dependency tracking to attribute accessors (of both Records and DataModels) rather than recording the dependency upon record traversal would fix this...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently this is an issue for all queries with non-default alt.
self.pad.get
will access the primary alt in that case and record a dependency. I would be happy if, in this case, the datamodel could be accessed without requesting the record and thus avoid a dependency. But for the time being (if an actual fix will take too long) I would appreciate if the alt would be set as a hotfix. This at least prevents unnecessary rebuilds of alternatives if a primary alt page changes.And dependency tracking via attributes would be superb. There is another issue from 2016 I think where this was proposed. So dependency tracking could finally be applied to individual fields rather than files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that would be nice, but is probably a lot of work, and is not quite what I'm referring to.
My point is that just because a record is fetched (via
Pad.get
) during the building of an artifact, that does not mean, necessarily, that that artifact depends on that record's source files. It might be better to defer the recording of the dependency until such time as one of the record's fields is accessed, since that does imply a dependency on the source file.