Skip to content

Commit dcf216e

Browse files
authored
Merge branch 'main' into truncating-app-node-text
2 parents 9813cf2 + 042a914 commit dcf216e

File tree

309 files changed

+74728
-135958
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

309 files changed

+74728
-135958
lines changed
Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
---
2+
name: update-publications
3+
description: Updates the Monarch Initiative publications page with latest data from Google Scholar. Use this when the user asks to update publications, refresh citation metrics, or add new papers to the publications page.
4+
---
5+
6+
# Update Publications Page
7+
8+
This Skill guides you through updating the Monarch Initiative publications page with the latest publications and citation metrics from Google Scholar.
9+
10+
## Google Scholar Profile
11+
12+
The Monarch Initiative Google Scholar profile is:
13+
https://scholar.google.com/citations?hl=en&user=zmUEDj0AAAAJ&view_op=list_works&authuser=1&sortby=pubdate
14+
15+
## Prerequisites
16+
17+
Before starting, ensure the Python environment is set up:
18+
19+
```bash
20+
uv sync --all-extras
21+
```
22+
23+
This installs all dependencies including `scholarly`, `typer`, and `loguru`.
24+
25+
## Step-by-Step Process
26+
27+
### 1. Fetch Latest Metadata
28+
29+
Fetch updated citation metrics from Google Scholar:
30+
31+
```bash
32+
uv run python scripts/get_publications.py fetch-metadata
33+
```
34+
35+
This retrieves total citations, h-index, i10-index, and citations per year, saving to `scripts/metadata.json`.
36+
37+
### 2. Fetch Latest Publications
38+
39+
Fetch the complete publication list (this takes several minutes):
40+
41+
```bash
42+
uv run python scripts/get_publications.py fetch-publications
43+
```
44+
45+
This saves raw publication data to `scripts/scholarly_output.json`.
46+
47+
### 3. Handle Missing Links
48+
49+
Run the update command to check for missing publication links:
50+
51+
```bash
52+
uv run python scripts/get_publications.py update
53+
```
54+
55+
If any publications are missing links, the script will exit with an error listing them. For each missing link:
56+
57+
1. Search online for the publication's official URL (DOI, PubMed, publisher site, arXiv, etc.)
58+
2. Add to the `KNOWN_LINKS` dictionary in `scripts/get_publications.py` (around line 28)
59+
3. Run the update command again
60+
61+
Example addition to KNOWN_LINKS:
62+
```python
63+
KNOWN_LINKS = {
64+
"Publication Title Here": "https://doi.org/10.1234/example",
65+
# ... other entries
66+
}
67+
```
68+
69+
### 4. Review Changes
70+
71+
Once the update succeeds, review the changes:
72+
73+
```bash
74+
git diff frontend/src/data/publications.json
75+
```
76+
77+
Note the key metrics:
78+
- Number of new publications
79+
- Citation count changes
80+
- H-index changes
81+
- i10-index changes
82+
83+
### 5. Commit Changes
84+
85+
Commit the updated files following the repository's conventions:
86+
87+
```bash
88+
git add frontend/src/data/publications.json
89+
# Add scripts/get_publications.py if KNOWN_LINKS was updated
90+
git add scripts/get_publications.py
91+
92+
git commit -m "[Month] [Year] Publications update
93+
94+
Updated publications page with latest data from Google Scholar:
95+
- [X] new publications added
96+
- Citation count: [old] → [new]
97+
- H-index: [old] → [new]
98+
- Publications: [old] → [new]
99+
100+
🤖 Generated with [Claude Code](https://claude.com/claude-code)
101+
102+
Co-Authored-By: Claude <noreply@anthropic.com>"
103+
```
104+
105+
### 6. Create Pull Request
106+
107+
Push and create a PR with a detailed summary:
108+
109+
```bash
110+
git push -u origin [branch-name]
111+
112+
gh pr create --title "[Month] [Year] Publications update" --body "
113+
## Summary
114+
- Updated publications page with latest data from Google Scholar
115+
- Added [X] new publications
116+
- Updated citation metrics
117+
118+
## Changes
119+
- Citation count: [old] → [new]
120+
- H-index: [old] → [new]
121+
- Total publications: [old] → [new]
122+
123+
## New Publications
124+
[List new publications]
125+
126+
🤖 Generated with [Claude Code](https://claude.com/claude-code)
127+
"
128+
```
129+
130+
## Files Modified
131+
132+
- `frontend/src/data/publications.json` - Main publications data
133+
- `scripts/metadata.json` - Citation metadata (cached, not typically committed)
134+
- `scripts/scholarly_output.json` - Raw publications (cached, not typically committed)
135+
- `scripts/get_publications.py` - Only if KNOWN_LINKS was updated
136+
137+
## Reference Example
138+
139+
See PR #1217 for a reference example of a publications update.
140+
141+
## Troubleshooting
142+
143+
**Missing Links Error**: Search for the publication online and add its URL to KNOWN_LINKS in the script.
144+
145+
**Rate Limiting**: If Google Scholar blocks requests, wait a few minutes and retry.
146+
147+
**Duplicate Publications**: The script automatically handles duplicates by merging metadata.
148+
149+
## Notes
150+
151+
- Updates are typically done monthly or quarterly
152+
- All publications must have valid links before the update completes
153+
- The script deduplicates and merges publication metadata automatically
154+
- Publications are organized by year in reverse chronological order

