feat: add Actor task publication endpoints - #2840
Conversation
|
✅ Preview for this PR (commit |
|
Important Action required — @Janjiran please coordinate this docs PR with the Python API client PR linked below. Because this PR modifies the OpenAPI specification, the generated models in A companion PR has been opened in
|
janbuchar
left a comment
There was a problem hiding this comment.
This looks legit as far as openapi semantics are considered
fnesveda
left a comment
There was a problem hiding this comment.
Is the API final? Why is it so different from the Actor publication API?
For example:
- Actors are published through the "update Actor" endpoint, tasks have special
/publishand/unpublishendpoints - Actors have
isPublic, tasks havepublishedAt - Actors have a
categoriesarray, tasks havecategorizationstring - Actors have all the details (
seoTitleetc.) on the top level, tasks have it inpublicConfig
Can we unify the API so that it's the same as for Actors?
Also, property names like inputSchemaFields, datasetName and datasetView somehow don't capture that they're being used only when showing the task, but they sound like they're relevant to the whole task (e.g. that they limit what input fields can the task process). How about putting them under some displayOptions object?
Also CC @gippy - would you look at this through the lens of the rules for API endpoints you wrote? 🙏
Task create now documents `publicConfig` (the API accepts the display fields and ignores the server-controlled `publishedAt`/`renderableAt`), and the update schema no longer offers a null the API rejects. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
We already discussed this. The 3 points:
Already exist in the current console backend API, so changing them would require migration and complete rewrite. I already shared my opinion on this when it was going to be impelemented in console backend, but now that train has left the station. So for API I proposed the option to have the Since publishing does multiple verification steps, not just for the task detail but also for Actor permission and the Actor "readyness" for task publication it kinda makes sense. Alternatives are either:
From my point of view I think it's ok to not have it match, the logic on Actor is not great either with the Actor update endpoint having 9 dependencies and over 400+ lines of code in the |
I really don't agree with this. We can't shape the public API around our internal implementation, we need to make a good public API and then make the implementation work with it. Writing a migration is a one time pain (and I believe this one can be done through Claude pretty well). A bad API stays with us forever.
On their own, these are good, and I agree we should have done the Actors API this way, but that train has surely left the station. So now that we have the Actors API done like this, let's try to have the tasks API consistent with it. |
Isn't that exactly what we're trying to do here though? To make a good public API and then make the implementation work with it, instead of shaping the new API around the Actor publication design, which you agree is the worse one. So we are designing the tasks API the way we think a good API should look. I get the consistency point, but if a bad API stays with us forever, then requiring every new API to copy the old pattern is exactly how it stays forever. By following the latest API conventions @gippy put together, the The schema differences ( |
Part of https://github.com/apify/apify-core/issues/29471
Adding new public endpoint for Actor Task publication API.
Blocked by https://github.com/apify/apify-core/pull/29623