Skip to content

Commit

Permalink
Merge branch 'main' into feat/dark-mode
Browse files Browse the repository at this point in the history
  • Loading branch information
rjsparks committed Jul 22, 2023
2 parents 3a47871 + 98634ea commit 4ec22da
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 25 deletions.
14 changes: 7 additions & 7 deletions dev/diff/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dev/diff/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
20 changes: 8 additions & 12 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand All @@ -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.)*.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions ietf/doc/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -2585,6 +2585,7 @@ def test_personal_chart(self):
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)
Expand Down
2 changes: 1 addition & 1 deletion ietf/doc/views_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')))
Expand Down
4 changes: 2 additions & 2 deletions ietf/group/tests_review.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def test_review_requests(self):
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 })

Expand Down Expand Up @@ -183,7 +183,7 @@ def test_reviewer_overview(self):
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")
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4ec22da

Please sign in to comment.