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

Use latest matching deployment #162

Merged
merged 2 commits into from
Apr 6, 2022

Conversation

byronigoe
Copy link

Download the most recently uploaded package that matches the version instead of always choosing the most specific deployment

Download latest uploaded package instead of comparing range distances
@rocwind
Copy link
Member

rocwind commented Apr 6, 2022

@byronigoe
Thanks for the PR!
it seems reasonable to choose the latest but not more specific version. We have not used the MS official service before so I am not sure about the behavior of official service, but I checked the code-push-cli doc and didn't find any information about more specific target version should be prefered to version range.
As regards the changes here, I'll need to double check the rollback & prompt cases, not sure about whether sorting by created_at works for them.

@rocwind
Copy link
Member

rocwind commented Apr 6, 2022

@byronigoe
It looks like it always create new packages for rollback & prompt cases, I guess use created_at is fine.
Would you mind helping with the lint issue? I'll merge this PR once it passes CI.

btw: since we only need the last array item, maybe _.last(_.sort(...)) can be faster that .reverse()[0]. It might be even better to sort and findOne with sql query, but I suppose current solution is good enough for addressing the issue itself.

@rocwind rocwind merged commit fb70185 into shm-open:master Apr 6, 2022
@byronigoe byronigoe deleted the use-latest-deployment branch April 12, 2022 20:00
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.

2 participants