Skip to content

Commit 0523cfb

Browse files
authored
Merge branch 'main' into bc/snap-TKT-15032
2 parents 8096677 + 87b2045 commit 0523cfb

38 files changed

+6926
-829
lines changed

.github/workflows/changelog.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
on:
2+
pull_request:
3+
paths:
4+
- fern/apis/public/openapi-public.yaml
5+
- fern/apis/beta/openapi-beta.yaml
6+
7+
name: generate-changelog
8+
jobs:
9+
get-diff:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Get current date
13+
id: date
14+
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
15+
- name: Check out repository content
16+
uses: actions/checkout@v2
17+
with:
18+
ref: ${{ github.event.pull_request.head.ref }}
19+
- name: Check out HEAD rev
20+
uses: actions/checkout@v2
21+
with:
22+
ref: ${{ github.head_ref }}
23+
path: head
24+
- name: Check out BASE rev
25+
uses: actions/checkout@v2
26+
with:
27+
ref: ${{ github.base_ref }}
28+
path: base
29+
- name: Create dir
30+
run: |
31+
mkdir -p temp/beta temp/public
32+
- name: Running public OpenAPI Spec diff action
33+
uses: oasdiff/oasdiff-action/diff@main
34+
with:
35+
base: 'base/fern/apis/public/openapi-public.yaml'
36+
revision: 'head/fern/apis/public/openapi-public.yaml'
37+
format: text
38+
output-to-file: 'temp/public/${{ steps.date.outputs.date }}_oasdiff.md'
39+
- name: Running beta OpenAPI Spec diff action
40+
uses: oasdiff/oasdiff-action/diff@main
41+
with:
42+
base: 'base/fern/apis/beta/openapi-beta.yaml'
43+
revision: 'head/fern/apis/beta/openapi-beta.yaml'
44+
format: text
45+
output-to-file: 'temp/beta/${{ steps.date.outputs.date }}_oasdiff.md'
46+
- name: Archive changelogs
47+
uses: actions/upload-artifact@v4
48+
with:
49+
name: changelog-${{ steps.date.outputs.date }}
50+
path: temp/**
51+
- name: Prompt
52+
env:
53+
LLM_JWT: ${{ secrets.LLM_JWT }}
54+
run: |
55+
logfiles="fern/apis/*/changelog/${{ steps.date.outputs.date }}.md"
56+
57+
if ls $logfiles >/dev/null 2>&1; then
58+
logfiles=($logfiles)
59+
echo "${logfiles[@]} already exist."
60+
else
61+
python changelog.py --date ${{ steps.date.outputs.date }}
62+
git config user.name github-actions
63+
git config user.email [email protected]
64+
git add fern/apis/*/changelog/${{ steps.date.outputs.date }}.md
65+
git commit -m "generated by Claude"
66+
git push
67+
fi

.github/workflows/ekline.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
name: EkLine
22
on:
3+
push:
4+
branches:
5+
- master
6+
- main
37
pull_request:
4-
types: [labeled]
58
permissions: write-all
69
jobs:
710
test-pr-review:
8-
if: contains(github.event.label.name, 'EkLine')
11+
if: github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'No EkLine') == false
912
name: runner / EkLine Reviewer (github-pr-review)
1013
runs-on: ubuntu-latest
1114
steps:
@@ -16,5 +19,5 @@ jobs:
1619
ek_token: ${{ secrets.ek_token }}
1720
github_token: ${{ secrets.github_token }}
1821
reporter: github-pr-review
19-
filter_mode: diff_context
22+
filter_mode: file
2023
ignore_rule: "EK00031" # passive voice

.github/workflows/oasdiff.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
node_modules
2+
fern/dist
23
fern/*/definition/
34
.DS_Store
4-
.idea
5+
.idea
6+
temp

