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

Sort envs returned by REST API by current build's scheduled_on time #881

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

peytondmurray
Copy link
Contributor

Fixes #859.

Description

This PR sorts environments returned when a GET is sent to /environment/ by the time the environments' current builds were submitted. In systems where users are creating environments while environments are being queried, this ensures that all results are returned; other sorting methods (e.g. by name) can yield incomplete results.

Pull request checklist

  • Did you test this change locally?
  • Did you update the documentation (if required)?
  • Did you add/update relevant tests for this change (if required)?

Copy link

netlify bot commented Sep 17, 2024

Deploy Preview for conda-store ready!

Name Link
🔨 Latest commit 6cf6c92
🔍 Latest deploy log https://app.netlify.com/sites/conda-store/deploys/67129b17dbc6e80008198072
😎 Deploy Preview https://deploy-preview-881--conda-store.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@peytondmurray peytondmurray changed the title [WIP] Sort envs returned by REST API by current build's scheduled_on time Sort envs returned by REST API by current build's scheduled_on time Oct 3, 2024
@peytondmurray peytondmurray marked this pull request as ready for review October 17, 2024 03:11
@peytondmurray peytondmurray marked this pull request as draft October 17, 2024 18:36
@peytondmurray
Copy link
Contributor Author

After a discussion, it seems like no matter how we solve this there's going to be a breaking change to the API. Cursor-based pagination will allow for any sorting order, so I'll look into implementing that, probably through fastapi-pagination.

@peytondmurray
Copy link
Contributor Author

peytondmurray commented Oct 18, 2024

Adding pagination via fastapi-pagination seems simple on the surface, but they don't publish an API reference in the docs, so without reading the source for the project I'm not sure how it affects what query parameters are accepted by our API. So in the process of trying to implement this, I started working on adding hot reloading, but due to the fact that we're using traitlets to load server configuration (and instantiate the FastAPI app) and that uvicorn has specific requirements about how the FastAPI app is instantiated when hot reloading, it's trickier to get this working than I thought. See #901 for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: api area: user experience 👩🏻‍💻 Items impacting the end-user experience needs: review 👀 type: bug 🐛 Something isn't working
Projects
Status: In Progress 🏗
Development

Successfully merging this pull request may close these issues.

[ENH] - Ensure completeness when fetching all pages using REST API
1 participant