Skip to content

Commit 87f7afa

Browse files
authored
Merge branch 'main' into ignore-path-dependent-destructors-in-translation-classes
2 parents 44536bd + ce33a8a commit 87f7afa

1,277 files changed

Lines changed: 61677 additions & 44416 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.

‎.gitattributes‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@
7575
/ruby/extractor/cargo-bazel-lock.json linguist-generated=true
7676
/ruby/extractor/cargo-bazel-lock.json -merge
7777

78+
# GitHub Agentic Workflows compiled output
79+
.github/workflows/*.lock.yml linguist-generated=true
80+
7881
# auto-generated files for the C# build
7982
/csharp/paket.lock linguist-generated=true
8083
# needs eol=crlf, as `paket` touches this file and saves it as crlf

‎.github/labeler.yml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ Swift:
3838
- swift/**/*
3939
- change-notes/**/*swift*
4040

41+
Unified:
42+
- unified/**/*
43+
- change-notes/**/*unified*
44+
4145
Actions:
4246
- actions/**/*
4347
- change-notes/**/*actions*

‎.github/workflows/label-external-contributions.yml‎

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,21 @@ jobs:
2020
pull-requests: write
2121

2222
steps:
23+
- name: Create organization membership token
24+
id: membership-token
25+
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
26+
with:
27+
client-id: ${{ vars.CODEQL_ORG_MEMBERS_APP_CLIENT_ID }}
28+
private-key: ${{ secrets.CODEQL_ORG_MEMBERS_APP_PRIVATE_KEY }}
29+
owner: ${{ github.repository_owner }}
30+
permission-members: read
31+
2332
- name: Label external contributions
2433
env:
34+
API_URL: ${{ github.api_url }}
2535
GH_TOKEN: ${{ github.token }}
36+
MEMBERS_TOKEN: ${{ steps.membership-token.outputs.token }}
37+
ORG: ${{ github.repository_owner }}
2638
REPO: ${{ github.repository }}
2739
run: |
2840
set -euo pipefail
@@ -46,13 +58,13 @@ jobs:
4658
(.head.repo.full_name | type == "string") and
4759
.head.repo.full_name != $repo and
4860
.user.type == "User" and
49-
.author_association != "MEMBER" and
50-
.author_association != "OWNER" and
61+
(.user.login | type == "string" and length > 0) and
5162
(any(.labels[]?; .name == $label) | not)' \
5263
>/dev/null <<<"$pr_json"; then
5364
continue
5465
fi
5566
67+
author=$(jq -r '.user.login' <<<"$pr_json")
5668
events=$(gh api --paginate \
5769
"repos/$REPO/issues/$pr_number/events?per_page=100" |
5870
jq -cs 'add')
@@ -63,6 +75,34 @@ jobs:
6375
continue
6476
fi
6577
78+
if ! membership_status=$(curl \
79+
--silent \
80+
--show-error \
81+
--output /dev/null \
82+
--write-out '%{http_code}' \
83+
--connect-timeout 10 \
84+
--max-time 30 \
85+
--header "Accept: application/vnd.github+json" \
86+
--header "Authorization: Bearer $MEMBERS_TOKEN" \
87+
--header "X-GitHub-Api-Version: 2022-11-28" \
88+
"$API_URL/orgs/$ORG/members/$author"); then
89+
echo "::error::Membership check failed for pull request #$pr_number."
90+
exit 1
91+
fi
92+
93+
case "$membership_status" in
94+
204)
95+
echo "Pull request #$pr_number was opened by an organization member; skipping."
96+
continue
97+
;;
98+
404)
99+
;;
100+
*)
101+
echo "::error::Membership check for pull request #$pr_number returned HTTP $membership_status."
102+
exit 1
103+
;;
104+
esac
105+
66106
jq -n --arg label "$label" '{labels: [$label]}' |
67107
gh api --method POST \
68108
"repos/$REPO/issues/$pr_number/labels" \

‎.github/workflows/rust-analysis.yml‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,15 @@ jobs:
5757
languages: ${{ matrix.language }}
5858
config-file: ./.github/codeql/codeql-config.yml
5959

