-
Notifications
You must be signed in to change notification settings - Fork 213
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into issue-1145-consitent-docker-usernames
- Loading branch information
Showing
71 changed files
with
3,887 additions
and
4,963 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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,71 @@ | ||
# API debugging guidelines | ||
|
||
```{note} | ||
This is an opinionated guide that only applies to VS Code users. If you use a | ||
different editor or IDE, these instructions will not apply to you. | ||
``` | ||
|
||
This is the guide to debugging the API using VS Code. This uses Microsoft's | ||
`debugpy` package. | ||
|
||
## Prerequisites | ||
|
||
1. Install the | ||
[Python Debugger extension](https://marketplace.visualstudio.com/items?itemName=ms-python.debugpy). | ||
1. [Set up a VS Code workspace](/general/workspace.md) for the Openverse | ||
monorepo. | ||
|
||
## Steps | ||
|
||
1. Add a launch configuration to the Openverse workspace configuration. This | ||
configuration does the following things. | ||
|
||
- Specifies that the debugger used should be `debugpy`. | ||
- Configures the debugger to "attach" to a running process instead of | ||
launching a new one. | ||
- Specifies the port on which the `debugpy` server is running so that VS Code | ||
can connect to it. | ||
- Maps source code in the local repo clone to paths inside the Docker | ||
container so you can set breakpoints in the editor. | ||
|
||
```json | ||
{ | ||
// existing configuration | ||
"launch": { | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "API", | ||
"type": "debugpy", | ||
"request": "attach", | ||
"connect": { | ||
"host": "localhost", | ||
"port": 50256 | ||
}, | ||
"pathMappings": [ | ||
{ | ||
"localRoot": "${workspaceFolder:api}", | ||
"remoteRoot": "/api" | ||
} | ||
], | ||
"justMyCode": true | ||
} | ||
] | ||
} | ||
} | ||
``` | ||
|
||
1. Edit the `compose.yml` file inside the `api/` directory to uncomment the | ||
`command` field and port mapping for port 5678. | ||
|
||
1. Run the API server inside Docker using the instructions in the | ||
[quickstart](/api/guides/quickstart.md) guide. | ||
|
||
1. Connect the debugger to the running instance from the Run and Debug panel. | ||
|
||
![VS Code Run and Debug panel](/_static/vs_code_debug_panel.png) | ||
|
||
1. Read the | ||
[Visual Code debugger's official instructions](https://code.visualstudio.com/docs/editor/debugging) | ||
to better understand how to use the debugger interface to accomplish tasks | ||
like setting breakpoints, watching variables etc. |
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 |
---|---|---|
|
@@ -6,4 +6,5 @@ | |
quickstart | ||
test | ||
documentation | ||
debugging | ||
``` |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,5 +10,5 @@ test | |
zero_downtime_database_management | ||
logging | ||
stack | ||
workspace | ||
``` |
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,67 @@ | ||
# Using workspaces | ||
|
||
```{note} | ||
This is an opinionated guide that only applies to VS Code users. If you use a | ||
different editor or IDE, these instructions will not apply to you. | ||
``` | ||
|
||
This is a guide to uses VS Code's multi-root workspace feature to work on | ||
multiple sub-stacks of Openverse. | ||
|
||
## Steps | ||
|
||
1. Clone the GitHub repository. | ||
|
||
```shell | ||
git clone --filter=blob:none https://github.com/WordPress/openverse.git # or your fork | ||
``` | ||
|
||
1. In the same directory as the repository, create a workspace file | ||
`openverse.code-workspace` with the following configuration. | ||
|
||
```json | ||
{ | ||
"folders": [ | ||
{ | ||
"name": "monorepo", | ||
"path": "openverse" | ||
}, | ||
{ | ||
"name": "catalog", | ||
"path": "openverse/catalog" | ||
}, | ||
{ | ||
"name": "indexer_worker", | ||
"path": "openverse/indexer_worker" | ||
}, | ||
{ | ||
"name": "ingestion_server", | ||
"path": "openverse/ingestion_server" | ||
}, | ||
{ | ||
"name": "api", | ||
"path": "openverse/api" | ||
}, | ||
{ | ||
"name": "frontend", | ||
"path": "openverse/frontend" | ||
}, | ||
{ | ||
"name": "documentation", | ||
"path": "openverse/documentation" | ||
}, | ||
{ | ||
"name": "python/openverse-attribution", | ||
"path": "openverse/packages/python/openverse-attribution" | ||
} | ||
], | ||
"settings": { | ||
"terminal.integrated.cwd": "${workspaceFolder:monorepo}" | ||
} | ||
} | ||
``` | ||
|
||
1. From VS Code, open this workspace file. You should see the entire repository | ||
open in VS Code with all sub-stacks depicted as top-level folders. | ||
|
||
![VS Code workspace](/_static/vs_code_workspace.png) |
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,10 @@ | ||
# Locales | ||
|
||
The primary internationalisation file is [`data/en.json5`](../data/en.json5). | ||
All `.json` files present in the [`locales`](./locales) directory are | ||
re-generated when updating translations, so they should not be modified. | ||
|
||
# Locale scripts | ||
|
||
Locale scripts should be run in the root of the repository using their | ||
respective pnpm commands, in the `i18n` namespace. |
Oops, something went wrong.