Skip to content

Conversation

@eersnington
Copy link
Contributor

World-postgres steps.get was always expecting runId, so passing undefined returned 404.
This patch makes it fall back to stepId-only lookups, like the other backends (world-local).

Closes #134

@changeset-bot
Copy link

changeset-bot bot commented Oct 29, 2025

🦋 Changeset detected

Latest commit: 9f2461b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@workflow/world-postgres Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link
Contributor

vercel bot commented Oct 29, 2025

@eersnington is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link
Contributor

vercel bot commented Oct 30, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
example-nextjs-workflow-turbopack Ready Ready Preview Comment Oct 30, 2025 8:01pm
example-nextjs-workflow-webpack Ready Ready Preview Comment Oct 30, 2025 8:01pm
example-workflow Ready Ready Preview Comment Oct 30, 2025 8:01pm
workbench-nitro-workflow Ready Ready Preview Comment Oct 30, 2025 8:01pm

@pranaygp
Copy link
Collaborator

@eersnington awesome, thank you for the fix! Any chance we can also add a test that would ensure this behaviour? We could probabaly do it in the world-testing package, or in the PG world directly?

@eersnington
Copy link
Contributor Author

@eersnington awesome, thank you for the fix! Any chance we can also add a test that would ensure this behaviour? We could probabaly do it in the world-testing package, or in the PG world directly?

thank you! I saw that local world has tests for this. I'm leaning towards world-testing since it would catch this across all storage implementations per the interface contract.

But, one problem that I can think of is world-testing shouldn't be too tightly coupled to backend specific details. Maybe a generic contract test + specific edge cases in each world package? (I haven't gone through all the tests in local world, but I think that can act as a starting point)

Would love to hear your thoughts and the team's on this. I'd be happy to take it on too!

@pranaygp
Copy link
Collaborator

pranaygp commented Oct 31, 2025

@eersnington world-testing makes sense but I guess to get this PR through without too much friction, I'd suggest copying that same test over from local for now and shipping it a a world-postgres test

The world spec itself needs a bunch of work - we're discussing this as a team right now to

I think the plan for world-testing is to have a good suite of tests, including but not limited e2e workflow tests, and should include testing backend implementation. For example, things like "You cannot cancel a run that's already complete" and "If you mark a step as completed, the completedAt needs to be updated", etc

The creator of worlds is God Gal (aka @Schniz) - so he'll have more to share on those plans soon. We would love your help on it :)

@VaguelySerious
Copy link
Member

Are we good to merge this?

@eersnington
Copy link
Contributor Author

eersnington commented Nov 3, 2025

Are we good to merge this?

@VaguelySerious Hey Peter, I've added better tests (my previous commit, I mocked drizzle client which sucked). Now it run against the docker-compose postgres container. Can you review the current ones and point out anything you'd change? I'll add more tests based on the one written by Gal in local-world/storage.test.ts. Rn, there's tests for createRunsStorage, and createStepsStorage, and there's none for createEventsStorage, and createHooksStorage

@VaguelySerious
Copy link
Member

I think this is already really good and we can merge as-is. Later, when we use world-testing for this too and have more comprehensive tests there, it'll likely replace the storage tests anyway.

@VaguelySerious VaguelySerious merged commit f856031 into vercel:main Nov 3, 2025
9 of 21 checks passed
@pranaygp
Copy link
Collaborator

pranaygp commented Nov 3, 2025

Sorry we needed to revert this because of a license change @eersnington

Can you please reopen the PR on the latest main on this repo? tl;dr - we've changed from MIT to Apache with a DCO. #191

When making a new PR, you'll need to signoff the commit using the -s flag in git commit 🙏

Apart from that, the PR itself looks great. Happy to answer any questions on the licensing if you're curious

@eersnington
Copy link
Contributor Author

Sorry we needed to revert this because of a license change @eersnington

Can you please reopen the PR on the latest main on this repo? tl;dr - we've changed from MIT to Apache with a DCO. #191

When making a new PR, you'll need to signoff the commit using the -s flag in git commit 🙏

Apart from that, the PR itself looks great. Happy to answer any questions on the licensing if you're curious

Thank you @VaguelySerious!

I've just finished writing all the tests locally for storage.ts basing it of Gal's tests for Embedded world and found 1 problem too within the storage contract for PG World through the tests.

image

^ Would definitely be worth it to write comprehensive integration tests to find these details across all world implementations

Sorry we needed to revert this because of a license change @eersnington

Can you please reopen the PR on the latest main on this repo? tl;dr - we've changed from MIT to Apache with a DCO. #191

When making a new PR, you'll need to signoff the commit using the -s flag in git commit 🙏

Apart from that, the PR itself looks great. Happy to answer any questions on the licensing if you're curious

No worries @pranaygp and thank you for letting me work on this 🫡
And I'll add sign off by on any new of my commits too

@eersnington eersnington deleted the fix/world-postgres-steps-get-runid-undefined branch November 4, 2025 00:21
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.

world-postgres steps.get fails when runId is undefined but stepId is valid

3 participants