60+
# TODO: Remove once Rust extractor no longer errors on this file
61+
- name: Remove malformed rust-analyzer parser fixture
62+
shell: bash
63+
run: |
64+
cargo fetch
65+
find "${CARGO_HOME:-$HOME/.cargo}/registry/src" \
66+
-path '*/ra_ap_parser-0.0.352/test_data/lexer/err/incomplete_frontmatter_before_unicode.rs' \
67+
-delete
68+
6069
- name: Autobuild
6170
uses: github/codeql-action/autobuild@main
6271

‎.github/workflows/update-rust-analyzer.lock.yml‎

Lines changed: 1822 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
---
2+
name: Update rust-analyzer
3+
emoji: 🦀
4+
description: Update the rust-analyzer version used by the Rust extractor and prepare a pull request.
5+
intent: Keep the Rust extractor on the latest compatible rust-analyzer version with a reviewable, validated pull request.
6+
on:
7+
workflow_dispatch:
8+
roles: [admin, maintainer, write]
9+
permissions:
10+
contents: read
11+
actions: read
12+
pull-requests: read
13+
copilot-requests: write
14+
strict: true
15+
checkout:
16+
fetch-depth: 0
17+
concurrency:
18+
group: update-rust-analyzer
19+
cancel-in-progress: false
20+
timeout-minutes: 180
21+
tools:
22+
github:
23+
mode: gh-proxy
24+
toolsets: [repos, pull_requests, actions]
25+
bash: ["*"]
26+
edit: true
27+
network:
28+
allowed:
29+
- defaults
30+
- github
31+
- github-actions
32+
- rust
33+
- bazel
34+
- python
35+
steps:
36+
- name: Configure Git
37+
run: |
38+
git config user.name "github-actions[bot]"
39+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
40+
41+
- name: Install cargo-edit
42+
continue-on-error: true
43+
run: cargo install cargo-edit@0.13.0 --locked
44+
45+
- name: Run rust-analyzer updater script
46+
run: |
47+
mkdir -p /tmp/gh-aw/agent
48+
set +e
49+
python3 rust/scripts/update_rust_analyzer.py \
50+
2>&1 | tee /tmp/gh-aw/agent/rust-analyzer-update.log
51+
status=${PIPESTATUS[0]}
52+
set -e
53+
54+
printf '%s\n' "$status" > /tmp/gh-aw/agent/rust-analyzer-update-status.txt
55+
if grep -Fxq "No new rust-analyzer version available." \
56+
/tmp/gh-aw/agent/rust-analyzer-update.log; then
57+
printf '%s\n' "no-update" > /tmp/gh-aw/agent/rust-analyzer-update-result.txt
58+
else
59+
printf '%s\n' "update" > /tmp/gh-aw/agent/rust-analyzer-update-result.txt
60+
fi
61+
safe-outputs:
62+
report-incomplete: {}
63+
create-pull-request:
64+
title-prefix: "Rust: "
65+
branch-prefix: "automation/update-rust-analyzer/"
66+
draft: true
67+
max-patch-size: 10240
68+
max-patch-files: 1000
69+
allowed-files:
70+
- "Cargo.lock"
71+
- "shared/tree-sitter-extractor/Cargo.toml"
72+
- "shared/yeast/Cargo.toml"
73+
- "shared/yeast-macros/Cargo.toml"
74+
- "shared/yeast-schema/Cargo.toml"
75+
- "ruby/extractor/Cargo.toml"
76+
- "unified/extractor/Cargo.toml"
77+
- "unified/swift-syntax-rs/Cargo.toml"
78+
# A rust-analyzer update can require a newer Rust toolchain whose Clippy
79+
# lints require compatibility fixes in any of the Rust sources.
80+
# rust-analyzer dependency updates can also update tree-sitter APIs,
81+
# requiring compatibility fixes in the shared extractor implementation.
82+
- "shared/yeast/src/**"
83+
- "shared/yeast-macros/src/**"
84+
- "shared/yeast-schema/src/**"
85+
- "shared/tree-sitter-extractor/src/**"
86+
- "MODULE.bazel"
87+
- "MODULE.bazel.lock"
88+
- "rust-toolchain.toml"
89+
- "rust/**"
90+
- "misc/bazel/3rdparty/**"
91+
---
92+
93+
# Update rust-analyzer
94+
95+
## Task
96+
97+
The workflow has already run `rust/scripts/update_rust_analyzer.py`. Read:
98+
99+
- `/tmp/gh-aw/agent/rust-analyzer-update.log` for its complete output.
100+
- `/tmp/gh-aw/agent/rust-analyzer-update-status.txt` for its exit status.
101+
- `/tmp/gh-aw/agent/rust-analyzer-update-result.txt` for the deterministic result classification.
102+
103+
If the result is `no-update`, call `noop` with the reason
104+
`No new rust-analyzer version available.` and stop immediately. Do not inspect
105+
CI, modify files, or create a pull request.
106+
107+
Otherwise, continue the update from the existing working tree and commits:
108+
109+
1. Read `rust/updating-rust-analyzer.md` and all applicable repository
110+
instructions.
111+
2. Review the updater log, exit status, commits, and working tree. Do not rerun
112+
the updater script.
113+
3. Complete as much of the documented update as possible. Fix extractor or
114+
code-generation breakage, keep all `ra_ap_` dependency versions aligned,
115+
regenerate required files, and add schema upgrade/downgrade scripts, tests,
116+
and a change note when the schema changed.
117+
4. Run the relevant formatting, linting, code generation, build, and tests,
118+
including `bazel run //rust:install`. Use `gh` to inspect relevant existing
119+
CI configuration and prior failures while diagnosing problems.
120+
5. Review the complete diff and commits. Do not include secrets. Do not refer
121+
to private repositories, internal issues, or internal pull requests in the
122+
public pull request.
123+
6. Use `create_pull_request` exactly once to create a focused draft pull
124+
request. Summarize the updater output, changes, and validation. If the
125+
update cannot be finished, still create a partial draft pull request when
126+
there are useful changes, and clearly list failures, missing work, and the
127+
next commands for a maintainer.
128+
129+
The pull request is created after this agent execution, so its newly triggered
130+
CI cannot be awaited in this run. Compensate with the strongest practical
131+
local validation and state this limitation accurately in the pull request.
132+
If the updater did not report `no-update` but no useful patch can be produced,
133+
call `report_incomplete` with the updater failure and exact blocker.
134+
135+
## Safe Outputs
136+
137+
- Use `create_pull_request` for the update or partial update.
138+
- Use `noop` only for the exact no-update result.
139+
- Use `report_incomplete` only when no useful pull request can be created.

