-
Notifications
You must be signed in to change notification settings - Fork 2
Add diffWithCovers/patchSingleStream APIs, robust loading, full CI matrix #3
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
2b982ef
Add diffWithCovers and patchSingleStream native APIs
sunnylqm 11e41f7
Make native module loading robust and switch to prebuilds-only install
sunnylqm 5b99ef2
Add CI test matrix, Bun compat tests, CLI format auto-detection
sunnylqm f5a0bc5
Address review feedback and fix Windows prebuild
sunnylqm 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
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,115 @@ | ||
| name: CI Failure Issue | ||
|
|
||
| on: | ||
| workflow_run: | ||
| workflows: | ||
| - Publish Package to npmjs | ||
| types: [completed] | ||
|
|
||
| jobs: | ||
| notify: | ||
| if: contains(fromJSON('["failure","timed_out","action_required"]'), github.event.workflow_run.conclusion) | ||
| permissions: | ||
| issues: write | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Create or update failure issue | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| REPOSITORY: ${{ github.repository }} | ||
| WORKFLOW_NAME: ${{ github.event.workflow_run.name }} | ||
| CONCLUSION: ${{ github.event.workflow_run.conclusion }} | ||
| HEAD_BRANCH: ${{ github.event.workflow_run.head_branch }} | ||
| HEAD_SHA: ${{ github.event.workflow_run.head_sha }} | ||
| ACTOR: ${{ github.event.workflow_run.actor.login }} | ||
| RUN_URL: ${{ github.event.workflow_run.html_url }} | ||
| run: | | ||
| reported_at="$(TZ=Asia/Shanghai date '+%Y-%m-%d %H:%M:%S %z')" | ||
| issue_title_prefix="[CI failed] $REPOSITORY / $WORKFLOW_NAME at " | ||
| body_file="$(mktemp)" | ||
| cat > "$body_file" <<EOF | ||
| @sunnylqm CI run failed. | ||
|
|
||
| Repository: $REPOSITORY | ||
| Workflow: $WORKFLOW_NAME | ||
| Conclusion: $CONCLUSION | ||
| Branch: $HEAD_BRANCH | ||
| Commit: $HEAD_SHA | ||
| Actor: $ACTOR | ||
| Reported at: $reported_at | ||
| Run: $RUN_URL | ||
| EOF | ||
|
|
||
| issue_title="$issue_title_prefix$reported_at" | ||
| issue_numbers="$( | ||
| gh issue list \ | ||
| --repo "$REPOSITORY" \ | ||
| --state open \ | ||
| --limit 1000 \ | ||
| --json number,title | | ||
| jq -r --arg prefix "$issue_title_prefix" '.[] | select(.title | startswith($prefix)) | .number' | ||
| )" | ||
|
|
||
| if [ -n "$issue_numbers" ]; then | ||
| while IFS= read -r issue_number; do | ||
| [ -n "$issue_number" ] || continue | ||
| gh issue edit "$issue_number" \ | ||
| --repo "$REPOSITORY" \ | ||
| --title "$issue_title" \ | ||
| --body-file "$body_file" | ||
| done <<< "$issue_numbers" | ||
| exit 0 | ||
| fi | ||
|
|
||
| gh issue create \ | ||
| --repo "$REPOSITORY" \ | ||
| --title "$issue_title" \ | ||
| --body-file "$body_file" | ||
|
|
||
| close: | ||
| if: github.event.workflow_run.conclusion == 'success' | ||
| permissions: | ||
| issues: write | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Close recovered failure issues | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| REPOSITORY: ${{ github.repository }} | ||
| WORKFLOW_NAME: ${{ github.event.workflow_run.name }} | ||
| HEAD_BRANCH: ${{ github.event.workflow_run.head_branch }} | ||
| HEAD_SHA: ${{ github.event.workflow_run.head_sha }} | ||
| RUN_URL: ${{ github.event.workflow_run.html_url }} | ||
| run: | | ||
| issue_title_prefix="[CI failed] $REPOSITORY / $WORKFLOW_NAME at " | ||
| fixed_at="$(TZ=Asia/Shanghai date '+%Y-%m-%d %H:%M:%S %z')" | ||
| issue_numbers="$( | ||
| gh issue list \ | ||
| --repo "$REPOSITORY" \ | ||
| --state open \ | ||
| --limit 1000 \ | ||
| --json number,title | | ||
| jq -r --arg prefix "$issue_title_prefix" '.[] | select(.title | startswith($prefix)) | .number' | ||
| )" | ||
|
|
||
| if [ -z "$issue_numbers" ]; then | ||
| exit 0 | ||
| fi | ||
|
|
||
| comment_body="$(cat <<EOF | ||
| CI recovered at $fixed_at. | ||
|
|
||
| Repository: $REPOSITORY | ||
| Workflow: $WORKFLOW_NAME | ||
| Branch: $HEAD_BRANCH | ||
| Commit: $HEAD_SHA | ||
| Run: $RUN_URL | ||
| EOF | ||
| )" | ||
|
|
||
| while IFS= read -r issue_number; do | ||
| [ -n "$issue_number" ] || continue | ||
| gh issue close "$issue_number" \ | ||
| --repo "$REPOSITORY" \ | ||
| --comment "$comment_body" | ||
| done <<< "$issue_numbers" |
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,36 @@ | ||
| name: Test | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
|
|
||
| jobs: | ||
| test: | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: | ||
| - ubuntu-latest | ||
| - ubuntu-24.04-arm | ||
| - macos-15-intel | ||
| - macos-latest | ||
| - windows-latest | ||
| runs-on: ${{ matrix.os }} | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| with: | ||
| submodules: recursive | ||
| - uses: actions/setup-node@v6 | ||
| with: | ||
| node-version: 24 | ||
| - uses: oven-sh/setup-bun@v2 | ||
| with: | ||
| bun-version: latest | ||
| # bun 在 Windows 上生成 exe shim,而 prebuildify 硬编码 spawn node-gyp.cmd | ||
| - if: runner.os == 'Windows' | ||
| run: npm install -g node-gyp | ||
| - run: bun install --ignore-scripts | ||
| - run: bun run prebuild | ||
| - run: node test/test.js | ||
| - run: bun ./test/test.js |
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
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 |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| [submodule "HDiffPatch"] | ||
| path = HDiffPatch | ||
| url = https://github.com/sisong/HDiffPatch.git | ||
| url = https://github.com/reactnativecn/HDiffPatch.git | ||
| [submodule "lzma"] | ||
| path = lzma | ||
| url = https://github.com/sisong/lzma.git | ||
This file was deleted.
Oops, something went wrong.
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
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.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: reactnativecn/node-hdiffpatch
Length of output: 167
🏁 Script executed:
Repository: reactnativecn/node-hdiffpatch
Length of output: 332
Keep the HDiffPatch submodule on a remote that contains the pinned commit. The fork at
reactnativecn/HDiffPatch.gitdoes not expose4a7eb78aee3bd5acbe6fe55621391685648030d5, so fresh clones and CI submodule updates will fail unless the submodule is repinned to a commit that exists on that remote.🤖 Prompt for AI Agents