Skip to content

Commit e54838c

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into fix/band-storage-mismatch
2 parents 66a3504 + e5a55ef commit e54838c

244 files changed

Lines changed: 10952 additions & 312 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.

.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/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

README.md

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,7 @@ limitations under the License.
1818
1919
-->
2020

21-
<!-- lint disable first-heading-level -->
22-
23-
<!-- FIXME: the following two empty sections are merely to satisfy the linter for `expected-html-sections` which cannot, atm, be turned off -->
24-
25-
<section class="usage">
26-
27-
</section>
28-
29-
<!-- /.usage -->
30-
31-
<section class="examples">
32-
33-
</section>
34-
35-
<!-- /.examples -->
21+
<!-- lint disable first-heading-level expected-html-sections -->
3622

3723
<!-- Section to include announcements. If section is included, add a horizontal rule *after* the section. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
3824

lib/node_modules/@stdlib/_tools/remark/plugins/remark-lint-expected-html-sections/lib/linter.js

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,47 @@ var keys = require( '@stdlib/utils/keys' );
3030
var debug = logger( 'remark-lint-expected-html-sections' );
3131
var RE_SECTION_START = /<section(?:\s+class="([^"]*)")?>/;
3232
var RE_SECTION_END = /<\/section>/;
33+
var RE_HTML_COMMENT = /^\s*<!--[\s\S]*-->\s*$/;
34+
35+
36+
// FUNCTIONS //
37+
38+
/**
39+
* Returns a message anchor node.
40+
*
41+
* @private
42+
* @param {Node} tree - abstract syntax tree (AST)
43+
* @returns {Node} anchor node
44+
*/
45+
function getAnchorNode( tree ) {
46+
var node;
47+
var i;
48+
49+
for ( i = 0; i < tree.children.length; i++ ) {
50+
node = tree.children[ i ];
51+
if ( node.type === 'yaml' ) {
52+
continue;
53+
}
54+
if ( node.type === 'html' && RE_HTML_COMMENT.test( node.value ) ) {
55+
continue;
56+
}
57+
return node;
58+
}
59+
return tree;
60+
}
61+
62+
/**
63+
* Reports a lint message.
64+
*
65+
* @private
66+
* @param {File} file - virtual file
67+
* @param {Node} node - anchor node
68+
* @param {string} msg - message
69+
* @returns {void}
70+
*/
71+
function reportMessage( file, node, msg ) {
72+
file.message( msg, node, 'remark-lint:expected-html-sections' );
73+
}
3374

3475

3576
// MAIN //
@@ -60,6 +101,7 @@ function factory( options ) {
60101
var sectionsFound;
61102
var sectionStack;
62103
var missingRoot;
104+
var anchorNode;
63105
var missingC;
64106
var schema;
65107
var msg;
@@ -78,6 +120,9 @@ function factory( options ) {
78120
'c': {}
79121
};
80122

123+
// Anchor messages to content nodes so inline lint comments can control reporting:
124+
anchorNode = getAnchorNode( tree );
125+
81126
// Visit all HTML nodes to build section structure:
82127
visit( tree, 'html', visitor );
83128

@@ -101,7 +146,7 @@ function factory( options ) {
101146
if ( missingRoot.length > 0 ) {
102147
msg = 'Missing required root-level sections: `' + missingRoot.join( '`, `' ) + '`. Required sections are: `' + requiredRootSections.join( '`, `' ) + '`. missing-required-sections';
103148
debug( msg );
104-
file.message( msg, tree, 'remark-lint:expected-html-sections' );
149+
reportMessage( file, anchorNode, msg );
105150
}
106151

107152
// If 'c' section exists, check its requirements:
@@ -119,7 +164,7 @@ function factory( options ) {
119164
if ( missingC.length > 0 ) {
120165
msg = 'Missing required sections in "c" section: `' + missingC.join( '`, `' ) + '`. Required C sections are: `' + requiredCSections.join( '`, `' ) + '`. missing-required-c-sections';
121166
debug( msg );
122-
file.message( msg, sectionsFound.root.c.node, 'remark-lint:expected-html-sections' );
167+
reportMessage( file, sectionsFound.root.c.node, msg );
123168
}
124169
}
125170

0 commit comments

Comments
 (0)