-
Notifications
You must be signed in to change notification settings - Fork 611
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
Include default_version
by default
#10344
base: main
Are you sure you want to change the base?
Conversation
a03882a
to
ddfede2
Compare
/** @return {Map<string, import("../models/version").default>} */ | ||
@cached | ||
get loadedVersionsByNum() { | ||
let versionsRef = this.hasMany('versions'); | ||
let values = versionsRef.value(); | ||
return new Map(values?.map(ref => [ref.num, ref])); | ||
} |
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.
I think versionsObj
could also be changed to implement in this way. This would allow all versions
that belong to this crate
to be available, rather than just those loaded via the loadVersionsTask
.
I have removed a commit that aimed to only await |
ddfede2
to
bfe8d72
Compare
Rebased to make CI happy after the new Danger Zone was added :D |
bfe8d72
to
96786e2
Compare
This commit would ensure that `default_version` is included in the `crate` response by default. This eliminates the need to wait for the `versions` request to complete when `default_version` is the only version required.
…ame}/{version}` endpoint
Previously, we fetched all versions and then found the requested version within them. This commit changes the approach to either retrieve the version from loaded versions or fetch it from the endpoint. This change allows us to migrate to paginated versions in the future.
96786e2
to
433abe7
Compare
This PR would ensure that
default_version
is included in thecrate
response by default. This eliminates the need to wait for theversions
request to complete whendefault_version
is the only version required. This also decouples requested version handling from versions.Related:
default_version
include mode #10288