‎CONTRIBUTING.md‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,17 @@ If you have an idea for a query that you would like to share with other CodeQL u
1616

1717
1. **Directory structure**
1818

19-
There are eight language-specific query directories in this repository:
19+
There are ten language-specific query directories in this repository:
2020

21+
* Actions: `actions/ql/src`
2122
* C/C++: `cpp/ql/src`
2223
* C#: `csharp/ql/src`
2324
* Go: `go/ql/src`
2425
* Java/Kotlin: `java/ql/src`
2526
* JavaScript: `javascript/ql/src`
2627
* Python: `python/ql/src`
2728
* Ruby: `ruby/ql/src`
29+
* Rust: `rust/ql/src`
2830
* Swift: `swift/ql/src`
2931

3032
Each language-specific directory contains further subdirectories that group queries based on their `@tags` or purpose.
@@ -75,7 +77,3 @@ After the experimental query is merged, we welcome pull requests to improve it.
7577
If you contribute to this project, we will record your name and email address (as provided by you with your contributions) as part of the code repositories, which are public. We might also use this information to contact you in relation to your contributions, as well as in the normal course of software development. We also store records of CLA agreements signed in the past, but no longer require contributors to sign a CLA. Under GDPR legislation, we do this on the basis of our legitimate interest in creating the CodeQL product.
7678

7779
Please do get in touch (privacy@github.com) if you have any questions about this or our data protection policies.
78-
79-
## Bazel
80-
Please notice that any bazel targets and definitions in this repository are currently experimental
81-
and for internal use only.

0 commit comments

Comments
 (0)