conda-incubator / conda-store

Data science environments, for collaboration. ✨
https://conda.store
BSD 3-Clause "New" or "Revised" License
137 stars 44 forks source link

[BUG] - `api_get_specification` is broken #761

Open nkaretnikov opened 5 months ago

nkaretnikov commented 5 months ago

Describe the bug

The api_get_specification HTTP endpoint seems to be completely broken. There are two bugs here:

Bug 1:

            task, solve_id = conda_store.register_solve(db, specification)
            task.wait()

The task here can be a str sometimes, which causes a ValueError. I think it needs to be wrapped into AsyncResult here.

Bug 2:

        return {"solve": solve.packages}

There's no .packages in Solve anymore. This was introduced when the DB schema was refactored, way before I was even part of the project. The new proper name is package_builds.

Expected behavior

The endpoint returns some data instead of raising an error.

How to Reproduce the problem?

Just call the endpoint. Some tests call it as well, which is how I noticed, but maybe those tests expect status codes 500 or 400, so they all pass. Those tests need to be looked at.

Output

This is printed to the terminal:

'str' object has no attribute 'wait'

Versions and dependencies used.

Current main (988445bfbc7de8e34ee36e2128471a9869c605cd).

Anything else?

No response