Skip to content

Commit b180a3b

Browse files
committed
Merge remote-tracking branch 'upstream/main' into codex-pr-11958
2 parents f2b4b12 + c57007a commit b180a3b

1,140 files changed

Lines changed: 168762 additions & 20445 deletions

File tree

Some content is hidden

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

.clusterfuzzlite/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# Pinned by digest for supply-chain integrity. Bump periodically (the OSS-Fuzz
77
# base-builder is updated frequently with toolchain fixes); resolve a fresh digest with:
88
# docker buildx imagetools inspect gcr.io/oss-fuzz-base/base-builder-python:latest --format '{{.Manifest.Digest}}'
9-
FROM gcr.io/oss-fuzz-base/base-builder-python@sha256:5eb0feae4968e9a30de9e346f3e59fadbecb3ab3e0e251474e164b56d616e93f
9+
FROM gcr.io/oss-fuzz-base/base-builder-python@sha256:8476df732bcde364e001aa74b5df836ca28ff9c6acefb170cd9fb34ab07feea7
1010

1111
COPY . $SRC/haystack
1212
WORKDIR $SRC/haystack

.gitattributes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Exclude the Docusaurus documentation site from GitHub's language statistics
2+
# (github-linguist). Otherwise the ~5,700 .mdx files there dominate the count
3+
# and the repo is misclassified as MDX instead of Python.
4+
# See: https://github.com/github-linguist/linguist/blob/main/docs/troubleshooting.md
5+
docs-website/** linguist-documentation

.github/dependabot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ updates:
66
interval: 'daily'
77
cooldown:
88
default-days: 1
9+
groups:
10+
codeql:
11+
patterns:
12+
- 'github/codeql-action/*'
913

1014
- package-ecosystem: 'pip'
1115
directory: '/'

.github/utils/promote_unstable_docs_docusaurus.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,8 @@
2323
sys.exit("Version must be formatted like so <major>.<minor>")
2424

2525
target_version = f"{args.version}" # e.g., "2.20" - the target release version
26-
major, minor = args.version.split(".")
2726

2827
target_unstable = f"{target_version}-unstable" # e.g., "2.20-unstable"
29-
previous_stable = f"{major}.{int(minor) - 1}" # e.g., "2.19" - previous stable release
3028

3129
versions = [
3230
folder.replace("version-", "")
@@ -83,9 +81,15 @@
8381
with open("docs-website/reference_versions.json", "w") as f:
8482
json.dump(reference_versions_list, f)
8583

86-
# in docusaurus.config.js, replace previous stable version with the target version
84+
# in docusaurus.config.js, replace the current stable version (lastVersion) with the target version
8785
with open("docs-website/docusaurus.config.js") as f:
8886
config = f.read()
87+
last_version_matches = set(re.findall(r"lastVersion: '([^']+)'", config))
88+
if not last_version_matches:
89+
sys.exit("Could not find any lastVersion entry in docusaurus.config.js")
90+
if len(last_version_matches) > 1:
91+
sys.exit(f"Found inconsistent lastVersion entries in docusaurus.config.js: {last_version_matches}")
92+
previous_stable = last_version_matches.pop() # e.g., "2.19" - previous stable release
8993
config = config.replace(f"lastVersion: '{previous_stable}'", f"lastVersion: '{target_version}'") # "2.19" -> "2.20"
9094
with open("docs-website/docusaurus.config.js", "w") as f:
9195
f.write(config)

.github/workflows/branch_off.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020

2121
steps:
2222
- name: Checkout this repo
23-
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
23+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
2424
with:
2525
ref: main
2626
# Persist the bot token so the branch/tag pushes below authenticate as
@@ -58,7 +58,7 @@ jobs:
5858
git tag "v${{ steps.versions.outputs.next_version_rc0 }}" -m "v${{ steps.versions.outputs.next_version_rc0 }}"
5959
git push --tags
6060
61-
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
61+
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
6262
with:
6363
python-version: "${{ env.PYTHON_VERSION }}"
6464

.github/workflows/check_api_ref.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ jobs:
1313
test-api-reference-build:
1414
runs-on: ubuntu-slim
1515
steps:
16-
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
16+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
1717
with:
1818
persist-credentials: false
1919
fetch-depth: 0
2020

2121
- name: Set up Python
22-
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
22+
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
2323
with:
2424
python-version: "3.13"
2525

.github/workflows/cla_draft_gate.yml

Lines changed: 51 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,13 @@ name: CLA draft gate
66
# requested reviewers (remembering them in a hidden comment marker), label it
77
# `cla-pending`, and explain why in a comment.
88
# - When the CLA is signed (the `license/cla` commit status turns green), mark
9-
# the PR ready for review again and re-request the same reviewers. The
10-
# scheduled sweep doubles as a backstop in case a status event is missed.
9+
# the PR ready for review again and re-request the same reviewers. This also
10+
# covers the case where the contributor marks the PR ready for review
11+
# themselves after signing. The scheduled sweep doubles as a backstop in case
12+
# a status event is missed.
13+
# - Team members are never gated. author_association is unreliable for this
14+
# (private org members appear as CONTRIBUTOR/NONE), so effective repository
15+
# permission is used instead.
1116
# - While a PR stays gated, escalate: remind the contributor 5 days after the
1217
# PR was opened, post a final warning after 10 days, and close the PR after
1318
# 14 days. Each step waits for the previous comment to be a few days old, so
@@ -40,10 +45,12 @@ jobs:
4045
steps:
4146
- uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
4247
with:
43-
# GITHUB_TOKEN can normally convert PRs to draft and back. If those
44-
# GraphQL mutations ever fail with "Resource not accessible by
45-
# integration", add a classic PAT with `repo` scope as CLA_GATE_PAT.
46-
github-token: ${{ secrets.CLA_GATE_PAT || github.token }}
48+
# The convertPullRequestToDraft/markPullRequestReadyForReview GraphQL
49+
# mutations require a user token; GITHUB_TOKEN fails with "Resource
50+
# not accessible by integration" (seen on #12036). Use the bot PAT,
51+
# which also lets the ready_for_review/review_requested events from
52+
# restore() trigger the linked_issue_review workflow.
53+
github-token: ${{ secrets.HAYSTACK_BOT_TOKEN }}
4754
script: |
4855
const CLA_CONTEXT = "license/cla";
4956
const LABEL = "cla-pending";
@@ -56,6 +63,21 @@ jobs:
5663
const FIRST_TIMER = new Set(["FIRST_TIME_CONTRIBUTOR", "FIRST_TIMER", "NONE"]);
5764
const { owner, repo } = context.repo;
5865
66+
// Team members must never be gated. author_association is unreliable
67+
// for this: PRIVATE org members show up as CONTRIBUTOR/NONE in webhook
68+
// and API payloads, so check the effective repository permission
69+
// instead (write/admin => part of the team).
70+
async function isTeamMember(login) {
71+
try {
72+
const { data } = await github.rest.repos.getCollaboratorPermissionLevel({
73+
owner, repo, username: login,
74+
});
75+
return ["admin", "write"].includes(data.permission);
76+
} catch {
77+
return false;
78+
}
79+
}
80+
5981
async function claSigned(sha) {
6082
const { data } = await github.rest.repos.getCombinedStatusForRef({
6183
owner, repo, ref: sha, per_page: 100,
@@ -147,10 +169,14 @@ jobs:
147169
const comment = await findMarkerComment(pr.number);
148170
const meta = comment ? parseMarker(comment.body) : { reviewers: [], team_reviewers: [] };
149171
150-
await github.graphql(
151-
"mutation($id: ID!) { markPullRequestReadyForReview(input: { pullRequestId: $id }) { pullRequest { isDraft } } }",
152-
{ id: pr.node_id },
153-
);
172+
// The contributor may have marked the PR ready for review themselves
173+
// after signing; only run the mutation when it's still a draft.
174+
if (pr.draft) {
175+
await github.graphql(
176+
"mutation($id: ID!) { markPullRequestReadyForReview(input: { pullRequestId: $id }) { pullRequest { isDraft } } }",
177+
{ id: pr.node_id },
178+
);
179+
}
154180
155181
// Prefer the individual reviewers we removed; re-requesting the team
156182
// instead would make round-robin pick somebody new.
@@ -251,7 +277,7 @@ jobs:
251277
owner, repo, commit_sha: context.payload.sha,
252278
});
253279
for (const prLite of prs) {
254-
if (prLite.state !== "open" || !prLite.draft) continue;
280+
if (prLite.state !== "open") continue;
255281
if (!prLite.labels.some((l) => l.name === LABEL)) continue;
256282
const { data: pr } = await github.rest.pulls.get({ owner, repo, pull_number: prLite.number });
257283
await restore(pr);
@@ -267,18 +293,30 @@ jobs:
267293
try {
268294
if (pr.user?.type === "Bot") continue;
269295
const labels = pr.labels.map((l) => l.name);
270-
if (pr.draft) {
271-
if (!labels.includes(LABEL) || labels.includes(EXEMPT_LABEL)) continue;
296+
if (labels.includes(EXEMPT_LABEL)) continue;
297+
298+
// Already gated: drive the PR to the right state. Handle the
299+
// non-draft case too, since the contributor can mark a gated PR
300+
// ready for review themselves.
301+
if (labels.includes(LABEL)) {
272302
if (await claSigned(pr.head.sha)) {
273303
await restore(pr);
304+
} else if (pr.draft) {
305+
await escalate(pr);
274306
} else {
307+
// Readied without signing: put it back in draft, then escalate.
308+
await gate(pr);
275309
await escalate(pr);
276310
}
277311
continue;
278312
}
313+
314+
// Not yet gated: only gate fresh, external first-timer PRs.
315+
if (pr.draft) continue;
279316
if (!FIRST_TIMER.has(pr.author_association)) continue;
280317
if (Date.now() - new Date(pr.created_at).getTime() < GRACE_MS) continue;
281318
if (await claSigned(pr.head.sha)) continue;
319+
if (await isTeamMember(pr.user.login)) continue;
282320
await gate(pr);
283321
} catch (error) {
284322
core.warning(`PR #${pr.number}: ${error.message}`);

.github/workflows/codeql.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
name: CodeQL
22

33
on:
4+
# Skip runs that do not touch Python code
45
push:
56
branches: [main]
7+
paths:
8+
- "**/*.py"
9+
- ".github/workflows/codeql.yml"
610
pull_request:
711
branches: [main]
12+
paths:
13+
- "**/*.py"
14+
- ".github/workflows/codeql.yml"
815
workflow_dispatch:
916

