Skip to content

Commit e7bfad8

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into ssymv-c
2 parents 1ebc801 + 9861705 commit e7bfad8

File tree

9,759 files changed

+449905
-82694
lines changed

Some content is hidden

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

9,759 files changed

+449905
-82694
lines changed

.github/workflows/pr_commands_comment.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ on:
2929
description: 'Pull request number'
3030
required: true
3131
type: number
32+
debug:
33+
description: 'Enable debug output'
34+
required: false
35+
default: false
36+
type: boolean
3237

3338
# Define the secrets accessible by the workflow:
3439
secrets:
@@ -43,6 +48,14 @@ on:
4348
description: 'Pull request number'
4449
required: true
4550
type: number
51+
debug:
52+
description: 'Enable debug output'
53+
required: false
54+
default: 'false'
55+
type: choice
56+
options:
57+
- 'true'
58+
- 'false'
4659

4760
# Global permissions:
4861
permissions:
@@ -63,11 +76,23 @@ jobs:
6376

6477
# Define the sequence of job steps...
6578
steps:
79+
# Checkout the repository:
80+
- name: 'Checkout repository'
81+
# Pin action to full length commit SHA
82+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
83+
with:
84+
# Ensure we have access to the scripts directory:
85+
sparse-checkout: |
86+
.github/workflows/scripts
87+
sparse-checkout-cone-mode: false
88+
timeout-minutes: 10
6689

6790
# Leave comment with package make command instructions:
6891
- name: 'Leave comment with package make command instructions'
6992
env:
7093
PR_NUMBER: ${{ inputs.pull_request_number }}
94+
GITHUB_TOKEN: ${{ secrets.STDLIB_BOT_GITHUB_TOKEN || secrets.STDLIB_BOT_PAT_REPO_WRITE }}
95+
DEBUG: ${{ inputs.debug || 'false' }}
7196
run: |
7297
. "$GITHUB_WORKSPACE/.github/workflows/scripts/package_commands_comment" "$PR_NUMBER"
7398
timeout-minutes: 30

.github/workflows/run_affected_benchmarks.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,12 @@ jobs:
5050

5151
# Define a job for running changed benchmarks...
5252
process:
53-
5453
# Define a display name:
5554
name: 'Run affected benchmarks'
5655

56+
# Only run this job if a pull request does not have a "ci: Skip" label:
57+
if: "${{ github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'ci: Skip') }}"
58+
5759
# Define the type of virtual host machine:
5860
runs-on: ubuntu-latest
5961

.github/workflows/run_affected_examples.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ jobs:
5151
# Define a display name:
5252
name: 'Run changed examples'
5353

54+
# Only run this job if a pull request does not have a "ci: Skip" label:
55+
if: "${{ github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'ci: Skip') }}"
56+
5457
# Define the type of virtual host machine:
5558
runs-on: ubuntu-latest
5659

.github/workflows/run_affected_tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ jobs:
8686
# Define a display name:
8787
name: 'Run affected tests'
8888

89+
# Only run this job if a pull request does not have a "ci: Skip" label:
90+
if: "${{ github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'ci: Skip') }}"
91+
8992
# Define the type of virtual host machine:
9093
runs-on: ubuntu-latest
9194

.github/workflows/run_tests_coverage.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ jobs:
8686
# Define a display name:
8787
name: 'Calculate test coverage for packages'
8888

89+
# Only run this job if a pull request does not have a "ci: Skip" label:
90+
if: "${{ github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'ci: Skip') }}"
91+
8992
# Define the type of virtual host machine:
9093
runs-on: ubuntu-latest
9194

.github/workflows/scripts/lint_package_json_files

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,30 @@ root=$(git rev-parse --show-toplevel)
3232
# Define the path to a utility for linting package.json files:
3333
lint_package_json="${root}/lib/node_modules/@stdlib/_tools/lint/pkg-json/bin/cli"
3434

35+
# Define the path to the package name validation tool:
36+
validate_package_names="${root}/lib/node_modules/@stdlib/_tools/lint/pkg-json-names/bin/cli"
37+
3538
# Define paths to utilities for updating package.json metadata fields:
3639
update_package_json_directories="${root}/lib/node_modules/@stdlib/_tools/package-json/scripts/update_directories"
3740
update_package_json_gypfile="${root}/lib/node_modules/@stdlib/_tools/package-json/scripts/update_gypfile"
3841

