Skip to content

Commit d012723

Browse files
authored
Merge branch 'master' into change-output-base
2 parents 3fc97fd + 2ec23f6 commit d012723

File tree

319 files changed

+17822
-11512
lines changed

Some content is hidden

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

319 files changed

+17822
-11512
lines changed

.claude/CLAUDE.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@ After changing Rust code (`*.rs`) follow these steps in order:
88

99
1. **Format** by running the following from the root of the repository:
1010
```
11+
cd "$(git rev-parse --show-toplevel)"
1112
rustfmt <MODIFIED_RUST_FILES>
1213
```
1314
where `<MODIFIED_RUST_FILES>` is a space separated list of paths of all modified Rust files relative to the root of the repository.
1415
2. **Lint** by running the following from the root of the repository:
1516
```
17+
cd "$(git rev-parse --show-toplevel)"
1618
cargo clippy --all-features <CRATES> -- \
1719
-D warnings \
1820
-D clippy::all \
@@ -30,7 +32,8 @@ After changing Rust code (`*.rs`) follow these steps in order:
3032
Fix any linting errors.
3133
3. **Build** the directly affected bazel targets by running the following from the root of the repository:
3234
```
33-
TARGETS="$(bazel query 'kind(rule, rdeps(//..., set(<MODIFIED_FILES>), 1))' --keep_going 2>/dev/null)"
35+
cd "$(git rev-parse --show-toplevel)"
36+
TARGETS="$(bazel query 'kind(rule, rdeps(//..., set(<MODIFIED_FILES>), 1))' --keep_going 2>/dev/null)" || true
3437
if [ -n "$TARGETS" ]; then
3538
bazel build $TARGETS
3639
fi
@@ -40,11 +43,26 @@ After changing Rust code (`*.rs`) follow these steps in order:
4043
Fix all build errors.
4144
4. **Test** the directly affected bazel tests by running the following from the root of the repository:
4245
```
43-
TESTS="$(bazel query 'kind(".*_test|test_suite", kind(rule, rdeps(//..., set(<MODIFIED_FILES>), 2)))' --keep_going 2>/dev/null)"
46+
cd "$(git rev-parse --show-toplevel)"
47+
TESTS="$(bazel query 'kind(".*_test|test_suite", kind(rule, rdeps(//..., set(<MODIFIED_FILES>), 2))) except attr(tags, "manual", //...)' --keep_going 2>/dev/null)" || true
4448
if [ -n "$TESTS" ]; then
4549
bazel test --test_output=errors $TESTS
4650
fi
4751
```
4852
(Use a depth of 2 in `rdeps` because tests usually depend on source files indirectly through a `rust_library` for example).
4953

50-
Fix all test failures.
54+
Always run tests, even if they're system-tests, i.e. their label starts with `//rs/tests/`.
55+
56+
Fix all test failures.
57+
58+
# Pull Requests
59+
60+
When asked to create a PR, always create it in draft mode.
61+
62+
When updating a PR prefer to push new commits to the PR branch instead of force-pushing over the existing commits.
63+
64+
After the PR has been created or updated, request a review from the GitHub Copilot bot using:
65+
```
66+
gh api repos/dfinity/ic/pulls/<PULL_REQUEST_NUMBER>/requested_reviewers --method POST --raw-field 'reviewers[]=copilot-pull-request-reviewer[bot]'
67+
```
68+
where `<PULL_REQUEST_NUMBER>` is the number of the Pull Request.

