Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions docs/developer-docs/6.x/reference/extensions/project.ai.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,34 @@ Related Documents:

Tone Guidelines:
- Reference: minimal prose, tables are the content

--- Project.BugReporter (added when the bug reporter shipped in 6.6.0) ---

Source of Information:
1. ~/dev/wby-next3/packages/project/src/extensions/BugReporter.tsx — the defineExtension and its params schema
2. ~/dev/wby-next3/packages/bug-reporter/src/api/config/BugReportConfig.ts — defaults, label parsing, canFileDirectly
3. ~/dev/wby-next3/packages/bug-reporter/src/admin/recording/ActionRecorder.ts — what is recorded, MAX_EVENTS
4. webiny/webiny-js#5736 (feature), #5746 (moved here from a BugReporter export on webiny/extensions)

Key Documentation Decisions:
1. Documented here rather than on its own page. It shipped as `<BugReporter.GitHub>` from a separate
`webiny/extensions` export and briefly had a page of its own; moving it into the Project
namespace made a sibling section the obvious home, and one prop table is better than two that
drift.
2. The conceptual material was compressed rather than dropped. Compose vs filed is two sentences,
and the recorder is one paragraph instead of a seven-row table, which keeps this section in
proportion to Project.FeatureFlags above it.
3. Two bolded gotchas, because both are invisible from the types and both fail quietly or
confusingly:
- filing needs token AND repository, since the props are independently optional
- `process.env.X` must be guarded with `|| ""`; an unset key renders as an object, not undefined,
and fails the params schema mid-build. This bit the feature's own PR.
4. The default repository keeps a warning block. With no configuration a customer's compose URLs
point at webiny/webiny-js carrying their page titles and click timeline.

Understanding:
- The extension does not enable the reporter. DefaultExtensions already does, in compose mode.
- canFileDirectly requires both token and repository; the repository default applies to compose only.
- A malformed repository throws rather than falling back, hence "fails the report".
- Screenshots need contents write because issues have no attachment API.
- `labels` REPLACES the "bug" default; `reported-in-app` is always appended and not configurable.
36 changes: 36 additions & 0 deletions docs/developer-docs/6.x/reference/extensions/project.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,39 @@ Enables or disables Webiny Cloud Platform (WCP) licensed features.
lexicalGeneration?: boolean;
}
```

### Project.BugReporter

Points the bug reporter at a GitHub repository, so the API files issues itself.

The bug reporter is enabled in every project already, so this extension is not what turns it on. Without it the reporter runs in **compose mode**: `cmd+shift+b` in the Admin app, describe what broke, and the API returns a prefilled `issues/new` URL that the reporter submits under their own account. No credentials are involved. This switches it to **filed mode**, where the API creates the issue and commits screenshots to a `bug-report-assets` branch.

| Prop | Type | Required | Description |
| ------------ | -------- | -------- | --------------------------------------------------------------------------------------------- |
| `token` | `string` | No | Personal access token with write access to issues and contents. Omit to stay in compose mode. |
| `repository` | `string` | No | Target repository as `owner/name`. Defaults to `webiny/webiny-js`. |
| `labels` | `string` | No | Comma separated labels applied to every issue. Defaults to `bug`. |

```tsx webiny.config.tsx
<Project.BugReporter
token={process.env.MY_GITHUB_TOKEN || ""}
repository={"acme/app"}
labels={"bug,admin"}
/>
```

**Filing requires both `token` and `repository`.** A token on its own is not enough, and leaves the reporter in compose mode. Filing is the irreversible direction, so the target has to be named explicitly rather than inherited from a default. A value that is not exactly `owner/name` fails the report rather than falling back.

**Guard every environment variable with `|| ""`.** Reading an unset key off `process.env` while the config renders returns an object rather than `undefined`, which fails the string check and stops the build.

<Alert type="warning">

Set `repository` even if you do not want filing. In compose mode it is the repository the prefilled URL points at, and it defaults to `webiny/webiny-js`. A project that configures nothing sends its users to Webiny's issue composer, prefilled with their page titles, URLs and click timeline.

</Alert>

A classic personal access token with the `repo` scope covers filed mode. Write access to **contents** is needed as well as issues, because GitHub's issue API has no attachment endpoint, so screenshots are committed to a branch and linked. Pass the token through a build-time environment variable, never as a literal: the value is serialized into the build artifact.

Labels are applied on top of `reported-in-app`, which every issue gets and which cannot be turned off. Setting `labels` replaces the `bug` default rather than adding to it, so `labels={"admin"}` produces `admin` and `reported-in-app`.

Alongside the description, each report carries the environment and a timeline of the last 150 recorded actions: route changes, clicks, field edits, GraphQL operations, anything that returned 4xx or 5xx, `console.error` and `console.warn`, and uncaught exceptions. Field values are never recorded, only the label of the field, and a label is only read from an interactive element, so clicking a table cell records where the click landed rather than what the cell contained. Both rules exist because reports get filed from tenants holding real customer data.
8 changes: 8 additions & 0 deletions docs/release-notes/6.6.0/changelog.ai.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
AI Context: 6.6.0 Changelog (changelog.mdx)

This file tracks manual edits made after the generation script ran.
The script reads the "Skipped PRs" section to avoid re-adding removed entries.

## Skipped PRs

## Manual Rewrites
Loading