3942
# Files to process:
4043
files_to_process="$*"
4144

45+
# Initialize needs_changes flag:
46+
needs_changes=0
47+
4248
# Lint package.json files:
4349
files=$(echo "${files_to_process}" | tr ' ' '\n' | grep 'package\.json$' | grep -v 'datapackage\.json$' | tr '\n' ' ' | sed 's/ $//')
4450
if [ -n "${files}" ]; then
4551
echo "Linting package.json files..."
4652
printf '%s' "${files}" | "${lint_package_json}" --split=" "
53+
54+
echo "Validating package names..."
55+
if ! printf '%s' "${files}" | "${validate_package_names}" --split=" "; then
56+
echo "ERROR: Package name validation failed"
57+
needs_changes=1
58+
fi
4759
else
4860
echo "No package.json files to lint."
4961
fi
@@ -55,8 +67,6 @@ dirs=$(echo "${files_to_process}" | tr ' ' '\n' | \
5567
sort -u)
5668

5769
echo "Checking package.json files in directories: ${dirs}"
58-
59-
needs_changes=0
6070
for dir in ${dirs}; do
6171
echo "Checking package.json in ${dir}..."
6272
package_json="${dir}/package.json"

.github/workflows/scripts/package_commands_comment

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
# Environment variables:
2828
#
2929
# GITHUB_TOKEN GitHub token for authentication.
30+
# DEBUG Whether to enable verbose debug output. Default: `false`.
3031

3132
# Ensure that the exit status of pipelines is non-zero in the event that at least one of the commands in a pipeline fails:
3233
set -o pipefail
@@ -44,9 +45,22 @@ github_api_url="https://api.github.com"
4445
repo_owner="stdlib-js"
4546
repo_name="stdlib"
4647

48+
# Set debug mode:
49+
debug="${DEBUG:-false}"
50+
4751

4852
# FUNCTIONS #
4953

