Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/github_actions/actions/deploy-pag…
Browse files Browse the repository at this point in the history
…es-4
  • Loading branch information
ipc103 authored Feb 8, 2024
2 parents 8ed884b + 9c03cff commit 81bc33a
Show file tree
Hide file tree
Showing 38 changed files with 8,539 additions and 419 deletions.
28 changes: 9 additions & 19 deletions .github/workflows/nextjs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,26 +34,16 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go 1.x
uses: actions/setup-go@v4
- name: Setup Node for metrics backend
uses: actions/setup-node@v4
with:
go-version: ^1.19
- name: Get dependencies
run: |
cd backend
go get -v -t -d ./...
if [ -f Gopkg.toml ]; then
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
dep ensure
fi
- name: Build Go
run: make build
# - name: Test
# run: make test
- name: Run Go program and save output
id: run
node-version: "20.x"
- name: Collect metrics and save output
id: metrics
run: |
$PWD/backend/bin/metrics
cd ts-backend
npm i
npm start
- name: Detect package manager
id: detect-package-manager
run: |
Expand All @@ -76,7 +66,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "16"
node-version: "20.x"
cache: ${{ steps.detect-package-manager.outputs.manager }}
cache-dependency-path: ${{ steps.detect-package-manager.outputs.cache-dependency-path }}
- name: Setup Pages
Expand Down
38 changes: 23 additions & 15 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch metrics (local)",
"type": "go",
"request": "launch",
"mode": "debug",
"program": "${workspaceFolder}/backend/cmd/main.go",
"envFile": "${workspaceFolder}/dev.vscode.env",
},
]
}
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch metrics (local)",
"type": "go",
"request": "launch",
"mode": "debug",
"program": "${workspaceFolder}/backend/cmd/main.go",
"envFile": "${workspaceFolder}/dev.vscode.env"
},
{
"name": "Next.js: debug metrics",
"type": "node-terminal",
"request": "launch",
"cwd": "${workspaceFolder}/ts-backend",
"command": "npm run start",
"envFile": "${workspaceFolder}/ts-backend/.env"
}
]
}
7 changes: 7 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright 2024 GitHub Inc

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,8 @@ metrics:

test-go:
@echo "==> running Go tests <=="
CGO_ENABLED=1 go test -p 64 -race ./backend/...
CGO_ENABLED=1 cd backend && go test -p 64 -race ./...

dev:
@echo "==> Generating data"
cd backend && go build -o ./bin/metrics ./cmd && cd .. && ./backend/bin/metrics && cd who-metrics-ui && npm i && npm run dev
73 changes: 41 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,71 +10,62 @@ Monitor open source health across different projects to have a high level view t

