hasura / hasura/graphql-engine
fix: fix race condition for create Preview Apps API
- Dominant language
- TypeScript
- Stars
- 32.1k
- Forks
- 3k
- PR merge metrics
- PR metrics pending
Description
### Version Information
Server Version: 2.39
### Environment
Cloud
### What is the current behaviour?
As per this [doc](https://hasura.io/docs/latest/cloud-ci-cd/preview-apps/#preview-apps-api) for create preview apps API, when user performs this mutation to create [preview app](https://hasura.io/docs/latest/cloud-ci-cd/preview-apps), it returns a response containing two preview project ids instead of one preview project id. This also creates two projects on Hasura cloud dashboard as well.
For cloud users, this also arises the issue of reaching 3 free tier project limit since duplicate project holds the extra spot for free tier project limit.
### What is the expected behaviour?
Using Create Preview Apps API , it should create one preview app project instead of 2 projects.
### How to reproduce the issue?
1. First gather the PAT from Hasura cloud. Please refer this [page](https://cloud.hasura.io/account-settings/access-tokens).
2. Then use API tool like Postman and devise an API.
3. It's a part of Hasura cloud API , so please familiarise your self to [cloud API reference](https://hasura.io/docs/latest/api-reference/cloud-api-reference/#introduction)
4. Setup authentication (request headers) as suggested per this [doc](https://hasura.io/docs/latest/api-reference/cloud-api-reference/#authentication) in your API req.
5. Once request headers and request body are set, perform `createGitHubPreviewApp` mutation and check the response.
### Screenshots or Screencast

### Any possible solutions/workarounds you're aware of?
You can manually delete that duplicate preview app in Hasura cloud dashboard.
### Keywords
preview apps hasura cloud
Contributor guide
Research direction
Start by reproducing the createGitHubPreviewApp mutation using the authentication and Cloud API references linked in the issue, then trace the Create Preview Apps API entry point. Confirm whether concurrent creation produces two preview project IDs and two dashboard projects. Done means one mutation creates exactly one preview app project and returns one project ID.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql
- Domain
- api, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100