-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: create 5.42.0 release notes (#714)
* wip * feat: fully delete cms model * wip * wip * feat: user project upgrade * fix: info about version specific steps * docs: add Full-Screen Editor * refactor: add note about dependency sync * feat: logger * fix: update broken links * fix: update broken links * fix: update deps list * ci:run workflows * fix: update tailwindcss * chore: update next to last possible v12 * fix: update items * fix: remove BCs section * chore: update background task info * fix: logger new table deployment * feat: add update yarn step into upgrade guide * feat: build project after update * fix: remove unnecessary apps from build * feat: api gateway * fix: api gateway * fix: polish changelog * fix: polish changelog * fix: polish changelog --------- Co-authored-by: Bruno Zorić <[email protected]> Co-authored-by: Leonardo Giacone <[email protected]>
- Loading branch information
1 parent
6e41ca0
commit d42d37a
Showing
15 changed files
with
852 additions
and
1,513 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
177 changes: 177 additions & 0 deletions
177
docs/developer-docs/5.42.x/core-development-concepts/basics/logger.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,177 @@ | ||
--- | ||
id: t92uhfadjsbfd | ||
title: Logger | ||
description: Learn about Logger which we internally use | ||
--- | ||
|
||
import {Alert} from "@/components/Alert"; | ||
|
||
<Alert type="success" title="What you'll learn"> | ||
|
||
- what is the Logger | ||
- how to use the Logger | ||
|
||
</Alert> | ||
|
||
<Alert type="warning"> | ||
This feature will change in the future. We cannot guarantee the data integrity after the system upgrade (in minor version, eg. 5.42.x to 5.43.0) | ||
</Alert> | ||
|
||
## Overview | ||
|
||
Webiny logger is internal feature which we use to log errors and other information into a DynamoDB Log table. | ||
|
||
For Logger to work, we deploy a new DynamoDB table called `webiny-logs`. | ||
|
||
## How to Use Logger | ||
|
||
To use the Logger in your project, you can access it from the Webiny context. | ||
|
||
There are multiple levels of logging available: | ||
- `debug` | ||
- `notice` | ||
- `info` | ||
- `warn` | ||
- `error` | ||
|
||
When you want to log something, you can use the following code: | ||
|
||
```typescript | ||
import type {Context} from "./types"; | ||
import {ContextPlugin} from "@webiny/handler-aws"; | ||
|
||
const myCustomPlugin = new ContextPlugin<Context>(async context => { | ||
// some custom code | ||
try { | ||
await someAsyncFunction(); | ||
} catch(ex) { | ||
const log = context.logger.withSource("where-did-the-log-come-from"); | ||
// it will log the message with the source "where-did-the-log-come-from" | ||
// and the level "error" | ||
log.error({ | ||
message: "Something is wrong with my custom code!", | ||
error: ex | ||
}); | ||
// maybe rethrow it? | ||
throw ex; | ||
} | ||
}); | ||
``` | ||
|
||
Note that the `where-did-the-log-come-from` is your custom string, which identifies where the log was created. | ||
|
||
This is something you can use to filter logs later. | ||
|
||
## How to Access Logger Logs? | ||
|
||
There are two ways to access the logs: | ||
- directly from the DynamoDB table `webiny-logs` | ||
- using the GraphQL API | ||
|
||
### DynamoDB Table | ||
|
||
You can access the logs directly from the DynamoDB table `webiny-logs`. The table has the following structure: | ||
|
||
```ts | ||
interface Log { | ||
id: string; | ||
createdOn: string; | ||
tenant: string; | ||
locale: string; | ||
source: string; | ||
type: string; | ||
// this is the data that was logged - it's always compressed | ||
data: { | ||
compression: "GZIP", | ||
value: string// compressed value | ||
}; | ||
} | ||
``` | ||
|
||
The data is always compressed using GZIP, so you must decompress it before you can read it. | ||
|
||
### GraphQL API | ||
|
||
You can also access the logs using the GraphQL API on `/graphql` endpoint. There are multiple queries and mutations available: | ||
|
||
- `listLogs` - to list all logs | ||
- `getLog` - to get a single log | ||
- `deleteLog` - to delete a single | ||
- `deleteLogs` - to delete multiple logs | ||
- `pruneLogs` - to delete all logs older than 60 seconds | ||
|
||
<Alert type="info"> | ||
|
||
For detailed information on how to use the GraphQL API, check out the API Playground in your Webiny Admin UI. | ||
|
||
</Alert> | ||
|
||
#### List Logs | ||
|
||
To list all logs, you can use the `listLogs` query. Here is an example of the query: | ||
|
||
```graphql | ||
query ListLogs { | ||
logs { | ||
listLogs( | ||
where: { | ||
tenant: "root", | ||
source:"myCustomSource", | ||
type: error | ||
}, | ||
sort: DESC, | ||
limit: 100, | ||
after: "cursorFromPreviousRequest" | ||
) { | ||
data { | ||
id | ||
type | ||
source | ||
data | ||
createdOn | ||
} | ||
error { | ||
message | ||
code | ||
data | ||
stack | ||
} | ||
meta { | ||
hasMoreItems | ||
cursor | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
All arguments in `listTags` query are optional. | ||
|
||
You can filter the logs by `tenant`, `source` and `type`. Or you can just list all logs, without any filtering applied. | ||
|
||
#### Prune Logs | ||
|
||
To delete all logs older than 60 seconds, you can use the `pruneLogs` mutation. Here is an example of the mutation: | ||
|
||
```graphql | ||
mutation PruneLogs { | ||
logs { | ||
pruneLogs { | ||
data { | ||
task { | ||
id | ||
} | ||
} | ||
error { | ||
message | ||
code | ||
data | ||
stack | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
|
||
The `pruneLogs` mutation will actually start a background task that will delete the logs. The task ID will be returned in the response, so you can track its progress. | ||
|
||
If you try to prune logs while another prune task is running, you will get an error. |
85 changes: 85 additions & 0 deletions
85
...developer-docs/5.42.x/core-development-concepts/basics/user-project-upgrade.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
--- | ||
id: gdkhsbfgiy23 | ||
title: User Project Upgrade | ||
description: Learn about how to do a project upgrade | ||
--- | ||
|
||
import {Alert} from "@/components/Alert"; | ||
|
||
<Alert type="success" title="What you'll learn"> | ||
|
||
- what is Webiny project upgrade | ||
- what are the steps to upgrade a project | ||
|
||
</Alert> | ||
|
||
## Overview | ||
|
||
As a part of our upgrade process, we provide a way to update your codebase on each new release - at least what we can do automatically. | ||
|
||
To start the project upgrade use the `yarn webiny upgrade` command. | ||
|
||
<Alert type="warning"> | ||
The upgrade process can only update one minor version at a time. So you can upgrade from 5.40.x to 5.41.x, but not from 5.40.x to 5.42.x. | ||
</Alert> | ||
|
||
## Steps | ||
|
||
When a user runs the `yarn webiny upgrade` command, there are multiple steps depending on what are we upgrading in that version. | ||
|
||
There might even be some breaking changes, so we need to notify the user about them. | ||
|
||
### 1. Notify the User about Breaking Changes | ||
|
||
The first step is to notify the user about breaking changes: | ||
```text | ||
webiny warning: Note that Webiny 5.xx.x introduces potential breaking changes! | ||
Before continuing, please review the upgrade guide located at https://webiny.link/upgrade/5.xx.x. | ||
I have read the upgrade guide and I am ready to proceed with the upgrade (y/N): | ||
``` | ||
|
||
User needs to press `y` to continue with the upgrade process. | ||
|
||
Note that this step will not show if there are no breaking changes in the version user is upgrading to. | ||
|
||
### 2. Check User Project Dependency Versions Against the Webiny Dependency Versions | ||
|
||
Next step, which will always be executed, is to check if the user project dependencies are in sync with the Webiny dependencies. If they are not, the user will be prompted to update them. | ||
|
||
<Alert> | ||
|
||
This does not mean that we use newer versions of the dependencies than our users do in their projects. | ||
|
||
We ship Webiny with the dependencies that are working with our code. If it is possible, our users should keep their dependencies in sync with Webiny ones to avoid any unexpected problems. | ||
|
||
</Alert> | ||
|
||
```text | ||
webiny warning: Found dependencies that are out of sync. Please sync them before continuing with the upgrade process... | ||
package.json files which have dependencies out of sync: | ||
- /packages/apiLib/package.json | ||
- /myApp/reactLib/package.json | ||
Dependencies out of sync: | ||
- react: 17.0.0 (18.2.5) | ||
- fastify: 4.0.0 (4.2.9) | ||
Do you want us to upgrade those dependencies? (y/N): | ||
``` | ||
|
||
User is encouraged to press `y` to update all dependencies in their project. | ||
|
||
If user chooses not to upgrade the dependencies, the upgrade process will prompt once more: | ||
|
||
```text | ||
We strongly recommend you update the dependencies. | ||
Failing to do so may result in unexpected problems. | ||
Do you still want to continue with the project upgrade and skip updating dependencies? (y/N) | ||
``` | ||
|
||
If user chooses to continue without updating the dependencies, the upgrade process will continue, but it is not recommended. | ||
|
||
## Version Specific Steps | ||
|
||
All steps after the dependency check are specific to the version user is upgrading to. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React from "react"; | ||
import { Navigation as BaseNavigation } from "../5.41.x/navigation"; | ||
import { Group, Page, NavigationRoot } from "@webiny/docs-generator"; | ||
|
||
export const Navigation = () => { | ||
return ( | ||
<> | ||
{/* Inherit navigation from 5.41.x. */} | ||
<BaseNavigation /> | ||
{/* Add new items. */} | ||
<NavigationRoot directory={__dirname}> | ||
<Group title={"Core Development Concepts"}> | ||
<Group title={"Basics"} after={"Basics"}> | ||
<Page link={"core-development-concepts/basics/user-project-upgrade"} /> | ||
<Page link={"core-development-concepts/basics/logger"} /> | ||
</Group> | ||
</Group> | ||
</NavigationRoot> | ||
</> | ||
); | ||
}; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.