Issue Project [here](https://github.com/github/SI-skills-based-volunteering/issues/147#issuecomment-1472370039)


## Team
<table>
<tr>
<td colspan=3 align=center>
<img src="https://avatars.githubusercontent.com/u/12959012?v=4" width="110" height="110"><br/><br/>
<tr valign="top">
<td align=center>
<img src="https://avatars.githubusercontent.com/u/12959012?v=4" width="110" height="110"><br/>
<a href="https://github.com/liliana3186">@liliana3186</a><br/>
</b>Liliana Torres<br>
Liliana Torres<br/>
<b>Project Lead, Senior Data Analyst </b>
</td>
<td colspan=3 align=center>
<img src="https://avatars.githubusercontent.com/u/34780972?v=4 width="110" height="110" ><br/>
<td align=center>
<img src="https://avatars.githubusercontent.com/u/34780972?v=4" width="110" height="110"><br/>
<a href="https://github.com/hasan-dot">@hasan-dot</a><br/>
</b>Hassan Hawache<br>
<b> Sofware Engineer III</b>
Hassan Hawache<br/>
<b>Sofware Engineer III</b>
</td>
<td colspan=3 align=center>
<td align=center>
<img src="https://avatars.githubusercontent.com/u/61184284?v=4" width="110" height="110"><br/>
<a href="https://github.com/darostegui">@daristegui</a><br/>
</b>Diego Arostegui<br>
<a href="https://github.com/darostegui">@darostegui</a><br/>
Diego Arostegui<br/>
<b>Customer Reliability Engineer III</b>
</td>
<td colspan=3 align=center>
<td align=center>
<img src="https://avatars.githubusercontent.com/u/24923406?v=4" width="110" height="110"><br/>
<a href="https://github.com/ajhenry">@ajhenry</a><br/>
</b>Andrew Henry<br>
Andrew Henry<br/>
<b> Senior Software Engineer </b>
</td>
<td colspan=3 align=center>
<td align=center>
<img src="https://avatars.githubusercontent.com/u/67866556?v=4" width="110" height="110"><br/>
<a href="https://github.com/joannaakl">@joannaakl</a><br/>
</b>Joanna Krzek-Lubowiecka<br>
Joanna Krzek-Lubowiecka<br/>
<b> Software Engineer III </br>
</td>
<td colspan=3 align=center>
<img src="https://avatars.githubusercontent.com/u/22037769?v=4 width="110" height="110"><br/>
<td align=center>
<img src="https://avatars.githubusercontent.com/u/22037769?v=4" width="110" height="110"><br/>
<a href="https://github.com/dmgardiner25">@dmgardiner25</a><br/>
</b>David Gardiner<br>
David Gardiner<br/>
<b> Software Engineer II</b>
</td>
<td colspan=3 align=center>
<td align=center>
<img src="https://github.com/ipc103.png?v=4" width="110" height="110"><br/>
<a href="https://github.com/ipc103">@ipc103</a><br/>
</b>Ian Candy<br>
Ian Candy<br/>
<b> Senior Software Engineer</b>
</td>
</tr>
</table>






## Development in Codespaces

### UI

1. Run `cd who-metrics-ui && npm i`
2. Run `npm run dev`

<!-- TODO: Add min requirements and deployment steps -->
### Backend
### Go Backend

To update the repository data.
To update the repository data using the Go backend

1. Generate a [new GitHub Token](https://github.com/settings/tokens) with the ability to read repo, read org, and read projects scopes.
1. Set the `GRAPHQL_TOKEN` environment variable to be the value of your newly created token.
Expand All @@ -84,4 +75,22 @@ make build
./backend/bin/metrics
```

This will generate a new `data.json` file in the UI directory which can be imported directly as part of the static build.
This will generate a new `data.json` file in the UI directory which can be imported directly as part of the static build.\

### TypeScript Backend

To update the repository data using the TypeScript backend.

1. Generate a [new GitHub Token](https://github.com/settings/tokens) with the ability to read repo, read org, and read projects scopes.
1. Set the `GRAPHQL_TOKEN` environment variable to be the value of your newly created token.
1. `cd ts-backend && npm install && yarn start`. This will generate a `data.json` file in the `who-metrics-ui` directory.
1. `cd ../who-metrics-ui` and run `npm install && npm run dev` to start the server.

### UI

Run `make dev` to develop in the UI. This will:

1. Build the backend project using the steps above
1. Generate a new `data.json` file with the required data inside the frontend directory
1. Run the Next development server

3 changes: 3 additions & 0 deletions config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
organization: "WorldHealthOrganization"
since: "2008-01-01"
3 changes: 2 additions & 1 deletion dev.vscode.env.example
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
GITHUB_GRAPHQL_TOKEN="TOKEN"
GRAPHQL_TOKEN="<YOUR TOKEN HERE>"
ORGANIZATION_NAME="your_organization"
1 change: 1 addition & 0 deletions ts-backend/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GRAPHQL_TOKEN=your_token
12 changes: 12 additions & 0 deletions ts-backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.cache
.DS_Store
.idea
*.log
*.tgz
coverage
dist
lib-cov
logs
node_modules
temp
*data.json
12 changes: 12 additions & 0 deletions ts-backend/build.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { defineBuildConfig } from 'unbuild'

export default defineBuildConfig({
entries: [
'src/index',
],
declaration: true,
clean: true,
rollup: {
emitCJS: true,
},
})
Loading

0 comments on commit 81bc33a

Please sign in to comment.