-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Issue #3474] Doc updates for auth #3491
base: main
Are you sure you want to change the base?
Conversation
7ec7e79
to
84828d9
Compare
This comment was marked as resolved.
This comment was marked as resolved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a lot of these are nits but I couldn't help myself.
Curious if we want to provide any more detail on the auth process, around things like token usage and cookie management, or if that is a case where we need to be careful not to overshare
|
||
## OpenSearch setup | ||
Run `make init && make run logs` to start the local containers. The application will be available at `http://localhost:8080/docs`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like directing to the docs site is a little confusing here. Would just saying "http://localhost:8080" make more sense?
* Flask API (http://localhost:8080) | ||
* Postgres database | ||
* OpenSearch node | ||
* OpenSearchdashboard (http://localhost:5601) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* OpenSearchdashboard (http://localhost:5601) | |
* OpenSearch Dashboard (http://localhost:5601) |
* Postgres database | ||
* OpenSearch node | ||
* OpenSearchdashboard (http://localhost:5601) | ||
* localstack |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be nice to have a brief note on what localstack is used for in this context. I had to look it up but seems like s3?
* **Localstack (local s3)** | ||
* Run `make init-localstack` | ||
* **Mock OAuth server** | ||
* Run `make init-mock-oath2` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Run `make init-mock-oath2` | |
* Run `make init-mock-oauth2` |
|
||
* **Localstack (local s3)** | ||
* Run `make init-localstack` | ||
* **Mock OAuth server** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this doesn't seem to be mentioned in any other documentation. Is it worth mentioning in this file what this is for and how / when to use it, maybe in the "User Authentication" section?
1. Download the VS Code extension described in these [Playwright docs](https://playwright.dev/docs/running-tests#run-tests-in-vs-code) | ||
2. Follow the [instructions](https://playwright.dev/docs/getting-started-vscode#running-tests) Playwright provides | ||
|
||
Playwright E2E tests run "local-to-local", requiring both the frontend and the API to be running for the tests to pass - and for the database to be seeded with data. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been confused by this - I actually get an error if I try to run e2e tests locally in VS code while running a dev server. If I have a built application in the .next directory, though, it seems to work without starting an actual server, and seems to start its own automatically
|
||
Playwright E2E tests run "local-to-local", requiring both the frontend and the API to be running for the tests to pass - and for the database to be seeded with data. | ||
|
||
In CI, the "Front-end Checks" workflow (`.github/workflows/ci-frontend-e2e.yml`) summary will include an "Artifacts" section where there is an attached "playwright-report". [Playwright docs](https://playwright.dev/docs/ci-intro#html-report) describe how to view HTML Report in more detail. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In CI, the "Front-end Checks" workflow (`.github/workflows/ci-frontend-e2e.yml`) summary will include an "Artifacts" section where there is an attached "playwright-report". [Playwright docs](https://playwright.dev/docs/ci-intro#html-report) describe how to view HTML Report in more detail. | |
In CI, the "Frontend Checks" workflow (`.github/workflows/ci-frontend-e2e.yml`) runs Playwright tests, and will include a summary when complete, with an "Artifacts" section where there is an attached "playwright-report". [Playwright docs](https://playwright.dev/docs/ci-intro#html-report) describe how to view the HTML Report in more detail. |
|
||
### Search and Opportunity Pages | ||
|
||
The `/search` and opportunity pages rely on the application API. The API endpoint and authenticaion token are defined in `.env.development` and can be overwritten in an `.env.ocal` file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The `/search` and opportunity pages rely on the application API. The API endpoint and authenticaion token are defined in `.env.development` and can be overwritten in an `.env.ocal` file. | |
The `/search` and opportunity pages rely on the application API. The API endpoint and authentication token are defined in `.env.development` and can be overwritten in an `.env.local` file. |
|
||
The `/search` and opportunity pages rely on the application API. The API endpoint and authenticaion token are defined in `.env.development` and can be overwritten in an `.env.ocal` file. | ||
|
||
Update the `API_URL` can be set to connect to prod (`https://api.simpler.grants.gov`) or lower environment URLs to quickly develop using production or development data. This requires the correct `API_AUTH_TOKEN` variable to be set correctly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update the `API_URL` can be set to connect to prod (`https://api.simpler.grants.gov`) or lower environment URLs to quickly develop using production or development data. This requires the correct `API_AUTH_TOKEN` variable to be set correctly. | |
The `API_URL` environment variable can be set to connect to prod (`https://api.simpler.grants.gov`) or lower environment URLs to quickly develop using production or development data. To successfully connect to a deployed API, the `API_AUTH_TOKEN` variable must be set correctly for the environment. |
|
||
Update the `API_URL` can be set to connect to prod (`https://api.simpler.grants.gov`) or lower environment URLs to quickly develop using production or development data. This requires the correct `API_AUTH_TOKEN` variable to be set correctly. | ||
|
||
To connect to the development version of the API, run `make init && db-seed-local && populate-search-opportunities` in the `/api` folder. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To connect to the development version of the API, run `make init && db-seed-local && populate-search-opportunities` in the `/api` folder. | |
To start a local development version of the API, run `make init && db-seed-local && populate-search-opportunities` in the `/api` folder. |
Summary
Fixes #3474
Time to review: 10 mins
Changes proposed
documentation/api/development.md
This doesn't remove anything, moves some of the local setup initially at the top under the
## Local (non-Docker)
section, adds some of the recent commands added including local stack and the oauth mock, and user auth setupfrontend/README.md
Removes detail on docker and other setup for the frontend development doc.
documentation/frontend/development.md
Reorganizes and consolidates frontend dev setup and aligns some of the headers with the API development doc.