-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
build: add workflow to detect missing function database entries #9629
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
gunjjoshi
wants to merge
1
commit into
stdlib-js:develop
Choose a base branch
from
gunjjoshi:missing_func_db_entries
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+131
−0
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
85 changes: 85 additions & 0 deletions
85
.github/workflows/check_missing_function_database_entries.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| #/ | ||
| # @license Apache-2.0 | ||
| # | ||
| # Copyright (c) 2026 The Stdlib Authors. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| #/ | ||
|
|
||
| # Workflow name: | ||
| name: check_missing_function_database_entries | ||
|
|
||
| # Workflow triggers: | ||
| on: | ||
| schedule: | ||
| # Run the workflow every week on Sunday at 00:00 UTC: | ||
| - cron: '0 0 * * 0' | ||
|
|
||
| # Allow the workflow to be manually run: | ||
| workflow_dispatch: | ||
|
|
||
| # Global permissions: | ||
| permissions: | ||
| # Allow read-only access to the repository contents: | ||
| contents: read | ||
|
|
||
| # Workflow jobs: | ||
| jobs: | ||
|
|
||
| # Define a job for checking missing function database entries... | ||
| check: | ||
|
|
||
| # Define a display name: | ||
| name: 'Check missing function database entries' | ||
|
|
||
| # Ensure the job does not run on forks: | ||
| if: github.repository == 'stdlib-js/stdlib' | ||
|
|
||
| # Define the type of virtual host machine: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| # Define the sequence of job steps... | ||
| steps: | ||
| # Checkout the repository: | ||
| - name: 'Checkout repository' | ||
| # Pin action to full length commit SHA | ||
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | ||
| with: | ||
| # Specify whether to remove untracked files before checking out the repository: | ||
| clean: true | ||
|
|
||
| # Limit clone depth to the most recent commit: | ||
| fetch-depth: 1 | ||
|
|
||
| # Specify whether to download Git-LFS files: | ||
| lfs: false | ||
| timeout-minutes: 10 | ||
|
|
||
| # Create content of tracking issue for missing function database entries: | ||
| - name: 'Create content of tracking issue for missing function database entries' | ||
| run: | | ||
| . "$GITHUB_WORKSPACE/.github/workflows/scripts/check_missing_function_database_entries/run" > tracking_issue.md | ||
| cat tracking_issue.md >> $GITHUB_STEP_SUMMARY | ||
|
|
||
| # Create or update tracking issue for missing function database entries: | ||
| - name: 'Create or update tracking issue for missing function database entries' | ||
| # Pin action to full length commit SHA | ||
| uses: peter-evans/create-issue-from-file@fca9117c27cdc29c6c4db3b86c48e4115a786710 # v6.0.0 | ||
| with: | ||
| title: 'Missing function database entries' | ||
| content-filepath: ./tracking_issue.md | ||
| # issue-number: TODO | ||
| token: ${{ secrets.STDLIB_BOT_PAT_REPO_WRITE }} | ||
| labels: | | ||
| function-database | ||
| automated-issue | ||
46 changes: 46 additions & 0 deletions
46
.github/workflows/scripts/check_missing_function_database_entries/run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| #!/usr/bin/env bash | ||
| # | ||
| # @license Apache-2.0 | ||
| # | ||
| # Copyright (c) 2026 The Stdlib Authors. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| # Initialize a Markdown-formatted comment body containing missing entries: | ||
| comment="<!-- This comment is automatically generated by a GitHub Action. --> | ||
|
|
||
| # Missing Function Database Entries | ||
|
|
||
| " | ||
|
|
||
| # Check for packages missing from unary_function_database.json: | ||
| database="lib/node_modules/@stdlib/math/special/data/unary_function_database.json" | ||
|
|
||
| for dir in lib/node_modules/@stdlib/math/base/special/*/ \ | ||
| lib/node_modules/@stdlib/number/float64/base/*/ \ | ||
| lib/node_modules/@stdlib/number/float32/base/*/ \ | ||
| lib/node_modules/@stdlib/number/float16/base/*/ \ | ||
| lib/node_modules/@stdlib/complex/float64/base/*/ \ | ||
| lib/node_modules/@stdlib/complex/float32/base/*/ \ | ||
| lib/node_modules/@stdlib/complex/float16/base/*/; do | ||
|
Comment on lines
+29
to
+35
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Keeping the directories as present here: https://github.com/stdlib-js/stdlib/blob/develop/.github/workflows/update_math_scaffold_databases.yml#L28 |
||
| if [ -d "$dir" ]; then | ||
| pkg_path="${dir%/}" | ||
| pkg="@stdlib/${pkg_path#lib/node_modules/@stdlib/}" | ||
| if ! grep -q "\"$pkg\"" "$database"; then | ||
| comment="$comment- \`$pkg\` | ||
| " | ||
| fi | ||
| fi | ||
| done | ||
|
|
||
| echo "$comment" | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I thought here is, that once this workflow opens the issue, we can add that issue number here, and then that issue will keep on getting updated.