Merge branch 'main' into feat/dark-mode

This commit is contained in:
Robert Sparks 2023-07-22 13:49:24 -05:00 committed by GitHub
commit 4ec22dae19
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 22 additions and 25 deletions

View file

@ -6,7 +6,7 @@
"": {
"name": "diff",
"dependencies": {
"chalk": "^5.2.0",
"chalk": "^5.3.0",
"dockerode": "^3.3.5",
"enquirer": "^2.3.6",
"extract-zip": "^2.0.1",
@ -193,9 +193,9 @@
}
},
"node_modules/chalk": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-5.2.0.tgz",
"integrity": "sha512-ree3Gqw/nazQAPuJJEy+avdl7QfZMcUvmHIKgEZkGL+xOBzRvup5Hxo6LHuMceSxOabuJLJm5Yp/92R9eMmMvA==",
"version": "5.3.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz",
"integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==",
"engines": {
"node": "^12.17.0 || ^14.13 || >=16.0.0"
},
@ -1497,9 +1497,9 @@
}
},
"chalk": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-5.2.0.tgz",
"integrity": "sha512-ree3Gqw/nazQAPuJJEy+avdl7QfZMcUvmHIKgEZkGL+xOBzRvup5Hxo6LHuMceSxOabuJLJm5Yp/92R9eMmMvA=="
"version": "5.3.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz",
"integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w=="
},
"chownr": {
"version": "1.1.4",

View file

@ -2,7 +2,7 @@
"name": "diff",
"type": "module",
"dependencies": {
"chalk": "^5.2.0",
"chalk": "^5.3.0",
"dockerode": "^3.3.5",
"enquirer": "^2.3.6",
"extract-zip": "^2.0.1",

View file

@ -74,7 +74,7 @@ services:
CELERY_APP: ietf
CELERY_ROLE: worker
UPDATE_REQUIREMENTS_FROM: requirements.txt
DEV_MODE: yes
DEV_MODE: "yes"
command:
- '--loglevel=INFO'
depends_on:

View file

@ -29,9 +29,9 @@ This project includes a devcontainer configuration which automates the setup of
### Initial Setup
1. Launch [VS Code](https://code.visualstudio.com/)
2. Under the **Extensions** tab, ensure you have the **Remote - Containers** ([ms-vscode-remote.remote-containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)) extension installed.
2. Under the **Extensions** tab, ensure you have the **Dev Containers** ([ms-vscode-remote.remote-containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)) extension installed.
* On Linux, note that the Snap installation of VS Code is [incompatible with this plugin](https://code.visualstudio.com/docs/devcontainers/containers#_system-requirements:~:text=snap%20package%20is%20not%20supported).
* On Windows, you also need the **Remote - WSL** ([ms-vscode-remote.remote-wsl](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl)) extension to take advantage of the WSL 2 *(Windows Subsystem for Linux)* native integration.
* On Windows, you also need the **WSL** ([ms-vscode-remote.remote-wsl](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl)) extension to take advantage of the WSL 2 *(Windows Subsystem for Linux)* native integration.
2. Open the top-level directory of the datatracker code you fetched above.
3. A prompt inviting you to reopen the project in containers will appear in the bottom-right corner. Click the **Reopen in Container** button. If you missed the prompt, you can press `F1`, start typing `reopen in container` task and launch it.
4. VS Code will relaunch in the dev environment and create the containers automatically.
@ -45,7 +45,7 @@ You can also open the datatracker project folder and click the **Reopen in conta
### Usage
- Under the **Run and Debug** tab, you can run the server with the debugger attached using **Run Server** (F5). Once the server is ready to accept connections, you'll be prompted to open in a browser. You can also open [http://localhost:8000](http://localhost:8000) in a browser.
- Under the **Run and Debug** tab, you can run the server with the debugger attached using **Run Server** (F5). Once the server is ready to accept connections, you'll be prompted to open in a browser. Navigate to [http://localhost:8000](http://localhost:8000) in your preferred browser.
> An alternate profile **Run Server with Debug Toolbar** is also available from the dropdown menu, which displays various tools
on top of the webpage. However, note that this configuration has a significant performance impact.
@ -64,11 +64,7 @@ You can also open the datatracker project folder and click the **Reopen in conta
![](assets/vscode-terminal-new.png)
- Under the **SQL Tools** tab, a connection **Local Dev** is preconfigured to connect to the DB container. Using this tool, you can list tables, view records and execute SQL queries directly from VS Code.
> The port `3306` is also exposed to the host automatically, should you prefer to use your own SQL tool.
![](assets/vscode-sqltools.png)
- The pgAdmin web interface, a PostgreSQL DB browser / management UI, is available at [http://localhost:8000/pgadmin/](http://localhost:8000/pgadmin/).
- Under the **Task Explorer** tab, a list of available preconfigured tasks is displayed. *(You may need to expand the tree to `src > vscode` to see it.)* These are common scritps you can run *(e.g. run tests, fetch assets, etc.)*.
@ -103,7 +99,7 @@ You can also open the datatracker project folder and click the **Reopen in conta
2. Wait for the containers to initialize. Upon completion, you will be dropped into a shell from which you can start the datatracker and execute related commands as usual, for example
```
ietf/manage.py runserver 0.0.0.0:8000
ietf/manage.py runserver 0.0.0.0:8001
```
to start the datatracker.
@ -161,11 +157,11 @@ docker compose down -v --rmi all
docker image prune
```
### Accessing MariaDB Port
### Accessing PostgreSQL Port
The port is exposed but not mapped to `3306` to avoid potential conflicts with the host. To get the mapped port, run the command *(from the project `/docker` directory)*:
The port is exposed but not automatically mapped to `5432` to avoid potential conflicts with the host. To get the mapped port, run the command *(from the project `/docker` directory)*:
```sh
docker compose port db 3306
docker compose port db 5432
```
## Notes / Troubleshooting

View file

@ -2585,6 +2585,7 @@ class ChartTests(ResourceTestCaseMixin, TestCase):
d = r.json()
self.assertEqual(len(d), 1)
self.assertEqual(len(d[0]), 2)
self.assertEqual(d[0][1], 1)
page_url = urlreverse('ietf.person.views.profile', kwargs=dict(email_or_name=person.name))
r = self.client.get(page_url)

View file

@ -40,7 +40,7 @@ def model_to_timeline_data(model, field='time', **kwargs):
assert field in [ f.name for f in model._meta.get_fields() ]
objects = ( model.objects.filter(**kwargs)
.annotate(date=TruncDate(field))
.annotate(date=TruncDate(field, tzinfo=datetime.timezone.utc))
.order_by('date')
.values('date')
.annotate(count=Count('id')))

View file

@ -41,7 +41,7 @@ class ReviewTests(TestCase):
r = self.client.get(url)
self.assertEqual(r.status_code, 200)
self.assertContains(r, review_req.doc.name)
self.assertContains(r, assignment.reviewer.person.name)
self.assertContains(r, escape(assignment.reviewer.person.name))
url = urlreverse(ietf.group.views.review_requests, kwargs={ 'acronym': group.acronym })
@ -183,7 +183,7 @@ class ReviewTests(TestCase):
urlreverse(ietf.group.views.reviewer_overview, kwargs={ 'acronym': group.acronym, 'group_type': group.type_id })]:
r = self.client.get(url)
self.assertEqual(r.status_code, 200)
self.assertContains(r, reviewer.name)
self.assertContains(r, escape(reviewer.name))
self.assertContains(r, review_req1.doc.name)
# without a login, reason for being unavailable should not be seen
self.assertNotContains(r, "Availability")

View file

@ -30,7 +30,7 @@ django-widget-tweaks>=1.4.12
djlint>=1.0.0 # To auto-indent templates via "djlint --profile django --reformat"
docutils>=0.18.1 # Used only by dbtemplates for RestructuredText
types-docutils>=0.18.1
factory-boy>=3.2.1
factory-boy>=3.2.1,<3.3
github3.py>=3.2.0
gunicorn>=20.1.0
hashids>=1.3.1