respec-web-services
respec-web-services copied to clipboard
Add path / file to the github commit APIs
The GH commits API includes path in https://docs.github.com/en/rest/commits/commits?apiVersion=2022-11-28
path string Only commits containing this file path will be returned.
Our repository contains multiple specifications and we would like to filter the GH commits so only commits against the particular repo are included in the changelog / commit history (perhaps other places too).
I'm happy to work on this but am having difficulty building respec-web-services to be able to work on this. Can you please help.
Sorry for the wait!
I'm happy to work on this but am having difficulty building respec-web-services to be able to work on this. Can you please help.
Let me add the quick instructions here, will add professionally written ones in Readme later.
Set up dev toolchain
Pre-requisites: Node v20
cd /path/to/respec-web-services
corepack enable # enables pnpm support; corepack comes built-in with Node
pnpm i
mkdir -p data # create a directory for data if it doesn't exist; it's .gitignored
Set up required env variables
cp .env.sample .env
We only require two values here correctly: DATA_DIR (/path/to/respec-web-services/data) and GH_TOKEN (to access GitHub API).
Start developing
Call from project root:
# start build process
pnpm build:watch
# in another terminal, start the Node web server
node build/app.js # runs server on port 8000 by default, can pass PORT env variable
# or, if you want live reload the Node server during dev:
nodemon -w build build/app.js
Then you can curl or Postman or visit URLs in browser to send requests.
Let me know if you face any difficulties. Feel free to ping in W3C #respec Slack for sync communication.
Note that the commits endpoint calls GitHub's GraphQL API for commits, not the REST API.
Relevant GraphQL Query in respec-web-services: https://github.com/speced/respec-web-services/blob/a6fa5e0095ca22a62db1b788055532e34a17342d/routes/github/lib/commits.ts#L121-L145
Thanks - the instructions are missing the following (for when you write the instructions) but I have an environment now.
pnpm update-data-sources
Closed by https://github.com/speced/respec-web-services/issues/435