1017
permissions:
@@ -40,17 +47,17 @@ jobs:
4047

4148
steps:
4249
- name: Checkout
43-
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
50+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
4451
with:
4552
persist-credentials: false
4653

4754
- name: Initialize CodeQL
48-
uses: github/codeql-action/init@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v4.37.0
55+
uses: github/codeql-action/init@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4.37.3
4956
with:
5057
languages: ${{ matrix.language }}
5158
build-mode: ${{ matrix.build-mode }}
5259

5360
- name: Perform CodeQL Analysis
54-
uses: github/codeql-action/analyze@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v4.37.0
61+
uses: github/codeql-action/analyze@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4.37.3
5562
with:
5663
category: "/language:${{ matrix.language }}"

.github/workflows/docker_release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212
- 'pyproject.toml'
1313
- 'VERSION.txt'
1414
tags:
15-
- "v2.[0-9]+.[0-9]+*"
15+
- "v[0-9]+.[0-9]+.[0-9]+*"
1616

1717
env:
1818
DOCKER_REPO_NAME: deepset/haystack
@@ -28,7 +28,7 @@ jobs:
2828

2929
steps:
3030
- name: Checkout
31-
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
31+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
3232
with:
3333
persist-credentials: false
3434

@@ -39,7 +39,7 @@ jobs:
3939
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
4040

