Skip to content

Commit f37e2f1

Browse files
authored
Merge branch 'develop' into feat/stats/base/dists/poisson/entropy-c-port
2 parents efe1859 + d479058 commit f37e2f1

File tree

2,589 files changed

+137550
-7265
lines changed

Some content is hidden

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

2,589 files changed

+137550
-7265
lines changed

.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,15 @@ indent_style = tab
165165
indent_style = space
166166
indent_size = 2
167167
168+
# Ignore generated lock files for GitHub Agentic Workflows:
169+
[*.lock.yml]
170+
charset = unset
171+
end_of_line = unset
172+
indent_style = unset
173+
indent_size = unset
174+
trim_trailing_whitespace = unset
175+
insert_final_newline = unset
176+
168177
# Set properties for GYP files:
169178
[binding.gyp]
170179
indent_style = space

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,5 @@ Makefile linguist-vendored
6464

6565
# Configure files which should be included in GitHub language statistics:
6666
docs/types/*.d.ts -linguist-documentation
67+
68+
.github/workflows/*.lock.yml linguist-generated=true merge=ours

.github/aw/actions-lock.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"entries": {
3+
"actions/github-script@v8": {
4+
"repo": "actions/github-script",
5+
"version": "v8",
6+
"sha": "ed597411d8f924073f98dfc5c65a23a2325f34cd"
7+
},
8+
"github/gh-aw-actions/setup@v0.61.2": {
9+
"repo": "github/gh-aw-actions/setup",
10+
"version": "v0.61.2",
11+
"sha": "71cfb3cbe2002225f9d5afa180669fff36b86ea2"
12+
}
13+
}
14+
}

.github/workflows/check_pr_issue_references.lock.yml

Lines changed: 1001 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
---
2+
description: >
3+
Checks whether issue/PR references in a PR body are actually related to the PR.
4+
Posts an informational comment when suspicious references are detected.
5+
6+
run-name: check_pr_issue_references
7+
8+
on:
9+
schedule: every 6h
10+
workflow_dispatch:
11+
inputs:
12+
pr_numbers:
13+
description: 'Comma-separated PR numbers to check (leave empty to auto-discover recent PRs)'
14+
required: false
15+
type: string
16+
17+
permissions:
18+
contents: read
19+
issues: read
20+
pull-requests: read
21+
22+
engine:
23+
id: copilot
24+
25+
tools:
26+
github:
27+
toolsets: [issues, pull_requests, repos]
28+
lockdown: false
29+
min-integrity: none
30+
repos: all
31+
32+
network:
33+
allowed:
34+
- defaults
35+
36+
safe-outputs:
37+
add-comment:
38+
max: 10
39+
noop:
40+
max: 10
41+
42+
timeout-minutes: 10
43+
---
44+
45+
# Check PR Issue References
46+
47+
You are a reference validator for the stdlib-js/stdlib repository. Your task is
48+
to check whether issue/PR references in pull request descriptions are actually
49+
related to the PRs.
50+
51+
## Step 1: Discover PRs to Check
52+
53+
If `${{ github.event.inputs.pr_numbers }}` is provided, parse it as a
54+
comma-separated list of PR numbers and fetch those PRs.
55+
56+
Otherwise, use the GitHub tool to list open pull requests in `stdlib-js/stdlib`,
57+
sorted by `updated` in descending order. Filter to PRs whose `updated_at` is
58+
within the last 7 hours. If no PRs match, call `noop` with "No recently updated
59+
PRs found" and stop.
60+
61+
Process at most 10 PRs per run.
62+
63+
## Step 2: Check for Existing Comments (Deduplication)
64+
65+
For each PR, before analyzing it:
66+
67+
1. List comments on the PR using the GitHub tool.
68+
2. If any comment body contains the heading `**Issue Reference Review**`, this
69+
PR was already checked. Skip it and call `noop` with "PR #X already has an
70+
Issue Reference Review comment. Skipping."
71+
3. If no such comment exists, proceed to Step 3.
72+
73+
## Step 3: Extract and Assess References
74+
75+
For each PR that passes deduplication:
76+
77+
1. **Extract all issue/PR references** from the PR body. Look for:
78+
- `#123` (bare references)
79+
- `stdlib-js/stdlib#123` (qualified references)
80+
- `https://github.com/stdlib-js/stdlib/issues/123` (URL references)
81+
- Pay special attention to closing keywords: Resolves, Closes, Fixes (and variants)
82+
83+
2. **For each referenced issue/PR**, fetch its title and body using the GitHub tool.
84+
85+
3. **Assess whether each reference is plausibly related** to the pull request:
86+
- **related**: Clear topical connection (same package, same feature area, PR addresses the issue)
87+
- **suspicious**: Connection is unclear or tenuous
88+
- **unrelated**: Completely different topics, packages, or feature areas
89+
90+
## Assessment Guidelines
91+
92+
- stdlib is a large numerical/scientific computing library with thousands of packages
93+
(e.g., `@stdlib/math/base/special/sin`, `@stdlib/stats/incr/mean`)
94+
- A PR adding a new package often references the issue that requested it — this is VALID
95+
- A PR fixing tests/benchmarks/docs for a package may reference the original creation issue — VALID
96+
- References to "Tracking Issues" (issues listing many sub-tasks) are usually VALID
97+
- PRs may reference broad project-wide issues — give benefit of the doubt
98+
- **When in doubt, lean toward "related".** False positives are worse than false negatives.
99+
- If a PR has no issue references at all, that is fine — call noop.
100+
- If a PR has more than 10 references, call noop (too many to meaningfully assess).
101+
102+
## Safe Outputs
103+
104+
When calling `add-comment`, you **MUST** set the `item_number` parameter to the
105+
PR number so the comment is posted on the correct PR.
106+
107+
- **If ALL references appear related** (or there are no references): Call `noop` with a
108+
brief explanation like "All N issue references in PR #X appear related."
109+
110+
- **If any references appear suspicious or unrelated**: Use `add-comment` to post a
111+
comment on the PR:
112+
113+
> ⚠️ **Issue Reference Review**
114+
>
115+
> An automated check found potentially unrelated issue/PR references in this PR:
116+
>
117+
> | Reference | Assessment | Reasoning |
118+
> | --- | --- | --- |
119+
> | #123 | suspicious | PR adds math/sin but issue is about string/trim |
120+
>
121+
> **Why this matters:** GitHub automatically closes issues referenced with closing
122+
> keywords (Resolves, Closes, Fixes) when the PR is merged. Incorrect references
123+
> can accidentally close unrelated issues.
124+
>
125+
> **What to do:**
126+
> - If the reference is correct, no action needed. This check may produce false positives.
127+
> - If the reference is incorrect, please update your PR description.
128+
>
129+
> *This assessment was generated by an AI model and is informational only.*
130+
131+
Only include suspicious/unrelated references in the table, not related ones.
132+
133+
## Important Notes
134+
135+
- Process each PR independently. A failure on one PR should not prevent checking others.
136+
- A `noop` call is expected for each PR that is skipped or has all-valid references.

.github/workflows/lint_changed_files.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ jobs:
147147
- name: 'Lint Markdown files'
148148
if: success() || failure()
149149
run: |
150-
files=$(echo "${{ steps.changed-files.outputs.files }}" | tr ' ' '\n' | grep -E '\.md$' | tr '\n' ' ' | sed 's/ $//')
150+
files=$(echo "${{ steps.changed-files.outputs.files }}" | tr ' ' '\n' | grep -E '\.md$' | grep -v '^\.github/workflows/.*\.md$' | tr '\n' ' ' | sed 's/ $//')
151151
if [ -n "${files}" ]; then
152152
make lint-markdown-files FILES="${files}"
153153
fi
@@ -345,7 +345,7 @@ jobs:
345345
- name: 'Lint license headers'
346346
if: success() || failure()
347347
run: |
348-
files=$(echo "${{ steps.changed-files.outputs.files }}")
348+
files=$(echo "${{ steps.changed-files.outputs.files }}" | tr ' ' '\n' | grep -v '\.github/workflows/.*\.md$' | grep -v '\.lock\.yml$' | tr '\n' ' ' | sed 's/ $//')
349349
if [[ -n "${files}" ]]; then
350350
make lint-license-headers-files FILES="${files}"
351351
fi

.github/workflows/run_tests_coverage.yml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,8 @@ jobs:
228228
# Specify whether to remove untracked files before checking out the repository:
229229
clean: false
230230

231-
# Limit clone depth to the most recent commit:
232-
fetch-depth: 1
231+
# Fetch extra history so `git pull --rebase` can find a common ancestor:
232+
fetch-depth: 20
233233

234234
# Token for accessing the repository:
235235
token: ${{ secrets.STDLIB_BOT_FGPAT_REPO_READ }}
@@ -282,4 +282,22 @@ jobs:
282282
git config --local user.name "stdlib-bot"
283283
git add .
284284
git commit -m "Update artifacts" || exit 0
285-
git push "https://$USER_NAME:$REPO_GITHUB_TOKEN@github.com/stdlib-js/www-test-code-coverage.git" main
285+
286+
REMOTE_URL="https://$USER_NAME:$REPO_GITHUB_TOKEN@github.com/stdlib-js/www-test-code-coverage.git"
287+
MAX_ATTEMPTS=5
288+
for i in $(seq 1 $MAX_ATTEMPTS); do
289+
if git push "$REMOTE_URL" main; then
290+
echo "Push succeeded on attempt $i."
291+
break
292+
fi
293+
if [ "$i" -eq "$MAX_ATTEMPTS" ]; then
294+
echo "Push failed after $MAX_ATTEMPTS attempts."
295+
exit 1
296+
fi
297+
echo "Push failed on attempt $i. Pulling and retrying..."
298+
git pull --rebase "$REMOTE_URL" main || {
299+
echo "Rebase failed due to conflict. Falling back to merge..."
300+
git rebase --abort
301+
git pull --no-rebase "$REMOTE_URL" main
302+
}
303+
done

.github/workflows/scripts/run_affected_benchmarks/run

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
# LOG_FILE Log file.
3131
#
3232

33-
# shellcheck disable=SC2034,SC2153,SC2317
33+
# shellcheck disable=SC2034,SC2086,SC2153,SC2317
3434

3535
# Ensure that the exit status of pipelines is non-zero in the event that at least one of the commands in a pipeline fails:
3636
set -o pipefail
@@ -141,7 +141,8 @@ main() {
141141

142142
# Run JS benchmarks:
143143
if [ -n "${js_bench_files}" ]; then
144-
make benchmark-javascript-files FILES="${js_bench_files}"
144+
# Invoke make in batches to avoid "Argument list too long" errors:
145+
printf '%s\n' ${js_bench_files} | xargs sh -c 'make benchmark-javascript-files FILES="$*"' _
145146
else
146147
echo 'No JavaScript benchmarks to run.' >&2
147148
fi
@@ -172,7 +173,8 @@ main() {
172173
fi
173174

174175
if [ -n "${c_bench_files}" ]; then
175-
make benchmark-c-files FILES="${c_bench_files}"
176+
# Invoke make in batches to avoid "Argument list too long" errors:
177+
printf '%s\n' ${c_bench_files} | xargs sh -c 'make benchmark-c-files FILES="$*"' _
176178
else
177179
echo 'No C benchmarks to run.' >&2
178180
fi

.github/workflows/scripts/run_affected_tests/run

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,8 @@ main() {
165165
files=$(echo "${files}" | grep -v '/fixtures/') || true
166166

167167
if [[ -n "${files}" ]]; then
168-
make test-javascript-files-min FILES="${files}"
168+
# Invoke make in batches to avoid "Argument list too long" errors:
169+
printf '%s\n' ${files} | xargs sh -c 'make test-javascript-files-min FILES="$*"' _
169170
fi
170171

171172
cleanup

.github/workflows/standalone_keepalive.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ name: standalone_keepalive
2121

2222
# Workflow triggers:
2323
on:
24-
# Run the workflow on the first day of each week:
24+
# Run the workflow daily:
2525
schedule:
26-
- cron: '0 0 * * 1'
26+
- cron: '0 2 * * *'
2727

2828
# Allow the workflow to be manually run:
2929
workflow_dispatch:

0 commit comments

Comments
 (0)