Skip to content

Commit 3717880

Browse files
Merge branch 'main' into main
2 parents a3f4203 + 8541956 commit 3717880

File tree

155 files changed

+11836
-854
lines changed

Some content is hidden

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

155 files changed

+11836
-854
lines changed

.github/codex/home/config.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
model = "o3"

.github/codex/labels/codex-attempt.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Attempt to solve the reported issue.
2+
3+
If a code change is required, create a new branch, commit the fix, and open a pull request that resolves the problem.
4+
5+
Here is the original GitHub issue that triggered this run:
6+
7+
### {CODEX_ACTION_ISSUE_TITLE}
8+
9+
{CODEX_ACTION_ISSUE_BODY}

.github/codex/labels/codex-review.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Review this PR and respond with a very concise final message, formatted in Markdown.
2+
3+
There should be a summary of the changes (1-2 sentences) and a few bullet points if necessary.
4+
5+
Then provide the **review** (1-2 sentences plus bullet points, friendly tone).
6+
7+
{CODEX_ACTION_GITHUB_EVENT_PATH} contains the JSON that triggered this GitHub workflow. It contains the `base` and `head` refs that define this PR. Both refs are available locally.

.github/codex/labels/codex-triage.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Troubleshoot whether the reported issue is valid.
2+
3+
Provide a concise and respectful comment summarizing the findings.
4+
5+
### {CODEX_ACTION_ISSUE_TITLE}
6+
7+
{CODEX_ACTION_ISSUE_BODY}

.github/workflows/codex.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Codex
2+
3+
on:
4+
issues:
5+
types: [opened, labeled]
6+
pull_request:
7+
branches: [main]
8+
types: [labeled]
9+
10+
jobs:
11+
codex:
12+
# This `if` check provides complex filtering logic to avoid running Codex
13+
# on every PR. Admittedly, one thing this does not verify is whether the
14+
# sender has write access to the repo: that must be done as part of a
15+
# runtime step.
16+
#
17+
# Note the label values should match the ones in the .github/codex/labels
18+
# folder.
19+
if: |
20+
(github.event_name == 'issues' && (
21+
(github.event.action == 'labeled' && (github.event.label.name == 'codex-attempt' || github.event.label.name == 'codex-triage'))
22+
)) ||
23+
(github.event_name == 'pull_request' && github.event.action == 'labeled' && github.event.label.name == 'codex-review')
24+
runs-on: ubuntu-latest
25+
permissions:
26+
contents: write # can push or create branches
27+
issues: write # for comments + labels on issues/PRs
28+
pull-requests: write # for PR comments/labels
29+
steps:
30+
# TODO: Consider adding an optional mode (--dry-run?) to actions/codex
31+
# that verifies whether Codex should actually be run for this event.
32+
# (For example, it may be rejected because the sender does not have
33+
# write access to the repo.) The benefit would be two-fold:
34+
# 1. As the first step of this job, it gives us a chance to add a reaction
35+
# or comment to the PR/issue ASAP to "ack" the request.
36+
# 2. It saves resources by skipping the clone and setup steps below if
37+
# Codex is not going to run.
38+
39+
- name: Checkout repository
40+
uses: actions/checkout@v4
41+
42+
# We install the dependencies like we would for an ordinary CI job,
43+
# particularly because Codex will not have network access to install
44+
# these dependencies.
45+
- name: Setup uv
46+
uses: astral-sh/setup-uv@v5
47+
with:
48+
enable-cache: true
49+
50+
- name: Install dependencies
51+
run: make sync
52+
53+
# Note it is possible that the `verify` step internal to Run Codex will
54+
# fail, in which case the work to setup the repo was worthless :(
55+
- name: Run Codex
56+
uses: openai/codex/.github/actions/codex@main
57+
with:
58+
openai_api_key: ${{ secrets.PROD_OPENAI_API_KEY }}
59+
github_token: ${{ secrets.GITHUB_TOKEN }}
60+
codex_home: ./.github/codex/home

.github/workflows/update-docs.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: "Update Translated Docs"
2+
3+
# This GitHub Actions job automates the process of updating all translated document pages. Please note the following:
4+
# 1. The translation results may vary each time; some differences in detail are expected.
5+
# 2. When you add a new page to the left-hand menu, **make sure to manually update mkdocs.yml** to include the new item.
6+
# 3. If you switch to a different LLM (for example, from o3 to a newer model), be sure to conduct thorough testing before making the switch.
7+
8+
on:
9+
push:
10+
branches:
11+
- main
12+
paths:
13+
- 'docs/**'
14+
- mkdocs.yml
15+
16+
jobs:
17+
update-docs:
18+
if: "!contains(github.event.head_commit.message, 'Update all translated document pages')"
19+
name: Build and Push Translated Docs
20+
runs-on: ubuntu-latest
21+
timeout-minutes: 20
22+
env:
23+
PROD_OPENAI_API_KEY: ${{ secrets.PROD_OPENAI_API_KEY }}
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@v3
27+
with:
28+
fetch-depth: 0
29+
- name: Setup uv
30+
uses: astral-sh/setup-uv@v5
31+
with:
32+
enable-cache: true
33+
- name: Install dependencies
34+
run: make sync
35+
- name: Build full docs
36+
run: make build-full-docs
37+
38+
- name: Commit changes
39+
id: commit
40+
run: |
41+
git config user.name "github-actions[bot]"
42+
git config user.email "github-actions[bot]@users.noreply.github.com"
43+
git add docs/
44+
if [ -n "$(git status --porcelain)" ]; then
45+
git commit -m "Update all translated document pages"
46+
echo "committed=true" >> "$GITHUB_OUTPUT"
47+
else
48+
echo "No changes to commit"
49+
echo "committed=false" >> "$GITHUB_OUTPUT"
50+
fi
51+
52+
- name: Create Pull Request
53+
if: steps.commit.outputs.committed == 'true'
54+
uses: peter-evans/create-pull-request@v6
55+
with:
56+
commit-message: "Update all translated document pages"
57+
title: "Update all translated document pages"
58+
body: "Automated update of translated documentation"
59+
branch: update-translated-docs-${{ github.run_id }}
60+
delete-branch: true

.vscode/launch.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "Python Debugger: Python File",
9+
"type": "debugpy",
10+
"request": "launch",
11+
"program": "${file}"
12+
}
13+
]
14+
}

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ old_version_tests:
4444

4545
.PHONY: build-docs
4646
build-docs:
47+
uv run docs/scripts/generate_ref_files.py
4748
uv run mkdocs build
4849

4950
.PHONY: build-full-docs

0 commit comments

Comments
 (0)