4141
- name: Login to DockerHub
42-
uses: docker/login-action@af1e73f918a031802d376d3c8bbc3fe56130a9b0 # v4.4.0
42+
uses: docker/login-action@abd2ef45e78c5afb21d64d4ca52ee8550d9572c7 # v4.5.1
4343
with:
4444
username: ${{ secrets.DOCKER_HUB_USER }}
4545
password: ${{ secrets.DOCKER_HUB_TOKEN }}
@@ -52,7 +52,7 @@ jobs:
5252

5353
- name: Detect stable version
5454
run: |
55-
if [[ "${{ steps.meta.outputs.version }}" =~ ^v2\.[0-9]+\.[0-9]+$ ]]; then
55+
if [[ "${{ steps.meta.outputs.version }}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
5656
echo "IS_STABLE=true" >> "$GITHUB_ENV"
5757
echo "Stable version detected"
5858
else

.github/workflows/docs-website-test-docs-snippets.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,17 @@ jobs:
2626
AZURE_OPENAI_ENDPOINT: ${{ secrets.AZURE_OPENAI_ENDPOINT }}
2727
AZURE_OPENAI_AD_TOKEN: ${{ secrets.AZURE_OPENAI_AD_TOKEN }}
2828
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
29-
CORE_AZURE_CS_ENDPOINT: ${{ secrets.CORE_AZURE_CS_ENDPOINT }}
3029
HF_API_TOKEN: ${{ secrets.HUGGINGFACE_API_KEY }}
3130
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
32-
SERPERDEV_API_KEY: ${{ secrets.SERPERDEV_API_KEY }}
3331

3432
steps:
3533
- name: Checkout
36-
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
34+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
3735
with:
3836
persist-credentials: false
3937

4038
- name: Setup Python
41-
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
39+
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
4240
with:
4341
python-version: "3.11"
4442

0 commit comments

Comments
 (0)