changelog.py

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
import yaml
2+
import argparse
3+
import requests
4+
import os
5+
import datetime
6+
import re
7+
8+
9+
def main(vrn, d):
10+
11+
print(f"Generating prompt for `{vrn}` API on {d}.")
12+
13+
p = gen_prompt(f"temp/{vrn}/{d}_oasdiff.md", get_links(vrn), vrn)
14+
15+
pr_file = f"temp/{vrn}/{d}_prompt.md"
16+
with open(pr_file, 'w', encoding="utf-8") as outfile:
17+
outfile.write(p)
18+
print(f"Wrote prompt to {pr_file}.")
19+
20+
l = gen_log(p)
21+
22+
log_file = f"./fern/apis/{vrn}/changelog/{d}.md"
23+
with open(log_file, 'w', encoding="utf-8") as outfile:
24+
outfile.write(l)
25+
print(f"Wrote log to {log_file}.")
26+
27+
28+
def gen_log(prompt):
29+
30+
auth = os.environ.get('LLM_JWT')
31+
if auth:
32+
headers = {"Content-Type": "application/json", "Authorization": f"Bearer {auth}"}
33+
payload = {
34+
"model": "us.anthropic.claude-3-5-sonnet-20241022-v2:0",
35+
"messages": [
36+
{
37+
"role": "user",
38+
"content": prompt
39+
}
40+
]
41+
}
42+
43+
try:
44+
r = requests.post('https://openwebui.dev.devrev-eng.ai/api/chat/completions', json=payload,
45+
headers=headers)
46+
log = r.json()['choices'][0]['message']['content']
47+
log = re.sub(r"^Here's.*\n?", '', log, flags=re.MULTILINE)
48+
log = re.sub(r"^Let me know.*\n?", '', log, flags=re.MULTILINE)
49+
except Exception as e:
50+
print(
51+
f"Failed to generate changelog. Error: {type(e)} {e} {r}")
52+
else:
53+
log = "No auth token"
54+
55+
return log
56+
57+
58+
def gen_prompt(oasdiff, links, version):
59+
with open(oasdiff, 'r') as infile:
60+
oasdiff = infile.read()
61+
62+
prompt = f"""
63+
Please provide an API changelog for the {version} API from the following OASDiff of OpenAPI spec changes. The output should be in markdown format grouping endpoints by use case/object type. For cases where some schema is modified, please also tell what endpoints it affects. Wherever an endpoint, property, or enum value is mentioned, surround it with backticks (`). Wherever an API is mentioned, include a hyperlink to the corresponding path from `<api_links>` section.
64+
65+
<oasdiff>
66+
{oasdiff}
67+
</oasdiff>
68+
69+
<api_links>
70+
{links}
71+
</api_links>
72+
"""
73+
74+
return prompt
75+
76+
def get_links(version):
77+
78+
src = f"./fern/apis/{version}/openapi-{version}.yaml"
79+
80+
with open(src, 'r') as s:
81+
spec = yaml.safe_load(s)
82+
apis = {}
83+
for endp, defn in spec['paths'].items():
84+
for val in defn.values():
85+
tag = val.get('tags')[0]
86+
opId = val.get('operationId')
87+
api = {'opId' : opId, 'method': endp.split('.')[-1]}
88+
api['target'] = f"/{version}/api-reference/{tag}/{opId.replace(f'{tag}-', '')}"
89+
if tag not in apis:
90+
apis[tag] = {endp: api}
91+
else:
92+
apis[tag][endp] = api
93+
94+
md = f"# {version}\n\n"
95+
for tag, api in sorted(apis.items()):
96+
md += f"\n## {tag}\n\n"
97+
for endp, val in api.items():
98+
link_text = f"**{tag} > {val['method']}**: `{val['opId']}`"
99+
md += f"- [{endp}]({val['target']}) {link_text}\n"
100+
return md
101+
102+
if __name__ == "__main__":
103+
parser = argparse.ArgumentParser(description="Generate release notes")
104+
parser.add_argument('--date', default=datetime.date.today())
105+
parser.add_argument('--beta', default=True,
106+
action=argparse.BooleanOptionalAction)
107+
parser.add_argument('--public', default=True,
108+
action=argparse.BooleanOptionalAction)
109+
args = parser.parse_args()
110+
if args.beta:
111+
main('beta', args.date)
112+
if args.public:
113+
main('public', args.date)
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
2+
# API Changelog
3+
4+
## New Endpoints
5+
6+
### Airdrop
7+
- Added `GET` and `POST` [`/airdrop.sync-units.get`](/beta/api-reference/airdrop/sync-units-get-post) to get sync units
8+
- Added `GET` and `POST` [`/airdrop.sync-units.history`](/beta/api-reference/airdrop/sync-units-history-post) to get sync unit history
9+
10+
### Meetings
11+
- Added `GET` and `POST` [`/meetings.count`](/beta/api-reference/meetings/count-post) to count meetings
12+
- Added `POST` [`/meetings.create`](/beta/api-reference/meetings/create) to create meetings
13+
- Added `POST` [`/meetings.delete`](/beta/api-reference/meetings/delete) to delete meetings
14+
- Added `GET` and `POST` [`/meetings.get`](/beta/api-reference/meetings/get-post) to get meeting details
15+
- Added `GET` and `POST` [`/meetings.list`](/beta/api-reference/meetings/list-post) to list meetings
16+
- Added `POST` [`/meetings.update`](/beta/api-reference/meetings/update) to update meetings
17+
18+
### Schedule Related
19+
- Added `GET` and `POST` [`/org-schedules.evaluate`](/beta/api-reference/schedules/org-evaluate-post) to evaluate schedules
20+
21+
### Recommendations
22+
- Added `POST` [`/recommendations.get-reply`](/beta/api-reference/recommendations/get-reply) to get recommendations reply
23+
24+
### Survey
25+
- Added `POST` [`/surveys.update`](/beta/api-reference/surveys/update) to update surveys
26+
27+
## Modified Endpoints
28+
29+
### Account Management
30+
The following endpoints have been updated to support a new `websites` property:
31+
32+
- [`/accounts.create`](/beta/api-reference/accounts/create)
33+
- [`/accounts.export`](/beta/api-reference/accounts/export-post)
34+
- [`/accounts.get`](/beta/api-reference/accounts/get-post)
35+
- [`/accounts.list`](/beta/api-reference/accounts/list-post)
36+
- [`/accounts.update`](/beta/api-reference/accounts/update)
37+
38+
### Authentication
39+
New `okta` enum value added for `type` property in:
40+
41+
- [`/dev-orgs.auth-connections.create`](/beta/api-reference/auth-connection/dev-org-auth-connections-create)
42+
- [`/dev-orgs.auth-connections.get`](/beta/api-reference/auth-connection/dev-org-auth-connections-get-post)
43+
- [`/dev-orgs.auth-connections.list`](/beta/api-reference/auth-connection/dev-org-auth-connections-list-post)
44+
- [`/dev-orgs.auth-connections.update`](/beta/api-reference/auth-connection/dev-org-auth-connections-update)
45+
46+
### Schema Changes
47+
UI schema properties updated with new fields across multiple endpoints:
48+
- Added `is_currency_field`
49+
- Added `order`
50+
- Added `unit`
51+
52+
This affects endpoints that handle schemas including:
53+
- [`/schemas.custom.get`](/beta/api-reference/customization/custom-schema-fragments-get-post)
54+
- [`/schemas.custom.list`](/beta/api-reference/customization/custom-schema-fragments-list-post)
55+
- [`/schemas.custom.set`](/beta/api-reference/customization/custom-schema-fragments-set)
56+
57+
### Webhooks
58+
New event types added to webhook related endpoints:
59+
- `sync_history_created`
60+
- `sync_history_deleted`
61+
- `sync_history_updated`
62+
- `sync_unit_updated`
63+
64+
Affects:
65+
- [`/webhooks.create`](/beta/api-reference/webhooks/create)
66+
- [`/webhooks.get`](/beta/api-reference/webhooks/get-post)
67+
- [`/webhooks.list`](/beta/api-reference/webhooks/list-post)
68+
- [`/webhooks.update`](/beta/api-reference/webhooks/update)

0 commit comments

Comments
 (0)