-
Notifications
You must be signed in to change notification settings - Fork 0
#94 lambda readme generation #111
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
Open
tsudhakar87
wants to merge
9
commits into
main
Choose a base branch
from
94-lambda-readme-generation
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
7520ab7
add a template readme function to lambda cli tool
tsudhakar87 88fe5dd
added generate-readme arg for both specific lambdas and all lambdas
tsudhakar87 221f17a
generated readmes for existing lamdas using cli
tsudhakar87 8264c26
add github workflow & preserve existing sections of readme so they do…
tsudhakar87 fbff9b2
Merge branch 'main' into 94-lambda-readme-generation
tsudhakar87 c7eedb8
chore: regenerate lambda READMEs
github-actions[bot] 17ebc05
update auth readme description
tsudhakar87 60697dc
Merge branch 'main' into 94-lambda-readme-generation
tsudhakar87 53a4e1a
make this workflow wait for tf plan workflow to complete before starting
tsudhakar87 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,43 @@ | ||
| name: Lambda README Generation | ||
|
|
||
| on: | ||
| workflow_run: | ||
| workflows: ["Terraform Plan on Changed Files"] | ||
| types: [completed] | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| generate-readmes: | ||
| runs-on: ubuntu-latest | ||
| if: > | ||
| github.event_name == 'workflow_dispatch' || | ||
| github.event.workflow_run.conclusion == 'success' | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ github.event.workflow_run.head_branch || github.ref }} | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Set up Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
|
|
||
| - name: Generate READMEs | ||
| working-directory: apps/backend/lambdas | ||
| run: node tools/lambda-cli.js generate-readme | ||
|
|
||
| - name: Commit updated READMEs | ||
| run: | | ||
| git config --local user.email "github-actions[bot]@users.noreply.github.com" | ||
| git config --local user.name "github-actions[bot]" | ||
|
|
||
| git add apps/backend/lambdas/*/README.md | ||
|
|
||
| if git diff --staged --quiet; then | ||
| echo "No README changes to commit" | ||
| else | ||
| git commit -m "chore: regenerate lambda READMEs" | ||
| git push | ||
| fi | ||
This file contains hidden or 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,42 @@ | ||
| # auth | ||
|
|
||
| ## Description | ||
|
|
||
| Lambda for auth handler. | ||
|
|
||
| ## Endpoints | ||
|
|
||
| | Method | Path | Description | | ||
| |--------|------|-------------| | ||
| | GET | /health | Health check | | ||
| | POST | /register | | | ||
|
|
||
| ## Setup | ||
|
|
||
| ```bash | ||
| cd apps/backend/lambdas/auth | ||
| npm install | ||
| npm run dev | ||
| ``` | ||
|
|
||
| The handler will be available at `http://localhost:3000/auth`. | ||
|
|
||
| Swagger UI: `http://localhost:3000/auth/swagger` | ||
|
|
||
| ## Adding Routes | ||
|
|
||
| From the `apps/backend/lambdas` directory: | ||
|
|
||
| ```bash | ||
| node tools/lambda-cli.js add-route auth GET /auth/{id} | ||
| node tools/lambda-cli.js add-route auth POST /auth --body name:string | ||
| ``` | ||
|
|
||
| ## Scripts | ||
|
|
||
| | Script | Description | | ||
| |--------|-------------| | ||
| | `npm run dev` | Start local development server | | ||
| | `npm run build` | Compile TypeScript | | ||
| | `npm test` | Run tests | | ||
| | `npm run package` | Build and zip for deployment | |
This file contains hidden or 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,42 @@ | ||
| # donors | ||
|
|
||
| ## Description | ||
|
|
||
| Lambda for managing donors. | ||
|
|
||
| ## Endpoints | ||
|
|
||
| | Method | Path | Description | | ||
| |--------|------|-------------| | ||
| | GET | /health | Health check | | ||
| | GET | /donors | | | ||
|
|
||
| ## Setup | ||
|
|
||
| ```bash | ||
| cd apps/backend/lambdas/donors | ||
| npm install | ||
| npm run dev | ||
| ``` | ||
|
|
||
| The handler will be available at `http://localhost:3000/donors`. | ||
|
|
||
| Swagger UI: `http://localhost:3000/donors/swagger` | ||
|
|
||
| ## Adding Routes | ||
|
|
||
| From the `apps/backend/lambdas` directory: | ||
|
|
||
| ```bash | ||
| node tools/lambda-cli.js add-route donors GET /donors/{id} | ||
| node tools/lambda-cli.js add-route donors POST /donors --body name:string | ||
| ``` | ||
|
|
||
| ## Scripts | ||
|
|
||
| | Script | Description | | ||
| |--------|-------------| | ||
| | `npm run dev` | Start local development server | | ||
| | `npm run build` | Compile TypeScript | | ||
| | `npm test` | Run tests | | ||
| | `npm run package` | Build and zip for deployment | |
This file contains hidden or 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,42 @@ | ||
| # expenditures | ||
|
|
||
| ## Description | ||
|
|
||
| Lambda for tracking project expenditures. | ||
|
|
||
| ## Endpoints | ||
|
|
||
| | Method | Path | Description | | ||
| |--------|------|-------------| | ||
| | GET | /health | Health check | | ||
| | POST | /expenditures | | | ||
|
|
||
| ## Setup | ||
|
|
||
| ```bash | ||
| cd apps/backend/lambdas/expenditures | ||
| npm install | ||
| npm run dev | ||
| ``` | ||
|
|
||
| The handler will be available at `http://localhost:3000/expenditures`. | ||
|
|
||
| Swagger UI: `http://localhost:3000/expenditures/swagger` | ||
|
|
||
| ## Adding Routes | ||
|
|
||
| From the `apps/backend/lambdas` directory: | ||
|
|
||
| ```bash | ||
| node tools/lambda-cli.js add-route expenditures GET /expenditures/{id} | ||
| node tools/lambda-cli.js add-route expenditures POST /expenditures --body name:string | ||
| ``` | ||
|
|
||
| ## Scripts | ||
|
|
||
| | Script | Description | | ||
| |--------|-------------| | ||
| | `npm run dev` | Start local development server | | ||
| | `npm run build` | Compile TypeScript | | ||
| | `npm test` | Run tests | | ||
| | `npm run package` | Build and zip for deployment | |
This file contains hidden or 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,43 @@ | ||
| # projects | ||
|
|
||
| ## Description | ||
|
|
||
| Lambda for managing projects. | ||
|
|
||
| ## Endpoints | ||
|
|
||
| | Method | Path | Description | | ||
| |--------|------|-------------| | ||
| | GET | /health | Health check | | ||
| | GET | /projects | | | ||
| | POST | /projects | | | ||
|
|
||
| ## Setup | ||
|
|
||
| ```bash | ||
| cd apps/backend/lambdas/projects | ||
| npm install | ||
| npm run dev | ||
| ``` | ||
|
|
||
| The handler will be available at `http://localhost:3000/projects`. | ||
|
|
||
| Swagger UI: `http://localhost:3000/projects/swagger` | ||
|
|
||
| ## Adding Routes | ||
|
|
||
| From the `apps/backend/lambdas` directory: | ||
|
|
||
| ```bash | ||
| node tools/lambda-cli.js add-route projects GET /projects/{id} | ||
| node tools/lambda-cli.js add-route projects POST /projects --body name:string | ||
| ``` | ||
|
|
||
| ## Scripts | ||
|
|
||
| | Script | Description | | ||
| |--------|-------------| | ||
| | `npm run dev` | Start local development server | | ||
| | `npm run build` | Compile TypeScript | | ||
| | `npm test` | Run tests | | ||
| | `npm run package` | Build and zip for deployment | |
This file contains hidden or 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,41 @@ | ||
| # reports | ||
|
|
||
| ## Description | ||
|
|
||
| Lambda for generating reports. | ||
|
|
||
| ## Endpoints | ||
|
|
||
| | Method | Path | Description | | ||
| |--------|------|-------------| | ||
| | GET | /health | Health check | | ||
|
|
||
| ## Setup | ||
|
|
||
| ```bash | ||
| cd apps/backend/lambdas/reports | ||
| npm install | ||
| npm run dev | ||
| ``` | ||
|
|
||
| The handler will be available at `http://localhost:3000/reports`. | ||
|
|
||
| Swagger UI: `http://localhost:3000/reports/swagger` | ||
|
|
||
| ## Adding Routes | ||
|
|
||
| From the `apps/backend/lambdas` directory: | ||
|
|
||
| ```bash | ||
| node tools/lambda-cli.js add-route reports GET /reports/{id} | ||
| node tools/lambda-cli.js add-route reports POST /reports --body name:string | ||
| ``` | ||
|
|
||
| ## Scripts | ||
|
|
||
| | Script | Description | | ||
| |--------|-------------| | ||
| | `npm run dev` | Start local development server | | ||
| | `npm run build` | Compile TypeScript | | ||
| | `npm test` | Run tests | | ||
| | `npm run package` | Build and zip for deployment | |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
One small comment here: Since this workflow pushes a commit, we need to make sure we don't get race conditions with any other pipelines that also push commits (the terraform readme one in our case), otherwise they could error if running at same time. Can you either make this pipeline wait for the tf one or the tf one wait for this? Thank you!
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.
ooo good catch ty I will make this one wait for the tf one!