Skip to content

Commit

Permalink
chore: docs w/ JB feedback, disable SSO redirect in dev by default
Browse files Browse the repository at this point in the history
  • Loading branch information
GabDug committed Jan 23, 2024
1 parent 318b4c9 commit 07cfdcf
Show file tree
Hide file tree
Showing 11 changed files with 86 additions and 41 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,4 @@ RAID_QUALIFIER_URL="https://mycompany.atlassian.local/secure/RapidBoard.jspa?rap


FF_SLACK_SKIP_CHECKS=true
FF_DEBUG_NO_SSO_REDIRECT=true
4 changes: 1 addition & 3 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Code of Conduct

See [ManoMano Code of Conduct](https://github.com/ManoManoTech/ALaMano/blob/master/CODE_OF_CONDUCT.md).

<!-- XXX Add link to Github Pages -->
See [our Code of Conduct](https://manomanotech.github.io/firefighter-incident/latest/CODE_OF_CONDUCT).
7 changes: 1 addition & 6 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
# Contributing

See:

- [ManoMano Contributing Guide](https://github.com/ManoManoTech/ALaMano/blob/master/CONTRIBUTING.md).
- FireFighter Contributing documentation (docs/Contributing/)

<!-- XXX(dugab): Deploy the docs to Github Pages, link them here -->
See [FireFighter Contributing documentation](https://manomanotech.github.io/firefighter-incident/latest/contributing/)
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
python 3.11.6
direnv 2.32.1
node lts-hydrogen
nodejs lts-hydrogen
pdm 2.12.1
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@ Incidents are unplanned interruptions or reductions in quality of services, like

<!--intro-end-->

## Learn more

Check out our [documentation](https://manomanotech.github.io/firefighter-incident/latest/) for more details.

## Contributing

See [CONTRIBUTING](CONTRIBUTING.md) for details on submitting patches, the contribution workflow and developer's guide.
See [our Contribution Guide](https://manomanotech.github.io/firefighter-incident/latest/contributing/) for details on submitting patches, the contribution workflow and developer's guide.

## License

Expand Down
62 changes: 33 additions & 29 deletions docs/Contributing/0001-setup-environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,61 +58,65 @@ You can already fill `DJANGO_SUPERUSER_EMAIL`, `DJANGO_SUPERUSER_USERNAME` and `

## Setup everything

The following steps can be run with:
You can start up the Postgres and Redis dependencies, apply migrations, load fixtures, create a superuser and collect static files with one shortcut:

```shell
pdm run dev-env-setup
```

It will performan the following steps:

### 1. Launch dependencies with Docker
??? question "What does it do?"
It will perform the following steps:

1. Launch dependencies with Docker

```shell
docker-compose up -d db redis
```

### 2. Apply the database migrations
```shell
docker-compose up -d db redis
```

```shell
pdm run migrate
```
2. Apply the database migrations

> This PDM command uses the [`migrate`](https://docs.djangoproject.com/en/4.2/ref/django-admin/#migrate) command of Django to apply migrations on all enabled applications.
> If you enable a new app (switch PagerDuty on for the first time for instance), you'll need to apply migrations again.
```shell
pdm run migrate
```

### 3. Load fixtures
> This PDM command uses the [`migrate`](https://docs.djangoproject.com/en/4.2/ref/django-admin/#migrate) command of Django to apply migrations on all enabled applications.
> If you enable a new app (switch PagerDuty on for the first time for instance), you'll need to apply migrations again.

```shell
pdm run loaddata
```
3. Load fixtures

> This PDM command uses the [`loaddata`](https://docs.djangoproject.com/en/4.2/ref/django-admin/#loaddata) command of Django to gather necessary objects (Severities, Components, Groups...)
```shell
pdm run loaddata
```

### 4. Create a superuser
> This PDM command uses the [`loaddata`](https://docs.djangoproject.com/en/4.2/ref/django-admin/#loaddata) command of Django to gather necessary objects (Severities, Components, Groups...)

```shell
pdm run createsuperuser
```
4. Create a superuser

> This PDM command will use the env variables set earlier (`DJANGO_SUPERUSER_EMAIL`, `DJANGO_SUPERUSER_USERNAME` and `DJANGO_SUPERUSER_PASSWORD`) to create an admin user.
> Tou can use this user to login at <http://127.0.0.1:8080/admin/>
```shell
pdm run createsuperuser
```

### 5. Collect static files
> This PDM command will use the env variables set earlier (`DJANGO_SUPERUSER_EMAIL`, `DJANGO_SUPERUSER_USERNAME` and `DJANGO_SUPERUSER_PASSWORD`) to create an admin user.
> Tou can use this user to login at <http://127.0.0.1:8080/admin/>

```shell
pdm run collectstatic
```
5. Collect static files

## You should now be able to run the server
```shell
pdm run collectstatic
```

## Run the server

You should now be able to run the server locally with:

```shell
pdm runserver
```

> This PDM command uses the [`runserver`](https://docs.djangoproject.com/en/4.2/ref/django-admin/#runserver) command of Django.

You can login at http://127.0.0.1:8000/admin/ with the superuser you created.

!!! warning
Expand Down
13 changes: 13 additions & 0 deletions docs/Usage/integrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ See [Slack environment variables settings](../Deploy/XX-settings.md#slack-integr

#### Back-Office configuration

##### Conversations tags

You can add custom tags to Slack conversations in the back-office.

Some tags have special meaning:
Expand All @@ -58,6 +60,17 @@ Some tags have special meaning:
- `dev_firefighter`: Where users can get help with the bot. Will be shown in `/incident help` for instance.
- `it_deploy`: Where the bot send notifications for deployment freezes.

##### Usergroups

You can add or import usergroups in the back-office.

!!! note "Hint"
When adding a usergroup in the BackOffice, you can put only its ID. The rest of the information will be fetched from Slack.

##### SOSes

You can configure [SOSes][firefighter.slack.models.sos.Sos] in the back-office.

## :fontawesome-brands-jira: Jira

!!! warning
Expand Down
4 changes: 4 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ nav:
- raid: reference/raid.md
- logging: reference/logging.md


markdown_extensions:
abbr: {}
admonition: {}
Expand Down Expand Up @@ -172,6 +173,9 @@ plugins:
- mike:
canonical_version: "latest"
version_selector: true
- redirects:
redirect_maps:
contributing.md: Contributing/0000-README.md
- mkdocstrings:
handlers:
python:
Expand Down
14 changes: 13 additions & 1 deletion pdm.lock

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

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ docs = [
"markdown-exec>=1.7",
"mkdocs-git-authors-plugin>=0.7.2",
"mkdocs-git-revision-date-localized-plugin>=1.2.2",
"mkdocs-redirects>=1.2.1",
]
types = [
"django-stubs>=4.2.6",
Expand Down
13 changes: 13 additions & 0 deletions src/firefighter/firefighter/settings/environments/dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,3 +189,16 @@ def _custom_show_toolbar(request: HttpRequest) -> bool:


FF_EXPOSE_API_DOCS: bool = config("FF_EXPOSE_API_DOCS", default=True, cast=bool)


FF_DEBUG_NO_SSO_REDIRECT: bool = config(
"FF_DEBUG_NO_SSO_REDIRECT", default=True, cast=bool
)

if FF_DEBUG_NO_SSO_REDIRECT:
MIDDLWARE = tuple(
middleware
for middleware in MIDDLEWARE
if middleware != "oauth2_authcodeflow.middleware.LoginRequiredMiddleware"
)
OIDC_MIDDLEWARE_LOGIN_REQUIRED_REDIRECT = False

0 comments on commit 07cfdcf

Please sign in to comment.