dependabot-core icon indicating copy to clipboard operation
dependabot-core copied to clipboard

add support for `bun`

Open MarkLyck opened this issue 2 years ago • 25 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Feature description

https://bun.sh/ is quickly gaining traction and is now my preferred npm package manager.

It is faster than both yarn and pnpm, but the only thing left keeping me from moving to it for production use. Is the lack of support by dependabot or renovatebot.

Please add support for bun install and the bun.lockb lockfile.

MarkLyck avatar Jan 27 '23 10:01 MarkLyck

any progress here?

xhyrom avatar May 31 '23 16:05 xhyrom

Bun v1 has been released, this is very much needed now.

aradalvand avatar Sep 08 '23 17:09 aradalvand

Surprised to not see any support on this yet. We're looking into moving our production applications to bun, however we make significate use of dependabot

Wazbat avatar Sep 12 '23 23:09 Wazbat

@brrygrdn @JamieMagee @jurre @greysteil Sorry for tagging you guys, but just wanted to ask if this is going to be worked on soon?

aradalvand avatar Sep 13 '23 00:09 aradalvand

Afraid I don't work on Dependabot anymore, or at GitHub! 🤞 you get some traction - in the past the best / easiest integrations have been when the package manager team themselves collaborated with the Dependabot team.

greysteil avatar Sep 13 '23 01:09 greysteil

Got ya! Thank you.

@Jarred-Sumner Any chance you guys (the Bun team) could perhaps take a look at this?

aradalvand avatar Sep 13 '23 01:09 aradalvand

Hey @GrantBirki @jurre or @jakecoffman ... sorry to bother you, but is bun support planned for our beloved Dependabot ?

Thanks :)

czj avatar Sep 20 '23 05:09 czj

Hey guys, if any of you are willing to migrate from Dependabot.. Renovate has already introduced Bun support within ONLY 2 days since they announced that they have begun working on it. Unfortunately, Dependabot usually take anywhere from several months to years when it comes to implementing anything on the same level.

winstxnhdw avatar Sep 20 '23 11:09 winstxnhdw

@czj I do not work on the dependabot team here at GitHub but I let them know about this issue, thanks!

GrantBirki avatar Sep 20 '23 15:09 GrantBirki

Hi everyone, PM for Dependabot here. We do not currently have Bun support planned for Dependabot. We will post here if that changes.

carogalvin avatar Sep 20 '23 15:09 carogalvin

Thanks @carogalvin for clarifying. Sincerely hope you will plan it sooner than later !

czj avatar Sep 20 '23 15:09 czj

for packaging updating I have a repo with bun. It works for me nicely with package-ecosystem: 'npm', but I have to put a subconfig for each folder in monorepo as a workaround currently. Without it Dependabot doesn't open new PRs even I see all dependencies for whole monorepo in the dependency graph.

DenisIrkhin avatar Sep 21 '23 21:09 DenisIrkhin

@carogalvin is there a reason why?

It's really disappointing to see this when dependabot is built into Github. We shouldn't need to switch to a thirdparty like renovate for something like this. 😞

ImLunaHey avatar Sep 21 '23 21:09 ImLunaHey