54+
# Prints debug messages if DEBUG environment variable is set to "true".
55+
#
56+
# $1 - debug message
57+
debug_log() {
58+
# Only print debug messages if DEBUG environment variable is set to "true":
59+
if [ "$debug" = true ]; then
60+
echo "[DEBUG] $1" >&2
61+
fi
62+
}
63+
5064
# Error handler.
5165
#
5266
# $1 - error status
@@ -70,6 +84,8 @@ github_api() {
7084
local endpoint="$2"
7185
local data="$3"
7286

87+
debug_log "Making API request: ${method} ${endpoint}"
88+
7389
# Initialize an array to hold curl headers:
7490
local headers=()
7591

@@ -117,12 +133,20 @@ main() {
117133
on_error 1
118134
fi
119135

136+
debug_log "Processing PR #${pr_number}"
137+
120138
# Fetch changed files in pull request:
121139
response=$(github_api "GET" "/repos/${repo_owner}/${repo_name}/pulls/${pr_number}/files?per_page=100")
122140
files=$(echo "${response}" | jq -r '.[] | .filename')
141+
debug_log "Found $(echo "${files}" | wc -l) changed files"
123142

124143
# Extract files associated with native add-ons:
125-
c_files=$(echo "${files}" | grep -e '/benchmark/c' -e '/examples/c' -e '/binding.gyp' -e '/include.gypi' -e '/src/')
144+
c_files=$(echo "${files}" | grep -e '/benchmark/c' -e '/examples/c' -e '/binding.gyp' -e '/include.gypi' -e '/src/' || true)
145+
if [[ -z "${c_files}" ]]; then
146+
debug_log "No native add-on files found"
147+
else
148+
debug_log "Found native add-on files: $(echo "${c_files}" | wc -l) files"
149+
fi
126150

127151
# Find unique package directories:
128152
directories=$(echo "${files}" | tr ' ' '\n' | \
@@ -133,6 +157,7 @@ main() {
133157

134158
# Extract package names from changed package directories (e.g., @stdlib/math/base/special/sin) by removing the leading 'lib/node_modules/':
135159
packages=$(echo "${directories}" | sed -E 's/^lib\/node_modules\///')
160+
debug_log "Found packages: $(echo "${packages}" | tr '\n' ' ')"
136161

137162
# Documentation links:
138163
docs_links="
@@ -148,9 +173,11 @@ main() {
148173

149174
# Count the number of packages:
150175
package_count=$(echo "${packages}" | wc -l)
176+
debug_log "Package count: ${package_count}"
151177

152178
if [[ $package_count -gt 1 ]]; then
153179
# Multiple packages case:
180+
debug_log "Multiple packages detected, generating multi-package comment"
154181
comment="Hello! 👋
155182
156183
Pro-tip: This PR changes multiple packages. You can use various \`make\` rules with \`*_FILTER\` environment variables to run tests, benchmarks, and examples for specific packages.
@@ -174,7 +201,9 @@ ${docs_links}"
174201

175202
else
176203
# Single package case:
177-
if [[ "${#c_files[@]}" -eq 0 ]]; then
204+
debug_log "Single package detected: ${packages}"
205+
if [[ -z "${c_files}" ]]; then
206+
debug_log "No C files found, generating JS-only comment"
178207
comment="Hello! 👋
179208
180209
Pro-tip: Use the \`make\` commands below during local development to ensure that all tests, examples, and benchmark files in your PR run successfully.
@@ -200,6 +229,7 @@ make examples EXAMPLES_FILTER=\".*/${packages}/.*\"
200229
\`\`\`
201230
${docs_links}"
202231
else
232+
debug_log "C files found, generating native addon comment"
203233
comment="Hello! 👋
204234
205235
Pro-tip: Use the \`make\` below commands during local development to ensure that all tests, examples, and benchmark files in your PR run successfully.
@@ -241,10 +271,12 @@ ${docs_links}"
241271
fi
242272
fi
243273

274+
debug_log "Posting comment on PR #${pr_number}"
244275
if ! github_api "POST" "/repos/${repo_owner}/${repo_name}/issues/${pr_number}/comments" "{\"body\":$(echo "${comment}" | jq -R -s -c .)}"; then
245276
echo "Failed to post comment on PR."
246277
on_error 1
247278
fi
279+
debug_log "Successfully posted comment on PR #${pr_number}"
248280

249281
print_success
250282
exit 0

.github/workflows/windows_test_npm_install.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ jobs:
155155
# Install MSYS2:
156156
- name: 'Install MSYS2'
157157
# Pin action to full length commit SHA
158-
uses: msys2/setup-msys2@61f9e5e925871ba6c9e3e8da24ede83ea27fa91f # v2.27.0
158+
uses: msys2/setup-msys2@40677d36a502eb2cf0fb808cc9dec31bf6152638 # v2.28.0
159159
with:
160160
# Set the MSYS system:
161161
msystem: MINGW64
@@ -245,7 +245,7 @@ jobs:
245245
# Install Windows build tools for compiling Node.js native add-ons.
246246
- name: 'Install Windows build tools'
247247
# Pin action to full length commit SHA
248-
uses: crazy-max/ghaction-chocolatey@6828f16489ec8d2968b55066766cb41f0d278f2a # v3.3.0
248+
uses: crazy-max/ghaction-chocolatey@2526f467ccbd337d307fe179959cabbeca0bc8c0 # v3.4.0
249249
with:
250250
args: install -y visualstudio2019buildtools visualstudio2019-workload-vctools
251251
timeout-minutes: 10

CONTRIBUTORS

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ Abdelrahman Samir <[email protected]>
99
Abdul Kaium <[email protected]>
1010
Abhay Punia <[email protected]>
1111
Abhijit Raut <[email protected]>
12+
Abhishek G <[email protected]>
1213
Abhishek Jain <[email protected]>
1314
Adarsh Palaskar <[email protected]>
1415
Aditya Sapra <[email protected]>
16+
Aditya Singh <[email protected]>
1517
Ahmed Atwa <[email protected]>
1618
Ahmed Kashkoush <[email protected]>
1719
Ahmed Khaled <[email protected]>
@@ -23,13 +25,16 @@ Aman Bhansali <[email protected]>
2325
AmanBhadkariya <[email protected]>
2426
Amisha Chhajed <[email protected]>
2527
Amit Jimiwal <[email protected]>
28+
Anmol Sah <[email protected]>
2629
Annamalai Prabu <[email protected]>
2730
Anshu Kumar <[email protected]>
2831
Anshu Kumar <[email protected]>
2932
Anudeep Sanapala <[email protected]>
3033
Arihant Pal <[email protected]>
3134
Aryan Bhirud <[email protected]>
35+
3236
Athan Reines <[email protected]>
37+
Atharva Patil <[email protected]>
3338
3439
Bhavishy Agrawal <[email protected]>
3540
Brendan Graetz <[email protected]>
@@ -44,6 +49,7 @@ Daniel Yu <[email protected]>
4449
Debashis Maharana <[email protected]>
4550
Deep Trivedi <[email protected]>
4651
Deepak Singh <[email protected]>
52+
Deepak Singh <[email protected]>
4753
Desh Deepak Kant <[email protected]>
4854
4955
Dhanyabad behera <[email protected]>
@@ -61,6 +67,7 @@ GURU PRASAD SHARMA <[email protected]>
6167
6268
Gautam Kaushik <[email protected]>
6369
Gautam sharma <[email protected]>
70+
6471
Girish Garg <[email protected]>
6572
Golden Kumar <[email protected]>
6673
Gunj Joshi <[email protected]>
@@ -114,6 +121,8 @@ Momtchil Momtchev <[email protected]>
114121
Muhammad Haris <[email protected]>
115122
Muhammad Taaha Tariq <[email protected]>
116123
Muhmmad Saad <[email protected]>
124+
NEEKUorAAYUSH <[email protected]>
125+
Nakul Krishnakumar <[email protected]>
117126
Naresh Jagadeesan <[email protected]>
118127
Naveen Kumar <[email protected]>
119128
Neeraj Pathak <[email protected]>
@@ -128,6 +137,7 @@ Oneday12323 <[email protected]>
128137
Ori Miles <[email protected]>
129138
Philipp Burckhardt <[email protected]>
130139
Pierre Forstmann <[email protected]>
140+
Pradyumn Prasad <[email protected]>
131141
Prajjwal Bajpai <[email protected]>
132142
Prajwal Kulkarni <[email protected]>
133143
Pranav Goswami <[email protected]>
@@ -156,25 +166,30 @@ Ruthwik Chikoti <[email protected]>
156166
Ryan Seal <[email protected]>
157167
Rylan Yang <[email protected]>
158168
SAHIL KUMAR <[email protected]>
169+
SAUJANYA MAGARDE <[email protected]>
159170
SHIVAM YADAV <[email protected]>
160171
Sachin Raj <[email protected]>
161172
Sahil Goyal <[email protected]>
162173
Sai Avinash <[email protected]>
163174
Sai Srikar Dumpeti <[email protected]>
164175
Sanchay Ketan Sinha <[email protected]>
165176
Sarthak Paandey <[email protected]>
177+
Satyajeet Chavan <[email protected]>
166178
Saurabh Singh <[email protected]>
167179
Seyyed Parsa Neshaei <[email protected]>
168180
Shabareesh Shetty <[email protected]>
169181
Shashank Shekhar Singh <[email protected]>
170182
Shivam Ahir <[email protected]>
183+
171184
Shraddheya Shendre <[email protected]>
172185
Shubh Mehta <[email protected]>
173186
Shubham Mishra <[email protected]>
187+
Siddhesh waje <[email protected]>
174188
Sivam Das <[email protected]>
175189
Snehil Shah <[email protected]>
176190
Soumajit Chatterjee <[email protected]>
177191
Spandan Barve <[email protected]>
192+
Srinivas Batthula <[email protected]>
178193
Stephannie Jiménez Gacha <[email protected]>
179194
Suhaib Ilahi <[email protected]>
180195
Suraj Kumar <[email protected]>
@@ -190,10 +205,12 @@ Utkarsh <http://[email protected]>
190205
Utkarsh Raj <[email protected]>
191206
UtkershBasnet <[email protected]>
192207
Vaibhav Patel <[email protected]>
208+
Vansh Choudhary <[email protected]>
193209
Vara Rahul Rajana <[email protected]>
194210
Varad Gupta <[email protected]>
195211
Vinit Pandit <[email protected]>
196212
Vivek Maurya <[email protected]>
213+
Wendy Yuchen Sun <[email protected]>
197214
Xiaochuan Ye <[email protected]>
198215
Yaswanth Kosuru <[email protected]>
199216
Yernar Yergaziyev <[email protected]>
2.76 MB
Loading

0 commit comments

Comments
 (0)