.claude/skills/fix-flaky-tests/SKILL.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ This guide explains how to find flaky tests to fix and how to debug them. Flaky
6060
6161
3. Analyze the source code of `label` and the logs in `<LOG_DIR>` to determine the root cause of the flakiness.
6262
63+
Ignore failures containing the error:
64+
```
65+
Retried too many times: sending a request to Farm
66+
```
67+
as those are due to infrastructure issues unrelated to the test code.
68+
6369
4. Once you have determined the root cause,
6470
fix the test taking `.claude/CLAUDE.md` into account.
6571
@@ -76,7 +82,12 @@ This guide explains how to find flaky tests to fix and how to debug them. Flaky
7682
and `<date>` with the current date in `YYYY-MM-DD` format,
7783
and commit your fix to that branch.
7884
79-
2. Submit a draft PR using `gh` with the fix.
85+
2. Push the branch to `origin` (assuming it's `git@github.com:dfinity/ic.git`) using:
86+
```
87+
git push --set-upstream origin HEAD
88+
```
89+
90+
3. Submit a draft PR using `gh` with the fix.
8091
Name it: `fix: deflake <label>`.
8192
Include the root cause analysis in the PR description
8293
and mention the PR was created following the steps in `.claude/skills/fix-flaky-tests/SKILL.md`.

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"image": "ghcr.io/dfinity/ic-dev@sha256:fe06783d9cf8e9fc901a5996d9fc8b726f15769f2fd6bd86969d1fbbf77ae025",
2+
"image": "ghcr.io/dfinity/ic-dev@sha256:a98782800df599b3d1501f0da9fbe1dff7a8a401a86c0371eaab7ae0503d3696",
33
"remoteUser": "ubuntu",
44
"privileged": true,
55
"runArgs": [

.github/actions/netrc/action.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ runs:
1414
echo "machine api.github.com login x-access-token password ${{ github.token }}" >> ~/.netrc
1515
echo "Current GitHub API rate limits:"
1616
17-
# Show how close we are to the limits
18-
curl -s --netrc https://api.github.com/rate_limit | \
19-
jq -r '.resources.core | "Rate limit remaining: \(.remaining)/\(.limit) (resets at \(.reset | strftime("%Y-%m-%d %H:%M:%S %Z")))"'
17+
# Show how close we are to the limits (ignore errors from curl or invalid JSON)
18+
curl -sf --netrc https://api.github.com/rate_limit 2>/dev/null | \
19+
jq -r '.resources.core | "Rate limit remaining: \(.remaining)/\(.limit) (resets at \(.reset | strftime("%Y-%m-%d %H:%M:%S %Z")))"' 2>/dev/null \
20+
|| echo "Could not retrieve rate limit information"

.github/workflows/api-bn-recovery-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
runs-on:
2323
labels: dind-large
2424
container:
25-
image: ghcr.io/dfinity/ic-build@sha256:18d23aef1f5e9e7e1eef94c32563f8ed15531ae79065bb00bb5206a643fc49fe
25+
image: ghcr.io/dfinity/ic-build@sha256:0a0cff0b12c7586c2f312c739176924edf0c9e71df92f382eba836913da9f1c6
2626
options: >-
2727
-e NODE_NAME --privileged --cgroupns host
2828
--mount type=tmpfs,target="/home/buildifier/.local/share/containers"

.github/workflows/bazel-dependency-submission.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
push:
55
branches:
66
- 'master'
7-
- 'master-private'
87

98
permissions:
109
contents: write

.github/workflows/ci-kickoff-manual.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ jobs:
5454
commit-sha: ${{ inputs.commit-sha }}
5555
permissions:
5656
contents: read
57+
id-token: write
5758
pull-requests: read
5859

5960
ci-pr-only:

.github/workflows/ci-kickoff.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
branches:
77
- master
88
- 'dev-gh-*'
9+
- 'public-hotfix-*'
910
pull_request:
1011
branches-ignore:
1112
- hotfix-* # This is to ensure that this workflow is not triggered twice on ic-private, as it's already triggered from release-testing
@@ -17,17 +18,18 @@ concurrency:
1718
jobs:
1819
ci-main:
1920
name: CI Main
20-
# if in the ic or ic-private repo:
21-
# run on all events except for forked PRs
21+
# for dfinity/ic: run on all events except for forked PRs
22+
# for dfinity/ic-private: only run on PRs
2223
if: |
23-
contains(fromJson('["dfinity/ic","dfinity/ic-private"]'), github.repository) &&
24-
(github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository)
24+
(github.repository == 'dfinity/ic' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository)) ||
25+
(github.repository == 'dfinity/ic-private' && github.event_name == 'pull_request')
2526
uses: ./.github/workflows/ci-main.yml
2627
secrets: inherit
2728
with:
2829
commit-sha: ${{ github.sha }}
2930
permissions:
3031
contents: read
32+
id-token: write
3133
pull-requests: read
3234

3335
ci-pr-only:

.github/workflows/ci-main.yml

Lines changed: 48 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ on:
1010

1111
permissions:
1212
contents: read
13+
id-token: write
1314
pull-requests: read
1415

1516
env:
@@ -27,7 +28,7 @@ jobs:
2728
labels: dind-large
2829
group: dm2
2930
container: &container-setup
30-
image: ghcr.io/dfinity/ic-build@sha256:18d23aef1f5e9e7e1eef94c32563f8ed15531ae79065bb00bb5206a643fc49fe
31+
image: ghcr.io/dfinity/ic-build@sha256:0a0cff0b12c7586c2f312c739176924edf0c9e71df92f382eba836913da9f1c6
3132
options: >-
3233
-e NODE_NAME --privileged --cgroupns host --mount type=tmpfs,target="/tmp/containers"
3334
timeout-minutes: 90
@@ -38,14 +39,31 @@ jobs:
3839
with:
3940
fetch-depth: ${{ github.event_name == 'pull_request' && 256 || 0 }}
4041
ref: ${{ inputs.commit-sha }}
42+
- name: Filter fuzzer related files
43+
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3
44+
if: github.event_name == 'pull_request'
45+
id: filter
46+
with:
47+
ref: ${{ inputs.commit-sha }}
48+
filters: |
49+
fuzzers:
50+
- ".github/workflows/ci-main.yml"
51+
- "ci/container/TAG"
52+
- "bin/fuzzing/*.sh"
53+
- "**/BUILD.bazel"
54+
- "**/*.bzl"
55+
- "**/*.rs"
4156
- uses: ./.github/actions/netrc
57+
if: github.event_name != 'pull_request' || steps.filter.outputs.fuzzers == 'true'
4258
- name: Run Libfuzzer targets
4359
uses: ./.github/actions/bazel
60+
if: github.event_name != 'pull_request' || steps.filter.outputs.fuzzers == 'true'
4461
with:
4562
invocation-names: libfuzzer
4663
run: ./bin/fuzzing/run-all-fuzzers.sh --libfuzzer 100
4764
- name: Run AFL targets
4865
uses: ./.github/actions/bazel
66+
if: github.event_name != 'pull_request' || steps.filter.outputs.fuzzers == 'true'
4967
with:
5068
invocation-names: afl
5169
run: ./bin/fuzzing/run-all-fuzzers.sh --afl 10
@@ -66,7 +84,7 @@ jobs:
6684
6785
# List of "protected" branches, i.e. branches (not necessarily "protected" in the GitHub sense) where we need
6886
# the full build to occur (including versioning)
69-
protected_branches=("^master$" "^rc--" "^hotfix-" "^master-private$")
87+
protected_branches=("^master$" "^rc--" "^hotfix-" "^public-hotfix-")
7088
for pattern in "${protected_branches[@]}"; do
7189
if [[ "$BRANCH_NAME" =~ $pattern ]]; then
7290
is_protected_branch="true"
@@ -123,7 +141,6 @@ jobs:
123141
skip_buf_checks="false"
124142
fi
125143
126-
127144
echo "| config | value |" >> "$GITHUB_STEP_SUMMARY"
128145
echo "| --- | --- |" >> "$GITHUB_STEP_SUMMARY"
129146
@@ -187,7 +204,7 @@ jobs:
187204
)
188205
if [[ "$CI_EVENT_NAME" == 'merge_group' ]]; then
189206
bazel_args+=( --test_timeout_filters=short,moderate --flaky_test_attempts=3 )
190-
elif [[ $BRANCH_NAME =~ ^hotfix-.* ]]; then
207+
elif [[ $BRANCH_NAME =~ ^(hotfix-|public-hotfix-) ]]; then
191208
bazel_args+=( --test_timeout_filters=short,moderate )
192209
else
193210
bazel_args+=( --keep_going )
@@ -249,12 +266,18 @@ jobs:
249266
bazel_do build
250267
bazel_do test
251268
269+
- name: Configure AWS credentials
270+
uses: aws-actions/configure-aws-credentials@61815dcd50bd041e203e49132bacad1fd04d2708 # v5.1.1
271+
if: needs.config.outputs.release-build == 'true'
272+
with:
273+
role-session-name: "GitHub-Actions_ic_upload-artifacts"
274+
role-to-assume: ${{ vars.AWS_ASSUME_ROLE }}
275+
aws-region: eu-central-1
276+
252277
- name: Upload artifacts
253278
uses: ./.github/actions/upload-artifacts
254279
if: needs.config.outputs.release-build == 'true'
255280
env:
256-
AWS_AWS_ACCESS_KEY_ID: ${{ secrets.AWS_AWS_ACCESS_KEY_ID }}
257-
AWS_AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_AWS_SECRET_ACCESS_KEY }}
258281
CF_AWS_ACCESS_KEY_ID: ${{ secrets.CF_AWS_ACCESS_KEY_ID }}
259282
CF_AWS_SECRET_ACCESS_KEY: ${{ secrets.CF_AWS_SECRET_ACCESS_KEY }}
260283
with:
@@ -314,13 +337,19 @@ jobs:
314337
--test_tag_filters=test_all_platforms \
315338
//...
316339
340+
- name: Configure AWS credentials
341+
uses: aws-actions/configure-aws-credentials@61815dcd50bd041e203e49132bacad1fd04d2708 # v5.1.1
342+
if: needs.config.outputs.release-build == 'true'
343+
with:
344+
role-session-name: "GitHub-Actions_ic_upload-artifacts"
345+
role-to-assume: ${{ vars.AWS_ASSUME_ROLE }}
346+
aws-region: eu-central-1
347+
317348
- name: Upload artifacts
318349
# NOTE: GHA output quirk, 'true' is a string
319350
if: ${{ needs.config.outputs.full_macos_build == 'true' && needs.config.outputs.release-build == 'true' }}
320351
uses: ./.github/actions/upload-artifacts
321352
env:
322-
AWS_AWS_ACCESS_KEY_ID: ${{ secrets.AWS_AWS_ACCESS_KEY_ID }}
323-
AWS_AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_AWS_SECRET_ACCESS_KEY }}
324353
CF_AWS_ACCESS_KEY_ID: ${{ secrets.CF_AWS_ACCESS_KEY_ID }}
325354
CF_AWS_SECRET_ACCESS_KEY: ${{ secrets.CF_AWS_SECRET_ACCESS_KEY }}
326355
with:
@@ -452,11 +481,16 @@ jobs:
452481
453482
echo bundledir="$bundledir" >> "$GITHUB_OUTPUT"
454483
484+
- name: Configure AWS credentials
485+
uses: aws-actions/configure-aws-credentials@61815dcd50bd041e203e49132bacad1fd04d2708 # v5.1.1
486+
with:
487+
role-session-name: "GitHub-Actions_ic_upload-artifacts"
488+
role-to-assume: ${{ vars.AWS_ASSUME_ROLE }}
489+
aws-region: eu-central-1
490+
455491
- name: Upload artifacts
456492
uses: ./.github/actions/upload-artifacts
457493
env:
458-
AWS_AWS_ACCESS_KEY_ID: ${{ secrets.AWS_AWS_ACCESS_KEY_ID }}
459-
AWS_AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_AWS_SECRET_ACCESS_KEY }}
460494
CF_AWS_ACCESS_KEY_ID: ${{ secrets.CF_AWS_ACCESS_KEY_ID }}
461495
CF_AWS_SECRET_ACCESS_KEY: ${{ secrets.CF_AWS_SECRET_ACCESS_KEY }}
462496
with:
@@ -670,7 +704,8 @@ jobs:
670704
contains(github.event.pull_request.labels.*.name, 'CI_RUN_CARGO_JOBS') ||
671705
env.BRANCH_NAME == 'master' ||
672706
startsWith(env.BRANCH_NAME, 'rc--') ||
673-
startsWith(env.BRANCH_NAME, 'hotfix-')
707+
startsWith(env.BRANCH_NAME, 'hotfix-') ||
708+
startsWith(env.BRANCH_NAME, 'public-hotfix-')
674709
shell: bash
675710
run: |
676711
set -eExuo pipefail
@@ -732,6 +767,7 @@ jobs:
732767
steps.filter.outputs.container-run == 'true' ||
733768
env.BRANCH_NAME == 'master' ||
734769
startsWith(env.BRANCH_NAME, 'rc--') ||
735-
startsWith(env.BRANCH_NAME, 'hotfix-')
770+
startsWith(env.BRANCH_NAME, 'hotfix-') ||
771+
startsWith(env.BRANCH_NAME, 'public-hotfix-')
736772
run: |
737773
./ci/container/container-run.sh ${{ matrix.command }}

.github/workflows/ci-pr-only.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
runs-on: &dind-small-setup
3838
labels: dind-small
3939
container: &container-setup
40-
image: ghcr.io/dfinity/ic-build@sha256:18d23aef1f5e9e7e1eef94c32563f8ed15531ae79065bb00bb5206a643fc49fe
40+
image: ghcr.io/dfinity/ic-build@sha256:0a0cff0b12c7586c2f312c739176924edf0c9e71df92f382eba836913da9f1c6
4141
options: >-
4242
-e NODE_NAME --mount type=tmpfs,target="/tmp/containers"
4343
steps:

0 commit comments

Comments
 (0)