.github/workflows/build-and-deploy-images.yaml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
echo "IMAGE_TAG=${IMAGE_TAG//v}" >> $GITHUB_OUTPUT
2929
3030
- name: Build and Push Image
31-
uses: RafikFarhad/push-to-gcr-github-action@v5-beta
31+
uses: RafikFarhad/push-to-gcr-github-action@v5-rc1
3232
with:
3333
gcloud_service_key: ${{ secrets.JSON_GCLOUD_SERVICE_ACCOUNT_JSON }}
3434
registry: us-central1-docker.pkg.dev
@@ -51,7 +51,7 @@ jobs:
5151
fetch-depth: 0 # to get all tags
5252

5353
- name: Set up Bun
54-
uses: oven-sh/setup-bun@v1
54+
uses: oven-sh/setup-bun@v2
5555

5656
- name: Install packages
5757
run: bun install
@@ -72,7 +72,7 @@ jobs:
7272
# ./services/nginx/config/, copied to /etc/nginx/conf.d/ in the image
7373

7474
- name: Build and Push Image
75-
uses: RafikFarhad/push-to-gcr-github-action@v5-beta
75+
uses: RafikFarhad/push-to-gcr-github-action@v5-rc1
7676
with:
7777
gcloud_service_key: ${{ secrets.JSON_GCLOUD_SERVICE_ACCOUNT_JSON }}
7878
registry: us-central1-docker.pkg.dev
@@ -98,8 +98,6 @@ jobs:
9898

9999
- name: "Set up Cloud SDK"
100100
uses: "google-github-actions/setup-gcloud@v2"
101-
with:
102-
version: ">= 447.0.0"
103101

