## Description
This variables are build time and not dependent on deploy. Moreover we
don't know them during production deploy.
But they are used as versioning at saas level
## Steps for reproduction
1. click button
2. expect xyz
## Code Review
- [ ] hi @kof, I need you to do
- conceptual review (architecture, feature-correctness)
- detailed review (read every line)
- test it on preview
## Before requesting a review
- [ ] made a self-review
- [ ] added inline comments where things may be not obvious (the "why",
not "what")
## Before merging
- [ ] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
## Description
Add `latestBuild` for each entry in publish dialog
Now we are tracking publish stat for each domain.
This information is needed to show checkboxes in publish design (next
PRs).
2 new Views were created.
To get the latest build by project + domain
To get the latest build for wstd.xx domain
Publish status is shown per domain (as not every domain would be
published each time)
<img width="362" alt="image"
src="https://github.com/webstudio-is/webstudio-builder/assets/5077042/b4e0357a-63f5-47ba-a119-59ef1adf81d2">
During publish all buttons are disabled as per design
<img width="348" alt="image"
src="https://github.com/webstudio-is/webstudio-builder/assets/5077042/94720bd3-4bda-488c-81f7-71ea9ba2d530">
Also added tooltip on publish button (not in design)
<img width="366" alt="image"
src="https://github.com/webstudio-is/webstudio-builder/assets/5077042/c764a785-aea9-487b-a480-642410293ee3">
## Steps for reproduction
1. click button
2. expect xyz
## Code Review
- [ ] hi @kof, I need you to do
- conceptual review (architecture, feature-correctness)
- detailed review (read every line)
- test it on preview
## Before requesting a review
- [ ] made a self-review
- [ ] added inline comments where things may be not obvious (the "why",
not "what")
## Before merging
- [ ] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio-builder/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
## Description
The idea is to deploy by `buildId` instead of `projectId`.
Every build now can have `deployment` metadata params (currently
`domains` only, but in the future can be any additional metadata, like
vars etc)
Publish is simplified (-2 workers), the same trpc as for other saas api
is used to publish, see `cms.publish`
(also local development is simplified as edge-api at saas works on local
dev perfectly)
isDev and isProd are not needed anymore. Any published build has
`deployment` metadata, and various builds can be active now on different
domains.
Build clone now seriously faster as no parse/serialize steps involved at
all.
Partial index `CREATE UNIQUE INDEX "Build_dev_index" ON "Build"
("projectId") WHERE "deployment" IS NULL;` created so we could be sure
that no more than 1 dev build exists.
createBuild and cloneBuild are now splitted, and seriously simplified
## Steps for reproduction
1. click button
2. expect xyz
## Code Review
- [ ] hi @kof, I need you to do
- conceptual review (architecture, feature-correctness)
- detailed review (read every line)
- test it on preview
## Before requesting a review
- [ ] made a self-review
- [ ] added inline comments where things may be not obvious (the "why",
not "what")
## Before merging
- [ ] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio-builder/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory