Skip to content

Commit 6155b38

Browse files
Merge branch 'stdlib-js:develop' into heavisidef
2 parents c04dde8 + bcc704d commit 6155b38

File tree

589 files changed

+44051
-1162
lines changed

Some content is hidden

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

589 files changed

+44051
-1162
lines changed

.github/labeler.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,7 @@ LAPACK:
2727
Math:
2828
- changed-files:
2929
- any-glob-to-all-files: '**/math/**/*'
30+
31+
Statistics:
32+
- changed-files:
33+
- any-glob-to-all-files: '**/stats/**/*'

.github/workflows/cleanup_coverage.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,19 +59,19 @@ jobs:
5959
script: |
6060
const prNumber = context.payload.pull_request.number;
6161
const { data: comments } = await github.rest.issues.listComments({
62-
owner: context.repo.owner,
63-
repo: context.repo.repo,
64-
issue_number: prNumber,
62+
'owner': context.repo.owner,
63+
'repo': context.repo.repo,
64+
'issue_number': prNumber
6565
});
6666
const coverageComment = comments.find( comment => comment.body && comment.body.includes( '## Coverage Report' ) );
6767
if ( coverageComment ) {
6868
// Replace URLs with plain text in the coverage report comment body:
6969
const updatedBody = coverageComment.body.replace( /<a href="[^"]+">([^<]+)<\/a>/g, '$1' );
7070
await github.rest.issues.updateComment({
71-
owner: context.repo.owner,
72-
repo: context.repo.repo,
73-
comment_id: coverageComment.id,
74-
body: updatedBody,
71+
'owner': context.repo.owner,
72+
'repo': context.repo.repo,
73+
'comment_id': coverageComment.id,
74+
'body': updatedBody
7575
});
7676
} else {
7777
console.log( 'No Coverage Report comment found.' );

.github/workflows/lint_random_files.yml

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -393,15 +393,30 @@ jobs:
393393
env:
394394
GITHUB_TOKEN: ${{ secrets.STDLIB_BOT_GITHUB_TOKEN }}
395395
run: |
396-
# Create a temporary file for storing lint error messages:
397-
ERROR_LOG=$(mktemp)
398-
grep -B 1 -A 2 "style:\|warning:\|error:" <<< "${{ steps.lint-c.outputs.stderr }}" > $ERROR_LOG
399-
400-
. "$GITHUB_WORKSPACE/.github/workflows/scripts/create_lint_sub_issue" \
401-
"${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
402-
"C" \
403-
"3235" \ # Number of C lint error tracking issue
404-
"$ERROR_LOG"
396+
BODY_FILE="$GITHUB_WORKSPACE/lint_issue_body.md"
397+
398+
cat << EOF > "$BODY_FILE"
399+
## C Linting Failures
400+
401+
Linting failures were detected in the automated lint workflow run.
402+
403+
### Workflow Details
404+
- Run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
405+
- Type: C Linting
406+
- Date: $(date -u +"%Y-%m-%d %H:%M:%S UTC")
407+
408+
### Error Details
409+
\`\`\`
410+
$(grep -B 1 -A 2 "style:\|warning:\|error:" <<< "${{ steps.lint-c.outputs.stderr }}")
411+
\`\`\`
412+
EOF
413+
414+
. "$GITHUB_WORKSPACE/.github/workflows/scripts/create_sub_issue" \
415+
'Fix C lint errors' \
416+
"$BODY_FILE" \
417+
"3235" # Number of C lint error tracking issue
418+
419+
rm "$BODY_FILE"
405420
406421
# Lint TypeScript declarations files:
407422
- name: 'Lint TypeScript declarations files'

.github/workflows/run_tests_coverage.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -226,25 +226,25 @@ jobs:
226226
github-token: ${{ secrets.CHATBOT_GITHUB_TOKEN }}
227227
script: |
228228
const { data: comments } = await github.rest.issues.listComments({
229-
issue_number: context.issue.number,
230-
owner: context.repo.owner,
231-
repo: context.repo.repo,
229+
'issue_number': context.issue.number,
230+
'owner': context.repo.owner,
231+
'repo': context.repo.repo,
232232
});
233233
234234
const botComment = comments.find( comment => comment.user.login === 'stdlib-bot' && comment.body.includes( '## Coverage Report' ) );
235235
if ( botComment ) {
236236
await github.rest.issues.updateComment({
237-
owner: context.repo.owner,
238-
repo: context.repo.repo,
239-
comment_id: botComment.id,
240-
body: `${{ steps.create-report.outputs.report }}`,
237+
'owner': context.repo.owner,
238+
'repo': context.repo.repo,
239+
'comment_id': botComment.id,
240+
'body': `${{ steps.create-report.outputs.report }}`
241241
});
242242
} else {
243243
await github.rest.issues.createComment({
244-
issue_number: context.issue.number,
245-
owner: context.repo.owner,
246-
repo: context.repo.repo,
247-
body: `${{ steps.create-report.outputs.report }}`,
244+
'issue_number': context.issue.number,
245+
'owner': context.repo.owner,
246+
'repo': context.repo.repo,
247+
'body': `${{ steps.create-report.outputs.report }}`
248248
});
249249
}
250250
@@ -257,10 +257,10 @@ jobs:
257257
github-token: ${{ secrets.CHATBOT_GITHUB_TOKEN }}
258258
script: |
259259
github.rest.repos.createCommitComment({
260-
commit_sha: context.sha,
261-
owner: context.repo.owner,
262-
repo: context.repo.repo,
263-
body: '${{ steps.create-report.outputs.report }}'
260+
'commit_sha': context.sha,
261+
'owner': context.repo.owner,
262+
'repo': context.repo.repo,
263+
'body': '${{ steps.create-report.outputs.report }}'
264264
})
265265
266266
# Checkout coverage repository:

.github/workflows/scripts/create_lint_sub_issue renamed to .github/workflows/scripts/create_sub_issue

Lines changed: 65 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,16 @@
1616
# See the License for the specific language governing permissions and
1717
# limitations under the License.
1818

19-
# Script to create a sub-issue for linting failures
19+
# Script to create a sub-issue.
2020
#
21-
# Usage: ./create_lint_sub_issue.sh <workflow-url> <lint-type> <parent-issue-number>
21+
# Usage: ./create_sub_issue.sh <issue-title> <body-file> <parent-issue-number> [<labels>]
2222
#
2323
# Arguments:
2424
#
25-
# workflow-url URL of the workflow run.
26-
# lint-type Type of linting failure.
25+
# issue-title Title for the new sub-issue.
26+
# body-file Path to the file containing the issue body.
2727
# parent-issue-number Number of the parent issue.
28-
# error-log-file Path to the error log file.
29-
#
28+
# labels Optional comma-separated list of labels to apply to the new sub-issue.
3029
#
3130
# Environment variables:
3231
#
@@ -41,10 +40,10 @@ set -o pipefail
4140
# VARIABLES #
4241

4342
# Assign command line arguments to variables:
44-
workflow_url="$1"
45-
lint_type="$2"
43+
issue_title="$1"
44+
body_file="$2"
4645
parent_issue_number="$3"
47-
error_log_file="$4"
46+
labels="$4"
4847

4948
# Repository information:
5049
owner="stdlib-js"
@@ -57,28 +56,20 @@ if [ -z "$github_token" ]; then
5756
exit 1
5857
fi
5958

60-
# Read and format the error log
61-
if [ ! -f "$error_log_file" ]; then
62-
echo -e "Error log file not found: ${error_log_file}"
59+
# Read and validate the body file:
60+
if [ ! -f "$body_file" ]; then
61+
echo -e "ERROR: Body file not found: ${body_file}"
6362
exit 1
6463
fi
65-
error_log_content=$(cat "$error_log_file")
66-
67-
# Create issue body with formatted error log
68-
issue_body="## ${lint_type} Linting Failures
69-
70-
Linting failures were detected in the automated lint workflow run.
71-
72-
### Workflow Details
73-
- Run: ${workflow_url}
74-
- Type: ${lint_type} Linting
75-
- Date: $(date -u +"%Y-%m-%d %H:%M:%S UTC")
76-
77-
### Error Details
78-
\`\`\`
79-
${error_log_content}
80-
\`\`\`
81-
"
64+
issue_body=$(cat "$body_file")
65+
66+
# Process labels into an array if provided:
67+
if [ -n "$labels" ]; then
68+
# Convert comma-separated string to JSON array...
69+
label_array="[$(echo "$labels" | sed 's/[[:space:]]*,[[:space:]]*/","/g' | sed 's/.*/"&"/')]"
70+
else
71+
label_array="[]"
72+
fi
8273

8374
# FUNCTIONS #
8475

@@ -114,7 +105,7 @@ EOF
114105
echo "$response" | jq -r '.data.repository.id'
115106
}
116107

117-
# Creates a child issue.
108+
# Creates a child issue with labels.
118109
#
119110
# $1 - repository node ID
120111
# $2 - issue body
@@ -127,11 +118,12 @@ create_child_issue() {
127118
-H "Content-Type: application/json" \
128119
--data @- << EOF
129120
{
130-
"query": "mutation CreateIssue(\$repositoryId: ID!, \$title: String!, \$body: String!) { createIssue(input: {repositoryId: \$repositoryId, title: \$title, body: \$body}) { issue { id number } } }",
121+
"query": "mutation CreateIssue(\$repositoryId: ID!, \$title: String!, \$body: String!, \$labelIds: [ID!]) { createIssue(input: {repositoryId: \$repositoryId, title: \$title, body: \$body, labelIds: \$labelIds}) { issue { id number } } }",
131122
"variables": {
132123
"repositoryId": "${repo_id}",
133-
"title": "Fix ${lint_type} lint errors",
134-
"body": $(echo "$issue_body" | jq -R -s '.')
124+
"title": "${issue_title}",
125+
"body": $(echo "$issue_body" | jq -R -s '.'),
126+
"labelIds": ${label_array}
135127
}
136128
}
137129
EOF
@@ -159,6 +151,37 @@ EOF
159151
echo "$response" | jq -r '.data.repository.issue.id'
160152
}
161153

154+
# Fetches label IDs for given label names.
155+
fetch_label_ids() {
156+
if [ -z "$labels" ]; then
157+
echo "[]"
158+
return
159+
fi
160+
161+
local label_names="${labels//,/\",\"}"
162+
local response
163+
response=$(curl -s -X POST 'https://api.github.com/graphql' \
164+
-H "Authorization: bearer ${github_token}" \
165+
-H "Content-Type: application/json" \
166+
--data @- << EOF
167+
{
168+
"query": "query(\$owner: String!, \$repo: String!) { repository(owner: \$owner, name: \$repo) { labels(first: 100) { nodes { id name } } } }",
169+
"variables": {
170+
"owner": "${owner}",
171+
"repo": "${repo}"
172+
}
173+
}
174+
EOF
175+
)
176+
177+
# Extract and filter label IDs that match our requested labels...
178+
echo "$response" | jq --arg names "${label_names}" '
179+
.data.repository.labels.nodes |
180+
map(select(.name as $n | [$names] | contains([$n]))) |
181+
map(.id)
182+
'
183+
}
184+
162185
# Creates a sub-issue relationship.
163186
#
164187
# $1 - parent issue ID
@@ -194,7 +217,15 @@ main() {
194217
exit 1
195218
fi
196219

197-
echo "Creating child issue for ${lint_type} lint failures..."
220+
if [ -n "$labels" ]; then
221+
echo "Fetching label IDs..."
222+
label_array=$(fetch_label_ids)
223+
if [ "$label_array" = "[]" ]; then
224+
echo -e "Warning: No valid labels found for the provided label names."
225+
fi
226+
fi
227+
228+
echo "Creating child issue..."
198229
child_issue_response=$(create_child_issue "$repo_id" "$issue_body")
199230

200231
child_issue_id=$(echo "$child_issue_response" | jq -r '.data.createIssue.issue.id')

CONTRIBUTORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ UtkershBasnet <[email protected]>
112112
Vaibhav Patel <[email protected]>
113113
Varad Gupta <[email protected]>
114114
Vinit Pandit <[email protected]>
115+
Vivek maurya <[email protected]>
115116
Xiaochuan Ye <[email protected]>
116117
Yaswanth Kosuru <[email protected]>
117118
Yernar Yergaziyev <[email protected]>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
type: filter-packages
3+
exclude:
4+
- blas/base/daxpy
5+
---
Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
[
2-
"name",
3-
"version",
4-
"description",
5-
"license",
6-
"licenses",
7-
"author",
8-
"maintainers",
9-
"contributors",
2+
"name",
3+
"version",
4+
"description",
5+
"license",
6+
"licenses",
7+
"author",
8+
"maintainers",
9+
"contributors",
1010
"funding",
11-
"bin",
12-
"main",
13-
"exports",
14-
"browser",
15-
"unpkg",
16-
"gypfile",
17-
"directories",
18-
"types",
19-
"scripts",
20-
"homepage",
21-
"repository",
22-
"repositories",
23-
"bugs",
24-
"dependencies",
11+
"bin",
12+
"main",
13+
"exports",
14+
"browser",
15+
"unpkg",
16+
"gypfile",
17+
"directories",
18+
"types",
19+
"scripts",
20+
"homepage",
21+
"repository",
22+
"repositories",
23+
"bugs",
24+
"dependencies",
2525
"optionalDependencies",
26-
"devDependencies",
27-
"engines",
28-
"os",
29-
"keywords",
30-
"__stdlib__"
26+
"devDependencies",
27+
"engines",
28+
"os",
29+
"keywords",
30+
"__stdlib__"
3131
]

lib/node_modules/@stdlib/array/base/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ The namespace exports the following:
7777
- <span class="signature">[`bbinary4d( arrays, shapes, fcn )`][@stdlib/array/base/broadcasted-binary4d]</span><span class="delimiter">: </span><span class="description">apply a binary callback to elements in two broadcasted nested input arrays and assign results to elements in a four-dimensional nested output array.</span>
7878
- <span class="signature">[`bbinary5d( arrays, shapes, fcn )`][@stdlib/array/base/broadcasted-binary5d]</span><span class="delimiter">: </span><span class="description">apply a binary callback to elements in two broadcasted nested input arrays and assign results to elements in a five-dimensional nested output array.</span>
7979
- <span class="signature">[`bquaternary2d( arrays, shapes, fcn )`][@stdlib/array/base/broadcasted-quaternary2d]</span><span class="delimiter">: </span><span class="description">apply a quaternary callback to elements in four broadcasted nested input arrays and assign results to elements in a two-dimensional nested output array.</span>
80-
- <span class="signature">[`bquinary2d( arrays, shapes, fcn )`][@stdlib/array/base/broadcasted-quinary2d]</span><span class="delimiter">: </span><span class="description">apply a quinary callback to elements in four broadcasted nested input arrays and assign results to elements in a two-dimensional nested output array.</span>
80+
- <span class="signature">[`bquinary2d( arrays, shapes, fcn )`][@stdlib/array/base/broadcasted-quinary2d]</span><span class="delimiter">: </span><span class="description">apply a quinary callback to elements in five broadcasted nested input arrays and assign results to elements in a two-dimensional nested output array.</span>
8181
- <span class="signature">[`bternary2d( arrays, shapes, fcn )`][@stdlib/array/base/broadcasted-ternary2d]</span><span class="delimiter">: </span><span class="description">apply a ternary callback to elements in three broadcasted nested input arrays and assign results to elements in a two-dimensional nested output array.</span>
8282
- <span class="signature">[`bunary2d( arrays, shapes, fcn )`][@stdlib/array/base/broadcasted-unary2d]</span><span class="delimiter">: </span><span class="description">apply a unary callback to elements in a broadcasted nested input array and assign results to elements in a two-dimensional nested output array.</span>
8383
- <span class="signature">[`bunary3d( arrays, shapes, fcn )`][@stdlib/array/base/broadcasted-unary3d]</span><span class="delimiter">: </span><span class="description">apply a unary callback to elements in a broadcasted nested input array and assign results to elements in a three-dimensional nested output array.</span>

0 commit comments

Comments
 (0)