104102
- name: "Cache SSH Key"
105103
uses: actions/cache@v4
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Build and Push to GCR for specific branches
2+
on:
3+
push:
4+
branches:
5+
- issue-982-about-dropdown
6+
7+
# This job uses RafikFarhad's GitHub action to build and
8+
# push a docker image to a specified GCP repository
9+
jobs:
10+
build-and-push-to-gcr:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0 # to get all tags
17+
18+
- name: Generate Image Tag
19+
id: get-tag
20+
run: |
21+
REV=$(git rev-list --tags --max-count=1)
22+
IMAGE_TAG=$(git describe --tags $REV)
23+
echo "IMAGE_TAG=${IMAGE_TAG//v}"
24+
echo "IMAGE_TAG=${IMAGE_TAG//v}" >> $GITHUB_OUTPUT
25+
26+
- name: Build and Push Image
27+
uses: RafikFarhad/push-to-gcr-github-action@v5-beta
28+
with:
29+
gcloud_service_key: ${{ secrets.JSON_GCLOUD_SERVICE_ACCOUNT_JSON }} # not needed if you use google-github-actions/auth
30+
registry: us-central1-docker.pkg.dev
31+
project_id: monarch-initiative
32+
image_name: monarch-api/monarch-api
33+
image_tag: ${{ github.sha }}, ${{ github.ref_name }}
34+
dockerfile: ./backend/Dockerfile
35+
36+
build-and-push-frontend-image:
37+
runs-on: ubuntu-latest
38+
defaults:
39+
run:
40+
working-directory: ./frontend
41+
permissions:
42+
contents: write
43+
steps:
44+
- name: Checkout code
45+
uses: actions/checkout@v4
46+
with:
47+
fetch-depth: 0 # to get all tags
48+
49+
- name: Set up Bun
50+
uses: oven-sh/setup-bun@v2
51+
52+
- name: Install packages
53+
run: bun install
54+
55+
- name: Build app
56+
run: bun run build
57+
58+
- name: Generate Image Tag for Frontend Dir
59+
id: get-tag
60+
run: |
61+
REV=$(git rev-list --tags --max-count=1 )
62+
IMAGE_TAG=$(git describe --tags $REV)
63+
echo "IMAGE_TAG=${IMAGE_TAG//v}"
64+
echo "IMAGE_TAG=${IMAGE_TAG//v}" >> $GITHUB_OUTPUT
65+
66+
# the monarch-ui Dockerfile pulls from two places:
67+
# ./frontend/dist/, copied to /var/www/ in the image
68+
# ./services/nginx/config/, copied to /etc/nginx/conf.d/ in the image
69+
70+
- name: Build and Push Image
71+
uses: RafikFarhad/push-to-gcr-github-action@v5-beta
72+
with:
73+
gcloud_service_key: ${{ secrets.JSON_GCLOUD_SERVICE_ACCOUNT_JSON }}
74+
registry: us-central1-docker.pkg.dev
75+
project_id: monarch-initiative
76+
image_name: monarch-api/monarch-ui
77+
image_tag: ${{ github.sha }}, ${{ github.ref_name }}
78+
dockerfile: ./services/nginx/Dockerfile
79+
context: .

.github/workflows/build-semsim-image.yaml

Lines changed: 0 additions & 26 deletions
This file was deleted.
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Claude Code Review
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize]
6+
# Optional: Only run on specific file changes
7+
# paths:
8+
# - "src/**/*.ts"
9+
# - "src/**/*.tsx"
10+
# - "src/**/*.js"
11+
# - "src/**/*.jsx"
12+
13+
jobs:
14+
claude-review:
15+
# Optional: Filter by PR author
16+
# if: |
17+
# github.event.pull_request.user.login == 'external-contributor' ||
18+
# github.event.pull_request.user.login == 'new-developer' ||
19+
# github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
20+
21+
runs-on: ubuntu-latest
22+
permissions:
23+
contents: read
24+
pull-requests: read
25+
issues: read
26+
id-token: write
27+
28+
steps:
29+
- name: Checkout repository
30+
uses: actions/checkout@v4
31+
with:
32+
fetch-depth: 1
33+
34+
- name: Run Claude Code Review
35+
id: claude-review
36+
uses: anthropics/claude-code-action@v1
37+
with:
38+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
39+
prompt: |
40+
REPO: ${{ github.repository }}
41+
PR NUMBER: ${{ github.event.pull_request.number }}
42+
43+
Please review this pull request and provide feedback on:
44+
- Code quality and best practices
45+
- Potential bugs or issues
46+
- Performance considerations
47+
- Security concerns
48+
- Test coverage
49+
50+
Use the repository's CLAUDE.md for guidance on style and conventions. Be constructive and helpful in your feedback.
51+
52+
Use `gh pr comment` with your Bash tool to leave your review as a comment on the PR.
53+
54+
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
55+
# or https://code.claude.com/docs/en/cli-reference for available options
56+
claude_args: '--allowed-tools "Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"'
57+

0 commit comments

Comments
 (0)