Commit Graph

752 Commits

Author SHA1 Message Date
robobun
6b3403a2b4 ci: fix update workflows creating duplicate PRs (#26433)
## Summary
- Fixed all `update-*.yml` workflows that were creating duplicate PRs
every week

## Problem
The update workflows (libarchive, zstd, cares, etc.) were using `${{
github.run_number }}` in the branch name, e.g.:
```yaml
branch: deps/update-libarchive-${{ github.run_number }}
```

This caused a new unique branch to be created on every workflow run, so
the `peter-evans/create-pull-request` action couldn't detect existing
PRs and would create duplicates.

**Evidence:** There are currently 8+ open duplicate PRs for libarchive
alone:
- #26432 deps: update libarchive to v3.8.5 (deps/update-libarchive-56)
- #26209 deps: update libarchive to v3.8.5 (deps/update-libarchive-55)
- #25955 deps: update libarchive to v3.8.5 (deps/update-libarchive-54)
- etc.

## Solution
Changed all workflows to use static branch names, e.g.:
```yaml
branch: deps/update-libarchive
```

This allows the action to:
1. Detect if an existing branch/PR already exists
2. Update the existing PR with new changes instead of creating a new one
3. Properly use `delete-branch: true` when the PR is merged

## Files Changed
- `.github/workflows/update-cares.yml`
- `.github/workflows/update-hdrhistogram.yml`
- `.github/workflows/update-highway.yml`
- `.github/workflows/update-libarchive.yml`
- `.github/workflows/update-libdeflate.yml`
- `.github/workflows/update-lolhtml.yml`
- `.github/workflows/update-lshpack.yml`
- `.github/workflows/update-root-certs.yml`
- `.github/workflows/update-sqlite3.yml`
- `.github/workflows/update-vendor.yml`
- `.github/workflows/update-zstd.yml`

## Test plan
- [x] Verified the change is syntactically correct
- [ ] Wait for next scheduled run of any workflow to verify it updates
existing PR instead of creating a new one

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Bot <claude-bot@bun.sh>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 23:53:50 -08:00
Jarred Sumner
4ea1454e4a Delete unused workflow 2025-12-18 12:04:28 -08:00
robobun
69b571da41 Delete claude.yml workflow (#25157) 2025-11-27 12:26:50 -08:00
robobun
123ac9dc2d chore: disable comment-lint and labeled workflows (#25059)
## Summary
- Disable `comment-lint.yml` (C++ linter comment workflow)
- Disable `labeled.yml` (Issue/PR labeled automation workflow)

Workflows are disabled by renaming them to `.yml.disabled`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Bot <claude-bot@bun.sh>
Co-authored-by: Claude <noreply@anthropic.com>
2025-11-24 21:15:57 -08:00
Meghan Denny
d7bf4fb443 ci/format: update bun version (#24693) 2025-11-13 15:00:40 -08:00
Alistair Smith
126f4686af remove outdated docs ci workflows 2025-11-05 11:19:07 -08:00
robobun
88fa296dcd Add GitHub issue deduplication automation (#23926)
## Summary

This PR adds a Claude Code-powered issue deduplication system to help
reduce duplicate issues in the Bun repository.

### What's included:

1. **`/dedupe` slash command** (`.claude/commands/dedupe.md`)
- Claude Code command to find up to 3 duplicate issues for a given
GitHub issue
   - Uses parallel agent searches with diverse keywords
   - Filters out false positives

2. **Automatic dedupe on new issues**
(`.github/workflows/claude-dedupe-issues.yml`)
   - Runs automatically when a new issue is opened
   - Can also be triggered manually via workflow_dispatch
   - Uses the Claude Code base action to run the `/dedupe` command

3. **Auto-close workflow**
(`.github/workflows/auto-close-duplicates.yml`)
   - Runs daily to close issues marked as duplicates after 3 days
   - Only closes if:
     - Issue has a duplicate detection comment from bot
     - Comment is 3+ days old
     - No comments or activity after duplicate comment
     - Author hasn't reacted with 👎 to the duplicate comment

4. **Auto-close script** (`scripts/auto-close-duplicates.ts`)
   - TypeScript script that handles the auto-closing logic
   - Fetches open issues and checks for duplicate markers
   - Closes issues with proper labels and notifications

### How it works:

1. When a new issue is opened, the workflow runs Claude Code to analyze
it
2. Claude searches for duplicates and comments on the issue if any are
found
3. Users have 3 days to respond if they disagree
4. After 3 days with no activity, the issue is automatically closed

### Requirements:

- `ANTHROPIC_API_KEY` secret needs to be set in the repository settings
for the dedupe workflow to run

## Test plan

- [x] Verified workflow files have correct syntax
- [x] Verified script references correct repository (oven-sh/bun)
- [x] Verified slash command matches claude-code implementation
- [ ] Test workflow manually with workflow_dispatch (requires
ANTHROPIC_API_KEY)
- [ ] Monitor initial runs to ensure proper behavior

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Bot <claude-bot@bun.sh>
Co-authored-by: Claude <noreply@anthropic.com>
2025-10-21 14:57:22 -07:00
robobun
25d23201b6 Add crash pattern rules for duplicate issue detection (#23658) 2025-10-14 10:14:52 -07:00
Shlomo
1c84f87b14 chore: update Claude Code Action to stable version (#23515)
### What does this PR do?

Updates the workflow to use the stable Anthropic Claude action.

### How did you verify your code works?
2025-10-11 19:30:19 -07:00
Ciro Spaciari
3c9433f9af fix(sqlite) enable order by and limit in delete/update statements on windows (#23227)
### What does this PR do?

Enable compiler flags
Update SQLite amalgamation using https://www.sqlite.org/download.html
source code
[sqlite-src-3500400.zip](https://www.sqlite.org/2025/sqlite-src-3500400.zip)
with:

```bash
./configure CFLAGS="-DSQLITE_ENABLE_UPDATE_DELETE_LIMIT"
make sqlite3.c
```

This is the same version that before just with this adicional flag that
must be enabled when generating the amalgamation so we are actually able
to use this option. You can also see that without this the build will
happen but the feature will not be enable
https://buildkite.com/bun/bun/builds/27940, as informed in
https://www.sqlite.org/howtocompile.html topic 5.

### How did you verify your code works?
Add in CI two tests that check if the feature is enabled on windows

---------

Co-authored-by: Claude Bot <claude-bot@bun.sh>
Co-authored-by: Claude <noreply@anthropic.com>
2025-10-04 02:48:50 -07:00
Michael H
db2f768bd9 vscode: remove old test runner codelens stuff (#23003)
### What does this PR do?

fix #23001 by removing references to old codelens from before the native
integration which should have its own (better and) native way of
starting

### How did you verify your code works?
2025-09-28 07:45:32 -07:00
Meghan Denny
987cab74d7 ci: add a workflow to auto-update test vendored repos (#22754) 2025-09-18 14:08:44 -07:00
Jarred Sumner
bac13201ae fmt 2025-09-12 17:24:47 -07:00
Jarred Sumner
0a3b9ce701 Smarter auto closing crash issues 2025-09-12 16:42:27 -07:00
robobun
e329316d44 Generate dependency versions header from CMake (#22561)
## Summary

This PR introduces a CMake-generated header file containing all
dependency versions, eliminating the need for C++ code to depend on
Zig-exported version constants.

## Changes

- **New CMake script**: `cmake/tools/GenerateDependencyVersions.cmake`
that:
  - Reads versions from the existing `generated_versions_list.zig` file
- Extracts semantic versions from header files where available
(libdeflate, zlib)
- Generates `bun_dependency_versions.h` with all dependency versions as
compile-time constants
  
- **Updated BunProcess.cpp**:
  - Now includes the CMake-generated `bun_dependency_versions.h`
  - Uses `BUN_VERSION_*` constants instead of `Bun__versions_*` 
  - Removes dependency on Zig-exported version constants

- **Build system updates**:
  - Added `GenerateDependencyVersions` to main CMakeLists.txt
  - Added build directory to include paths in BuildBun.cmake

## Benefits

 Single source of truth for dependency versions
 Versions accessible from C++ without Zig exports
 Automatic regeneration during CMake configuration
 Semantic versions shown where available (e.g., zlib 1.2.8 instead of
commit hash)
 Debug output file for verification

## Test Results

Verified that `process.versions` correctly shows all dependency
versions:

```javascript
$ bun -e "console.log(JSON.stringify(process.versions, null, 2))"
{
  "node": "24.3.0",
  "bun": "1.2.22-debug",
  "boringssl": "29a2cd359458c9384694b75456026e4b57e3e567",
  "libarchive": "898dc8319355b7e985f68a9819f182aaed61b53a",
  "mimalloc": "4c283af60cdae205df5a872530c77e2a6a307d43",
  "webkit": "0ddf6f47af0a9782a354f61e06d7f83d097d9f84",
  "zlib": "1.2.8",
  "libdeflate": "1.24",
  // ... all versions present and correct
}
```

## Generated Files

- `build/debug/bun_dependency_versions.h` - Header file with version
constants
- `build/debug/bun_dependency_versions_debug.txt` - Human-readable
version list

🤖 Generated with [Claude Code](https://claude.ai/code)

---------

Co-authored-by: Claude Bot <claude-bot@bun.sh>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-09-11 19:24:43 -07:00
Alistair Smith
6e9d57a953 Auto assign @alii on anything with types (#22581)
Adds a GitHub workflow to assign me on anything with the `types` label
2025-09-11 14:28:31 -07:00
Jarred Sumner
ed9353f95e gitignore the sources text files (#22408)
### What does this PR do?

### How did you verify your code works?

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-09-04 14:59:35 -07:00
Jarred Sumner
262f8863cb github actions 2025-08-30 20:33:17 -07:00
Jarred Sumner
05f5ea0070 github actions 2025-08-30 19:55:49 -07:00
Jarred Sumner
46ce975175 github actions 2025-08-30 19:43:20 -07:00
Jarred Sumner
fa4822f8b8 github actions 2025-08-30 19:38:22 -07:00
Jarred Sumner
8881e671d4 github actions 2025-08-30 19:35:37 -07:00
Jarred Sumner
97d55411de github actions 2025-08-30 19:30:47 -07:00
Jarred Sumner
f247277375 github actions 2025-08-30 19:27:46 -07:00
pfg
684f7ecd09 Hide private fields in typeInfo (#22228)
ebe0cdac31..e0b7c318f3

It hides it in typeInfo even in the current file, unlike private
declarations which are only hidden in other files.

This allows you to formatted print a type with private fields, but the
private fields are not shown. The alternative would be to allow
accessing private fields through `@field()` but that looked like it was
going to be more complicated (need to add an argument to
structFieldVal/structFieldPtr which are called by fieldVal/fieldPtr
which have 36 callsites)

---------

Co-authored-by: taylor.fish <contact@taylor.fish>
2025-08-29 13:55:51 -07:00
pfg
84604888e9 Private fields (#22189)
ZLS was tested manually and works with private fields (after restarting)

Zig diff:
d1a4e0b0dd..ebe0cdac31

ZLS diff:
15730e8e5d..3733f39c8d

Increases `zig build check` time by maybe 10ms?

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-08-28 04:24:04 -07:00
Jarred Sumner
c0eebd7523 Update auto-label-claude-prs.yml 2025-08-23 19:00:41 -07:00
Jarred Sumner
287c7adf76 github action 2025-08-18 18:10:46 -07:00
Jarred Sumner
0a13653707 github action 2025-08-18 17:13:12 -07:00
Jarred Sumner
a2c252256c github action 2025-08-18 17:10:17 -07:00
Jarred Sumner
45c34beb65 github action 2025-08-18 17:07:10 -07:00
Jarred Sumner
a2da900e40 github action 2025-08-18 17:02:38 -07:00
Jarred Sumner
883453391f github action 2025-08-18 16:55:29 -07:00
Jarred Sumner
e7aa548c42 github actions 2025-08-18 02:07:17 -07:00
robobun
53b870af74 feat: add GitHub Action to auto-label Claude PRs (#21840)
## Summary

- Adds a GitHub Action that automatically applies the 'claude' label to
PRs created by robobun user
- Triggers on `pull_request` `opened` events
- Only runs for PRs created by the `robobun` user account
- Uses `github-script` action to add the label

## Test plan

- [x] Created the workflow file with proper permissions
- [ ] Test by creating a new PR with robobun user (will happen
automatically on next Claude PR)
- [ ] Verify the label gets applied automatically

This ensures all future Claude-generated PRs are properly labeled for
tracking and organization.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Claude Bot <claude-bot@bun.sh>
Co-authored-by: Claude <noreply@anthropic.com>
2025-08-13 20:41:33 -07:00
Jarred Sumner
b6b3dc7eb5 Update docs.yml 2025-08-11 17:04:30 -07:00
robobun
0827add9a3 ci: optimize clang-format in GitHub Actions (#21715)
## Summary
- Replace cmake-based clang-format with dedicated bash script that
directly processes source files
- Optimize CI to only install clang-format-19 instead of entire LLVM
toolchain
- Script enforces specific clang-format version with no fallbacks

## Changes
1. **New bash script** (`scripts/run-clang-format.sh`):
   - Directly reads C++ files from `CxxSources.txt`
   - Finds all header files in `src/` and `packages/` directories
   - Respects existing `.clang-format` configuration files
   - Requires specific clang-format version (no fallbacks)
   - Defaults to format mode (modifies files in place)

2. **Optimized GitHub Action**:
- Only installs `clang-format-19` package with `--no-install-recommends`
   - Avoids installing unnecessary components like manpages
   - Uses new bash script instead of cmake targets

3. **Updated package.json scripts**:
- `clang-format`, `clang-format:check`, and `clang-format:diff` now use
the bash script

## Test plan
- [x] Verified script finds and processes all C++ source and header
files
- [x] Tested formatting works correctly by adding formatting issues and
running the script
- [x] Confirmed script respects `.clang-format` configuration files
- [x] Script correctly requires specific clang-format version

🤖 Generated with [Claude Code](https://claude.ai/code)

---------

Co-authored-by: Claude <claude@anthropic.ai>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-08-08 22:36:49 -07:00
Jarred Sumner
62e8a7fb01 Update pull_request_template.md 2025-07-28 18:28:54 -07:00
robobun
3315ade0e9 fix: update hdrhistogram GitHub action workflow (#21412)
## Summary

Fixes the broken update hdrhistogram GitHub Action workflow that was
failing due to multiple issues.

## Issues Fixed

1. **Tag SHA resolution failure**: The workflow failed when trying to
resolve commit SHA from lightweight tags, causing the error "Could not
fetch SHA for tag 0.11.8 @ 8dcce8f68512fca460b171bccc3a5afce0048779"
2. **Branch naming bug**: The workflow was creating branches named
`deps/update-cares-*` instead of `deps/update-hdrhistogram-*`
3. **Wrong workflow link**: PR body was linking to `update-cares.yml`
instead of `update-hdrhistogram.yml`

## Fix Details

- **Improved tag SHA resolution**: Updated logic to handle both
lightweight and annotated tags:
  - Try to get commit SHA from tag object (for annotated tags)
  - If that fails, use the tag SHA directly (for lightweight tags)
- Uses jq's `// empty` operator and proper error handling with
`2>/dev/null`
- **Fixed branch naming**: Changed from `deps/update-cares-*` to
`deps/update-hdrhistogram-*`
- **Updated workflow link**: Fixed PR body to link to correct workflow
file

## Test Plan

- [x] Verified current workflow logs show the exact error being fixed
- [x] Tested API calls locally to confirm the new logic works with
latest tag (0.11.8)
- [x] Confirmed the latest tag is a lightweight tag pointing directly to
commit

The workflow should now run successfully on the next scheduled execution
or manual trigger.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Claude Bot <claude-bot@bun.sh>
Co-authored-by: Claude <noreply@anthropic.com>
2025-07-27 16:43:38 -07:00
robobun
95e653e52b fix: handle both lightweight and annotated tags in update-lolhtml workflow (#21414)
## Summary

- Fixes the failing update-lolhtml GitHub Action that was unable to
handle lightweight Git tags
- The action was failing with "Could not fetch SHA for tag v2.6.0"
because it assumed all tags are annotated tag objects
- Updated the workflow to properly handle both lightweight tags (direct
commit refs) and annotated tags (tag objects)

## Root Cause

The lolhtml repository uses lightweight tags (like v2.6.0) which point
directly to commits, not to tag objects. The original workflow tried to
fetch a tag object for every tag, causing failures when the tag was
lightweight.

## Solution

The fix adds logic to:
1. Check the tag object type from the Git refs API response
2. For annotated tags: fetch the commit SHA from the tag object
(original behavior)
3. For lightweight tags: use the SHA directly from the ref (new
behavior)

## Test Plan

- [x] Verified the workflow logic handles both tag types correctly
- [ ] The next scheduled run should succeed (runs weekly on Sundays at 1
AM UTC)
- [ ] Manual workflow dispatch can be used to test immediately

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Claude Bot <claude-bot@bun.sh>
Co-authored-by: Claude <noreply@anthropic.com>
2025-07-27 16:43:17 -07:00
robobun
a8522b16af fix: handle both lightweight and annotated tags in lshpack update action (#21413)
## What does this PR do?

Fixes the failing `update-lshpack.yml` GitHub Action that has been
consistently failing with the error: "Could not fetch SHA for tag v2.3.4
@ {SHA}".

## Root Cause

The workflow assumed all Git tags are annotated tags that need to be
dereferenced via the GitHub API. However, some tags (like lightweight
tags) point directly to commits and don't need dereferencing. When the
script tried to dereference a lightweight tag, the API call failed.

## Fix

This PR updates the workflow to:

1. **Check the tag type** before attempting to dereference
2. **For annotated tags** (`type="tag"`): dereference to get the commit
SHA via `/git/tags/{sha}`
3. **For lightweight tags** (`type="commit"`): use the SHA directly
since it already points to the commit

## Changes Made

- Updated `.github/workflows/update-lshpack.yml` to properly handle both
lightweight and annotated Git tags
- Added proper tag type checking before attempting to dereference tags
- Improved error messages to distinguish between tag types

## Testing

The workflow will now handle both types of Git tags properly:
-  Annotated tags: properly dereferences to get commit SHA  
-  Lightweight tags: uses the tag SHA directly as commit SHA

This should resolve the consistent failures in the lshpack update
automation.

## Files Changed

- `.github/workflows/update-lshpack.yml`: Updated tag SHA resolution
logic

🤖 Generated with [Claude Code](https://claude.ai/code)

---------

Co-authored-by: Claude Bot <claude-bot@bun.sh>
Co-authored-by: Claude <noreply@anthropic.com>
2025-07-27 16:43:10 -07:00
robobun
aba8c4efd2 fix: handle lightweight tags in update highway workflow (#21411)
## Summary

Fixes the broken update highway GitHub action that was failing with:
> Error: Could not fetch SHA for tag 1.2.0 @
457c891775a7397bdb0376bb1031e6e027af1c48

## Root Cause

The workflow assumed all Git tags are annotated tags, but Google Highway
uses lightweight tags. For lightweight tags, the GitHub API returns
`object.type: "commit"` and `object.sha` is already the commit SHA. For
annotated tags, `object.type: "tag"` and you need to fetch the tag
object to get the commit SHA.

## Changes

- Updated tag SHA fetching logic to handle both lightweight and
annotated tags
- Fixed incorrect branch name (`deps/update-cares` →
`deps/update-highway`)
- Fixed workflow URL in PR template

## Test Plan

- [x] Verified the API returns `type: "commit"` for highway tag 1.2.0
- [x] Confirmed the fix properly extracts the commit SHA:
`457c891775a7397bdb0376bb1031e6e027af1c48`
- [x] Manual testing shows current version (`12b325bc...`) \!= latest
version (`457c891...`)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Claude Bot <claude-bot@bun.sh>
Co-authored-by: Claude <noreply@anthropic.com>
2025-07-27 16:43:01 -07:00
pfg
89eb48047f Auto reduce banned word count (#20929)
Co-authored-by: pfgithub <6010774+pfgithub@users.noreply.github.com>
2025-07-25 18:13:43 -07:00
Jarred Sumner
5c44553a02 Update vscode-release.yml 2025-07-21 23:25:57 -07:00
Michael H
f4116bfa7d followup for vscode test runner (#21024)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-07-21 23:21:05 -07:00
pfg
83760fc446 Sort imports in all files (#21119)
Co-authored-by: taylor.fish <contact@taylor.fish>
2025-07-21 13:26:47 -07:00
Meghan Denny
6ed245b889 ci: add auto-updaters for highway and hdrhistogram (#21157) 2025-07-18 04:15:33 -07:00
Jarred Sumner
e62f9286c9 Fix formatter action 2025-07-15 00:16:30 -07:00
Jarred Sumner
a976a048b7 Delete unused and confusing bun-internal-test package (#21008)
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
Co-authored-by: Jarred-Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2025-07-13 02:23:50 -07:00
Jarred Sumner
55a9cccac0 bun.sh -> bun.com (#20909) 2025-07-10 00:10:43 -07:00