Yes, but the reasons aren't very satisfying I'm afraid :/

  1. We have a lot of requests for new package managers, languages, and ecosystems (if you look at open issues and sort by most voted, you'll see a solid chunk of them are for adding such support). We cannot feasibly support every package manager, language, and ecosystem used on GitHub with just one engineering team.
  2. Adding coverage for a new package manager and maintaining that support is non-trivial, and we already support 20+ package managers
  3. Our top goal right now is improving the experience of working with Dependabot for ecosystems we already support; for example, our recent release of grouped version updates (which we're looking to extend to security updates next). When we look at our data, it's probably not too surprising to hear that a vast majority of Dependabot PRs are never merged - we're prioritizing features that address that.

Nothing against bun, it seems like a great package manager getting a lot of traction, but unfortunately with lots of feature requests and limited people we have to be very particular with how we prioritize. I'm sure we'll end up adding support eventually. I would encourage everyone looking at this to keep 👍 'ing this issue, because it helps us to see how many people will be helped with this.

carogalvin avatar Sep 21 '23 21:09 carogalvin

We'd be happy to help with adding Bun support to Dependabot

Jarred-Sumner avatar Sep 21 '23 22:09 Jarred-Sumner

FWIW, until there is support at the Dependabot level, being able to losslessly import yarn.lock files into Bun would provide a workaround path.

For example, if a project dumped both a bun.lockb and an equivalent yarn.lock, Dependabot could update the yarn.lock and a GitHub Action could follow up by dumping the equivalent bun.lockb.

sambostock avatar Sep 22 '23 01:09 sambostock

@sambostock So we must have this feature of bun implemented https://github.com/oven-sh/bun/issues/1751#issuecomment-1729237580?

And also this feature: https://github.com/oven-sh/bun/issues/6409

thienandangthanh avatar Sep 22 '23 03:09 thienandangthanh

I've created a workflow, that runs whenever dependabot creates a pull request. It will execute bun install and commits the bun.lockb file. The original commit of dependabot will be overwritten.

I hope this helps someone!

name: 'Dependabot: Update bun.lockb'

on: pull_request

permissions:
  contents: write

jobs:
  update-bun-lockb:
    name: "Update bun.lockb"
    if: github.actor == 'dependabot[bot]'
    runs-on: ubuntu-latest
    steps:
      - uses: oven-sh/setup-bun@v1
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
          ref: ${{ github.event.pull_request.head.ref }}
      - run: |
          bun install
          git add bun.lockb
          git config --global user.name 'dependabot[bot]'
          git config --global user.email 'dependabot[bot]@users.noreply.github.com'
          git commit --amend --no-edit 
          git push --force

Hint: This workflow, as written here, will only execute bun install in the project root folder

mstuercke avatar Mar 21 '24 20:03 mstuercke

Thanks a lot @mstuercke ! That's awesome :-)

To get rid of the skipped run status:

image

You can change the "on" to have a "paths" condition:

on:
  pull_request:
    paths:
      - "package.json"

czj avatar Mar 22 '24 09:03 czj

@czj @mstuercke

That means that I will also need to have a yarn.lock, package-lock.json or pnpm-lock.yaml so that dependabot can find out what version I am actually using (as part of the lockfile) and suggest an update.

Because, as per the dependency version I can specify: *, 1.x ^1.0.0 ~1.0.0.

aifrim avatar Apr 08 '24 10:04 aifrim

@czj @mstuercke

That means that I will also need to have a yarn.lock, package-lock.json or pnpm-lock.yaml so that dependabot can find out what version I am actually using (as part of the lockfile) and suggest an update.

Because, as per the dependency version I can specify: *, 1.x ^1.0.0 ~1.0.0.

@aifrim You can set versioning-strategy: increase and it will update package.json without lockfiles

Marocco2 avatar Apr 09 '24 10:04 Marocco2

@Jarred-Sumner Any update on this? Vulnerability updates are critical for any serious team, and Bun support for dependabot should be trivial – @mstuercke's action is pretty much all that's needed. Can we get first-class support?

isaachinman avatar May 04 '24 14:05 isaachinman

Are we really not getting any news on this?

tiagonrodrigues avatar May 06 '24 13:05 tiagonrodrigues

Jared already said he'd be happy to help implement Bun support for dependabot but the Github team is pretty clear about not wanting to add support for any new package manager anymore. There's not much to wait for really, the answers are already here. We just don't like them

If you really wanna use Bun as your package manager you can check Renovate which does the same thing and has Bun support

If you really wanna use Dependabot you can check Pnpm which is a very good alternative instead of Bun as a package manager.

wJoenn avatar May 06 '24 14:05 wJoenn

@wJoenn Strongly disagree with your take.

@carogalvin Has literally said:

I'm sure we'll end up adding support eventually

Meaning this issue is currently in a "prove to us it's worth it" phase.

isaachinman avatar May 06 '24 14:05 isaachinman

@Jarred-Sumner You mentioned some time ago that you'd be happy to work on adding Bun support to Dependabot. I'm curious if this is still something you are pursuing or if this is something that is back burnered indefinitely.

elliotlarson avatar Aug 07 '24 16:08 elliotlarson