Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI/CD deployment docs #2389

Open
wants to merge 3 commits into
base: miho-deployment-docs
Choose a base branch
from

Conversation

infomiho
Copy link
Contributor

@infomiho infomiho commented Nov 28, 2024

Talks about how users can test their apps in the CI and about packaging their apps in Docker images for CD.

Signed-off-by: Mihovil Ilakovac <mihovil@ilakovac.com>
Signed-off-by: Mihovil Ilakovac <mihovil@ilakovac.com>
Signed-off-by: Mihovil Ilakovac <mihovil@ilakovac.com>
@infomiho infomiho marked this pull request as ready for review November 29, 2024 07:59
**Continuous Deployment (CD)** refers to the automatic deployment of code changes to the production environment. This is commonly know as "push to deploy" and frees developers from having to manually deploy code changes.

## Running tests in CI
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this should be under deployment, since CI is a separate thing from deployment.

Maybe it would be better if we had a part of docs called Testing and then tehre we can have CI part?

Copy link
Member

@Martinsos Martinsos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! This one feels a bi tless claer to me, regarding what should be here. Seems every easy to me to go into too much details, or to not give enough info. Since it is more CI/hosting provider specific than Wasp specific. So I think it is ok to keep this as light as we can.


TODO: we'll talk about how to e2e test Wasp apps in the CI
**Continuous Integration (CI)** involves verifying/testing code changes through an automated process whenever code is pushed to the repository. This helps us catch bugs early and make sure that our app works.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
**Continuous Integration (CI)** involves verifying/testing code changes through an automated process whenever code is pushed to the repository. This helps us catch bugs early and make sure that our app works.
**Continuous Integration (CI)** involves verifying/testing code changes during development through an automated process whenever code is pushed to the repository. This helps us catch bugs early and make sure that our app works.

We'll show you how to run end-to-end tests in CI using the [Github Actions](https://github.com/features/actions) as our CI and the [Playwright](https://playwright.dev/) as our e2e testing framework.

1. Check our example app and its e2e tests in the [e2e-tests](https://github.com/wasp-lang/e2e-test-example/tree/main/e2e-tests) directory.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm should this point to release branch? Usually in docs we aim to point at release branch, since we know it is in sycn with the released version of the docs.

Comment on lines +33 to +52
import { expect, test } from "@playwright/test";
import { generateRandomUser, logUserIn } from "./utils";

const user = generateRandomUser();

test.describe("basic user flow test", () => {
test("log in and add task", async ({ page }) => {
await logUserIn({ page, user });
await expect(page).toHaveURL("/");
await expect(page.locator("body")).toContainText("No tasks yet.");

// Add a task
await page.fill('input[name="description"]', "First task");
await page.click('input:has-text("Create task")');
await expect(page.locator("body")).toContainText("First task");
});
});
```
</details>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can probably drop this? It is just a small snippet, and it risks becoming out of date, we have to maintain it, real code is anyway in that example app you linked to.

Comment on lines +75 to +78
- for our server app
- for our client app
4. Notify your deployment provider to deploy the new image.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can depend on their hostirng provider, right? If I am correct some of them have their own registries so this looks more like just a single command, or maybe you just give them a branch with Dockerfile, stuff like that?
Also client app doesn't have to be in Dockerfile.
Also might be worth mentiong here that we provide Dockerfile for the server.

And now that I am writnig all this, sounds to me like this is quite complex and we should instead point them to the part of deployment docs that describes it in details? Maybe just be very simple here, try not to assume much, link to the part with dpeloying Wasp app, and say that they will want to use whatever method their hosting providers reocmmends for CD. And an example deployment of ours, that is cool.

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.

2 participants