Code Monkey home page Code Monkey logo

dependabot / dependabot-core Goto Github PK

View Code? Open in Web Editor NEW
3.9K 3.9K 882.0 88.36 MB

πŸ€– Dependabot's core logic for creating update PR's.

Home Page: https://docs.github.com/en/code-security/dependabot

License: Other

Ruby 89.05% JavaScript 0.87% PHP 0.36% Shell 0.38% Python 0.14% Elixir 0.13% Dockerfile 0.50% Makefile 0.01% Go 0.08% Dart 0.10% C# 8.39%
dependencies docker dotnet elixir elm go java javascript php pnpm python ruby rubygems rust terraform

dependabot-core's Introduction

Dependabot

Welcome to the public home of Dependabot :dependabot:.

Table of Contents


What is Dependabot-Core?

Dependabot-Core is the library at the heart of Dependabot security / version updates.

Use it to generate automated pull requests updating dependencies for projects written in Ruby, JavaScript, Python, PHP, Dart, Elixir, Elm, Go, Rust, Java and .NET. It can also update git submodules, Docker files, and Terraform files. Features include:

  • Check for the latest version of a dependency that's resolvable given a project's other dependencies
  • Generate updated manifest and lockfiles for a new dependency version
  • Generate PR descriptions that include the updated dependency's changelogs, release notes, and commits

How to run Dependabot

Most people are familiar with the Dependabot service that runs on GitHub.com and GitHub Enterprise. Enabling that is as simple as checking a dependabot.yml configuration file in to your repository's .github directory.

However, if you want to run a custom version of Dependabot or run it on another platform, you're not left out in the cold. This repo provides the logic necessary for hosting your own standalone Dependabot, as long as you're not reselling Dependabot to others. It currently supports opening Pull Requests against repositories hosted on GitHub, Github Enterprise, Azure DevOps, GitLab, BitBucket, and AWS CodeCommit.

Dependabot-Core is a library, so you'll need an entrypoint script of some kind. Here are a few examples to help you get started.

Note: If you're looking to run Dependabot locally for development/debugging purposes, see the Development Guide.

Dependabot-Script

The dependabot-script repo provides a collection of example scripts for configuring the Dependabot-Core library. It is intended as a starting point for advanced users to run a self-hosted version of Dependabot within their own projects.

Note: We recently refactored the monolithic docker image used within the Dependabot Core library into one-image-per-ecosystem. Unfortunately, that broke dependabot-scripts, and we haven't had time to update them yet. We are aware of the problem and hope to provide a solution soon.

Dependabot CLI

The Dependabot CLI is a newer tool that may eventually replace dependabot-script for standalone use cases. While it creates dependency diffs, it's currently missing the logic to turn those diffs into actual PR's. Nevertheless, it may be useful for advanced users looking for examples of how to hack on Dependabot.

Dependabot on CI

In an environment such as GitHub where Dependabot is running in a container, if you want to change your build or installation process depending on whether Dependabot is checking, you can determine it by the existence of DEPENDABOT environment variable.

Contributing to Dependabot

Reporting issues and Feature Requests

πŸ‘‹ Want to give us feedback on Dependabot, or contribute to it? That's great - thank you so much!

Reproducible Example

Most bug reports should be accompanied by a link to a public repository that reproduces the problem. Bug reports that cannot be reproduced on a public repo using the CLI tool or dry-run script may be closed as "cannot reproduce".

No "+1" Comments

Our issue tracker is quite active, and as a result there's a good chance someone already filed the same issue. If so, please upvote that issue, because we use πŸ‘ reactions on issues as one signal to gauge the impact of a feature request or bug.

However, please do not leave comments that contribute nothing new to the discussion. For details, see https://github.com/golang/go/wiki/NoPlusOne. This is open source, if you see something you want fixed, we are happy to coach you through contributing a pull request to fix it.

Don't file issues about Security Alerts or Dependency Graph

The issue-tracker is meant solely for issues related to Dependabot's updating logic. Issues about security alerts or Dependency Graph should instead be filed as a Code Security discussion.

A good rule of thumb is that if you have questions about the diff in a PR, it belongs here.

Disclosing Security Issues

If you believe you have found a security vulnerability in Dependabot please submit the vulnerability to GitHub Security Bug Bounty so that we can resolve the issue before it is disclosed publicly.

Submitting Pull Requests

Want to contribute to Dependabot? That's great - thank you so much!

Contribution workflow:

  1. Fork the project.
  2. Get the development environment running.
  3. Make your feature addition or bug fix.
  4. Add tests for it. This is important so we don't break it in a future version unintentionally.
  5. Send a pull request. The tests will run on it automatically, so don't worry if you couldn't get them running locally.

Please refer to the CONTRIBUTING guidelines for more information.

New Ecosystems

Currently, the Dependabot team is not accepting support for new ecosystems. We are prioritising upgrades to already supported ecosystems at this time.

Please refer to the CONTRIBUTING guidelines for more information.

Development Guide

Getting a Development Environment Running

The first step to debugging a problem or writing a new feature is getting a development environment going. We provide a custom Docker-based developer shell that bakes in all required dependencies. In most cases this is the best way to work with the project.

The developer shell uses volume mounts to incorporate your local changes to Dependabot's source code. This way you can edit locally using your favorite editor and the changes are immediately reflected within the docker container for performing dry-runs or executing tests. Note: See caveat about editing the native package manager helper scripts.

Quickstart

The script to launch the developer shell builds the docker images from scratch if it can't find them locally. This can take a while.

Skip the wait by pulling the pre-built image for the ecosystem you want to work on. The image name uses the YAML ecosystem name to specify the ecosystem. For example, for Go Modules, the YAML name is gomod:

$ docker pull ghcr.io/dependabot/dependabot-updater-gomod

Note: Pre-built images are currently only available for AMD64 / Intel architecture. They will run on ARM, but 2x-3x slower than if you manually build ARM-specific images.

Next, run the developer shell, specifying the desired ecosystem using the top-level directory name of the ecosystem in this project. For example, for Go Modules, the top-level directory is named go_modules:

$ bin/docker-dev-shell go_modules
=> running docker development shell
[dependabot-core-dev] ~ $ cd go_modules && rspec spec # to run tests for a particular package

Building Images from Scratch

Normally the Quickstart is all you need, but occasionally you'll need to rebuild the underlying images.

For example, while we don't yet publish ARM-specific images, if you are working on an ARM-based platform, we recommend manually building the images because the resulting containers run much faster.

The developer shell runs within a Dependabot Development docker image, which is built on top of an ecosystem image.

flowchart LR
    A["docker-dev-shell script"] --> B("Dependabot Development docker image")
    B --> C("Dependabot Updater Ecosystem docker image (ecosystem specific)")
    C --> D("Dependabot Updater Core docker image")

Changes to the docker files for any of these images requires building one or more of the images locally in order to be reflected in the development shell.

The simple but slow way is to delete any existing images and then run bin/docker-dev-shell which automatically builds missing images.

The faster way is to pull all the pre-built images that are dependencies of the image you actually need to build. To (re)build a specific one:

  • The Updater core image:

    $ docker pull ghcr.io/dependabot/dependabot-updater-core # OR
    $ docker build -f Dockerfile.updater-core . # recommended on ARM
  • The Updater ecosystem image:

    $ docker pull ghcr.io/dependabot/dependabot-updater-gomod # OR
    $ script/build go_modules # recommended on ARM
  • The development container using the --rebuild flag:

    $ bin/docker-dev-shell go_modules --rebuild

Making Changes to native Package Manager helpers

Several Dependabot packages make use of 'native helpers', small executables in their host language.

Changes to these files are not automatically reflected inside the development container.

Once you have made any edits to the helper files, run the appropriate build script to update the installed version with your changes like so:

$ bin/docker-dev-shell bundler
=> running docker development shell
$ bundler/helpers/v2/build
$ bin/dry-run.rb bundler dependabot/demo --dir="/ruby"

To view logs and stdout from the native package manager helpers, see debugging native helpers.

Debugging Problems

The first step to debugging is getting the development environment running.

Within the development environment, you have two options for simulating a dependency update job: You can use the newly-developed CLI tool or the original Dry-run script.

CLI tool

The Dependabot CLI is a newly-developed tool that incorporates the GitHub Credentials Proxy to more realistically simulate what's happening within the Dependabot-at-GitHub service when talking to private registries.

It has a dedicated debugging guide, including support for dropping into the Ruby debugger.

Dry-Run Script

Note: Before running the dry-run script, you'll need to get the development environment running.

You can use the bin/dry-run.rb script to simulate a dependency update job, printing the diff that would be generated to the terminal. It takes two positional arguments: the package manager and the GitHub repo name (including the account):

$ bin/docker-dev-shell go_modules
=> running docker development shell
$ bin/dry-run.rb go_modules rsc/quote
=> fetching dependency files
=> parsing dependency files
=> updating 2 dependencies
...

Helpful options to speed up dry-run testing

The Dry-Run script supports many other options, all of which are documented at the top of the script's source code. For example:

  1. LOCAL_GITHUB_ACCESS_TOKEN="fake-GitHub-PAT" allows specifying a GitHub Personal Access Token (PAT) to avoid rate-limiting.
  2. --dir="path/to/subdir/containing/manifest is required if the manifest file is located in a subdirectory.
  3. --dep="dep-name-that-I-want-to-test" allows specifying a single dep to try to update and all others are ignored.
  4. --cache=files allows caching remote dep files locally for faster re-runs when testing local logic changes.
  5. --updater-options=feature_flag_name allows passing in feature flags.

Here's an example of how to string all these together

  LOCAL_GITHUB_ACCESS_TOKEN=github_pat_123_fake_string \
  bin/dry-run.rb docker jeffwidman/secrets-store-driver \
  --dir "/manifest_staging/charts/secrets-store-provider" \
  --cache=files \
  --dep="secrets-store" \
  --updater-options=kubernetes_updates

Adding debug breakpoints

You can add a debugger statement anywhere in the ruby code, for example:

      def latest_resolvable_version
        debugger
        latest_version_finder.latest_version
      end

When you execute the job, the Ruby debugger will open. It should look something like this:

[11, 20] in ~/go_modules/lib/dependabot/go_modules/update_checker.rb
    11|   module GoModules
    12|     class UpdateChecker < Dependabot::UpdateCheckers::Base
    13|       require_relative "update_checker/latest_version_finder"
    14|
    15|       def latest_resolvable_version
=>  16|         debugger
    17|         latest_version_finder.latest_version
    18|       end
    19|
    20|       # This is currently used to short-circuit latest_resolvable_version,
=>#0    Dependabot::GoModules::UpdateChecker#latest_resolvable_version at ~/go_modules/lib/dependabot/go_modules/update_checker.rb:16
  #1    Dependabot::GoModules::UpdateChecker#latest_version at ~/go_modules/lib/dependabot/go_modules/update_checker.rb:24
  # and 9 frames (use `bt' command for all frames)
(rdbg)

At this prompt, you can run debugger commands to navigate around, or enter methods and variables to see what they contain. Try entering dependency to see what dependency Dependabot is currently working on.

Note While in the debugger, changes made to the source code will not be picked up. You will have to end your debugging session and restart it.

Debugging Native Package Manager Helpers

When you're debugging an issue you often need to peek inside these scripts that run in a separate process.

Print all log statements from native helpers using DEBUG_HELPERS=true:

DEBUG_HELPERS=true bin/dry-run.rb bundler dependabot/demo --dir="/ruby"

Pause execution to debug a single native helper function using DEBUG_FUNCTION=<function name>. The function maps to a native helper function name, for example, one of the functions in bundler/helpers/v2/lib/functions.rb.

When this function is being executed a debugger is inserted, pausing execution of the bin/dry-run.rb script, this leaves the current updates tmp directory in place allowing you to cd into the directory and run the native helper function directly:

 DEBUG_FUNCTION=parsed_gemfile bin/dry-run.rb bundler dependabot/demo --dir="/ruby"
=> fetching dependency files
=> dumping fetched dependency files: ./dry-run/dependabot/demo/ruby
=> parsing dependency files
$ cd /home/dependabot/dependabot-core/tmp/dependabot_TEMP/ruby && echo "{\"function\":\"parsed_gemfile\",\"args\":{\"gemfile_name\":\"Gemfile\",\"lockfile_name\":\"Gemfile.lock\",\"dir\":\"/home/dependabot/dependabot-core/tmp/dependabot_TEMP/ruby\"}}" | BUNDLER_VERSION=1.17.3 BUNDLE_GEMFILE=/opt/bundler/v1/Gemfile GEM_HOME=/opt/bundler/v1/.bundle bundle exec ruby /opt/bundler/v1/run.rb

Copy and run the cd... command:

cd /home/dependabot/dependabot-core/tmp/dependabot_TEMP/ruby && echo "{\"function\":\"parsed_gemfile\",\"args\":{\"gemfile_name\":\"Gemfile\",\"lockfile_name\":\"Gemfile.lock\",\"dir\":\"/home/dependabot/dependabot-core/tmp/dependabot_TEMP/ruby\"}}" | BUNDLER_VERSION=1.17.3 BUNDLE_GEMFILE=/opt/bundler/v1/Gemfile GEM_HOME=/opt/bundler/v1/.bundle bundle exec ruby /opt/bundler/v1/run.rb

This should log out the output of the parsed_gemfile function:

{"result":[{"name":"business","requirement":"~> 1.0.0","groups":["default"],"source":null,"type":"runtime"},{"name":"uk_phone_numbers","requirement":"~> 0.1.0","groups":["default"],"source":null,"type":"runtime"}]}

Keep in mind that unlike changes to the ruby source, changes on your host machine to the native helpers source code are not synced to the development container. So you have two choices for editing the native helper:

  • You can directly edit the temporary copy of the native helper within the development container, for example: vi /opt/bundler/v1/lib/functions/file_parser.rb. And then re-run the cd... command. This is the fastest way to debug, but any changes won't be saved outside the container.
  • You can edit your local copy, and then rebuild the native helper. This will require re-running the dry-run script to pickup the change.

Debugging Ignore Conditions

Most of the ecosystems in Dependabot-Core support ignore conditions which allow a user to specify dependency names or versions to exclude from upgrades. The docs for the Dependabot service at GitHub describe the feature in more detail.

The Dependabot CLI supports passing in ignore conditions as part of the job definition. See the example.

The dry-run script supports passing in one or more ignore conditions via the env var IGNORE_CONDITIONS:

IGNORE_CONDITIONS='[{"dependency-name":"*","update-types": ["version-update:semver-major"]}]' \
bin/dry-run.rb docker test_org/test-dependabot`

Debugging Security Updates

Many of the ecosystems in Dependabot-Core support security updates. These are a special form of version update where a dependency name and range of vulnerable versions are passed in. Dependabot-Core will try to upgrade any instance of that dependency to the minimum non-vulnerable version. This is in contrast to a normal version update which tries to update to the latest version.

The env var SECURITY_ADVISORIES allows passing one or more security alert notifications to the dry-run script in order to simulate a security update:

SECURITY_ADVISORIES='[{"dependency-name":"buffer","patched-versions":[],"unaffected-versions":[],"affected-versions":["<= 2.0.0"]}]' \
bin/dry-run.rb pub dart-lang/pub-dev --dir "/app" --cache=files --dep="buffer"

Visual Studio Code and Docker

There's built-in support for leveraging Visual Studio Code's ability for debugging inside a Docker container. After installing the recommended Dev Containers extension, simply press Ctrl+Shift+P (β‡§βŒ˜P on macOS) and select Dev Containers: Reopen in Container. You can also access the dropdown by clicking on the green button in the bottom-left corner of the editor. If the development Docker image isn't present on your machine, it will be built automatically. Once that's finished, start the Debug Dry Run configuration (F5) and you'll be prompted to select a package manager and a repository to perform a dry run on. Feel free to place breakpoints on the code.

There is also support to debug individual test runs by running the Debug Tests configuration (F5) and you'll be prompted to select an ecosystem and provide an rspec path.

⚠️ The Clone Repository ... commands of the Remote Containers extension are currently missing some functionality and are therefore not supported. You have to clone the repository manually and use the Reopen in Container or Open Folder in Container... command.

Running Tests

Once you get the development environment for a particular ecosystem going, execute the tests for that ecosystem by running rspec spec inside that ecosystem's folder, e.g.

$ cd go_modules
$ rspec spec

You can also limit the tests to only the file you're working on, or only tests that previously failed, for example:

$ rspec spec/dependabot/file_updaters/elixir --only-failures

Style is enforced by RuboCop. To check for style violations, simply run rubocop in each of the packages, e.g.

$ cd go_modules
$ rubocop

Profiling

You can profile a dry-run by passing the --profile flag when running it, or tag an rspec test with :profile. This will generate a stackprof-<datetime>.dump file in the tmp/ folder, and you can generate a flamegraph from this by running:

stackprof --d3-flamegraph tmp/stackprof-<data or spec name>.dump > tmp/flamegraph.html

Architecture and Code Layout

Dependabot-Core is a collection of Ruby packages (gems), which contain the logic for updating dependencies in several languages.

dependabot-common

The common package contains all general-purpose/shared functionality. For instance, the code for creating pull requests for the different supported platforms lives here, as does most of the logic for handling Git dependencies (as most languages support Git dependencies in one way or another). There are also base classes defined for each of the major concerns required to implement support for a language or package manager.

dependabot-{package-manager}

There is a gem for each package manager or language that Dependabot supports. At a minimum, each of these gems will implement the following classes:

Service Description
FileFetcher Fetches the relevant dependency files for a project (e.g., the Gemfile and Gemfile.lock). See the README for more details.
FileParser Parses a dependency file and extracts a list of dependencies for a project. See the README for more details.
UpdateChecker Checks whether a given dependency is up-to-date. See the README for more details.
FileUpdater Updates a dependency file to use the latest version of a given dependency. See the README for more details.
MetadataFinder Looks up metadata about a dependency, such as its GitHub URL. See the README for more details.
Version Describes the logic for comparing dependency versions. See the hex Version class for an example.
Requirement Describes the format of a dependency requirement (e.g. >= 1.2.3). See the hex Requirement class for an example.

The high-level flow looks like this:

Dependabot high-level architecture diagram

dependabot-omnibus

This is a "meta" gem, that simply depends on all the others. If you want to automatically include support for all languages, you can just include this gem and you'll get all you need.

Private Registry Credential Management

For many ecosystems, Dependabot-Core supports private registries. Sometimes this happens by passing the private registry credentials directly to the native package managers (npm, pip, bundler, etc), other times it happens within the Dependabot-Core Ruby code.

sequenceDiagram
    Private Registry Credentials->>Dependabot-Core:<br />
    Dependabot-Core->>Native Package Managers:<br />
    Native Package Managers->>Package Registries:<br />
    Dependabot-Core->>Package Registries:<br />

While simple and straightforward, this is a security risk for ecosystems that allow running untrusted code within their manifest files. For example setup.py and .gemspec allow running native Python and Ruby code. If a package in the dependency tree gets hacked, an attacker could push a malicious manifest that forces the native package manager to expose the creds.

To guard against this, for the Dependabot service that Github runs, we wrap Dependabot-Core with a credential proxy so those private registry secrets are never exposed to Dependabot-Core.

sequenceDiagram
    Dependabot-Core->>Credentials Proxy: All requests are unauthenticated
    Credentials Proxy->>Package Registries: Creds are injected by the Proxy
    Note left of Dependabot-Core: The Dependabot Service<br /> that GitHub Runs
    Package Registries->>Credentials Proxy: Creds are stripped by the Proxy
    Credentials Proxy->>Dependabot-Core: Dependabot-Core never sees private registry credentials

This also means if Dependabot-Core ever has a security vulnerability, those creds are still not at risk of being exposed.

License and Project History

Why is this public?

As the name suggests, Dependabot-Core is the core of Dependabot (the rest of the app is pretty much just a UI and database). If we were paranoid about someone stealing our business then we'd be keeping it under lock and key.

Dependabot-Core is public because we're more interested in it having an impact than we are in making a buck from it. We'd love you to use Dependabot so that we can continue to develop it, but if you want to build and host your own version then this library should make doing so a lot easier.

If you use Dependabot-Core then we'd love to hear what you build! If you are curious about what we are currently working on, check out our public board!

License

We use the License Zero Prosperity Public License, which essentially enshrines the following:

  • If you would like to use Dependabot-Core in a non-commercial capacity, such as to host a bot at your workplace, then we give you full permission to do so. In fact, we'd love you to and will help and support you however we can.
  • If you would like to add Dependabot's functionality to your for-profit company's offering then we DO NOT give you permission to use Dependabot-Core to do so.

History

Dependabot and Dependabot-Core started life as Bump and Bump Core, back when Harry and Grey were working at GoCardless. We remain grateful for the help and support of GoCardless in helping make Dependabot possible - if you need to collect recurring payments from Europe, check them out.

Notes for project maintainers

πŸ“– Release guide

Publish a new release to RubyGems by running the Gems - Bump Version workflow and following the instructions on the job summary.

In a nutshell the process will be:

  1. Run the action to generate a version bump PR.
  2. Merge the PR.
  3. Tag that merge commit as a new release using the format v1.2.3. The job summary contains a URL pre-populated with the correct version for the title and tag.
  4. Once the release is tagged, another GitHub Action workflow automatically pushes it to RubyGems.

dependabot-core's People

Contributors

abdulapopoola avatar bdragon avatar brettfo avatar brrygrdn avatar deivid-rodriguez avatar dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar dwc0011 avatar feelepxyz avatar greysteil avatar hmarr avatar honeyankit avatar jakecoffman avatar jamiemagee avatar jasonrudolph avatar jeffwidman avatar jsoref avatar jurre avatar landongrindheim avatar mattt avatar mctofu avatar nishnha avatar pavera avatar rebelagentm avatar ryanbrandenburg avatar sigurdm avatar thepwagner avatar xlgmokha avatar yeikel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dependabot-core's Issues

Conflict resolution updates can be a bit noisy

From @Floppy on June 1, 2017 10:29

I'm updating a lot of stuff in one go, so this might be irrelevant for most users, but I find the conflict resolution comment to be unnecessarily noisy. Github already warns me that there are conflicts and won't let me merge, and dependabot is usually only a couple of minutes behind, so I'm not sure I really need a comment (lovely and polite though it is). I'm not in a "normal use" mode yet though, more of a "huge numbers of updates" mode, so this might not be a problem normally. Just raising in case others feel the same really. Perhaps an option to enable/disable them?

Copied from original issue: dependabot/feedback#6

Not updating package.json

In a recent PR I merged from Dependabot I've noticed that it has only updated my Yarn lockfile, not my package.json. Is this a bug or new behaviour?

If it is new behaviour, it would be nice to at least be able to opt into the old behaviour.

Support multi-module Maven projects

In a lot of (open source and enterprise) projects it is very common to create Maven multi-module projects. One can for example have a module for only domain classes, utils or interfaces meant for public consumption.

Dependencies (code dependencies, plugins etc) can be attached to any module, optionally overriding dependencies higher up in the hierarchy (often referred to as the build reactor in Maven terminology).

In order for dependabot to be useful to a lot of Java shops, this functionality must be implemented.

See this project for a sample.

you need to take care of semantic versioning

Hi @greysteil

lets take this picture as base of the conversation:
screenshot 2017-12-18 07 49 54

I defined ^2.5 in my composer.json to allow the following versions:

2.5.1
...
2.99.99 etc.

I am totally fine by upgrading to 2.5.14 in my composer.lock but not by changing the constraint itself in composer.json.

Because from now on, I cannot run composer update on my local machine AND you change the constraint, because now the allowed versions does not contain 2.6, 2.7.... but they were allowed before 😒

So we are back on #161 πŸ˜„

Cheers, Oskar

Git submodules

From @Floppy on May 31, 2017 9:58

Probably a low priority niche use case, but a new "language" for updating git submodule versions would be incredibly useful (at least for me).

I have a number of Jekyll sites that include content from other repositories via submodules: https://github.com/SomethingNewUK/somethingnewuk.github.io/ is probably the most complex of those, with about 4 submodules in various subdirectories.

User story attempt:

As a website maintainer who does silly things with Jekyll
I would like to be able to add a "git submodule" language to a repository
So that I can get an automatic PR created when the submodule's repository has been updated

Copied from original issue: dependabot/feedback#4

Does not propose updates for dependent gems?

From @rdunlop on September 21, 2017 15:54

In my project, I have capybara in my Gemfile, which depends upon nokogiri >= 1.3.3.

Currently, I have nokogiri (1.8.0) installed.

Why hasn't dependabot prompted me to install nokogiri 1.8.1?

Doing bundle update nokogiri locally does succeed in creating a new Gemfile.lockwith an updated version ofnokogiriandmini_portile2`

Copied from original issue: dependabot/feedback#22

< version specifiers

From @Floppy on May 31, 2017 9:41

(I've filed this via email but I thought I'd christen the new issue tracker too)

I’ve got a few old repos where we were locking foreman at < 0.64. As it turns out, this isn’t necessary any more but dependabot is changing that to the current version, but still with the < specifier. So the update says 0.84, but the Gemfile now says < 0.84 (i.e. 0.83). Not sure what the right solution is really, but thought you’d like to know :)

Example change at theodi/static#237

Copied from original issue: dependabot/feedback#1

Support Gradle Projects

things to consider here:

  • map style notation: compile group: 'com.google.code.guice', name: 'guice', version: '1.0'
  • short notation: compile 'commons-lang:commons-lang:2.6'
  • different quotation marks (both " and ' are allowed)
  • multi module projects

Dependabot opened a PR with no files changed

We currently have an open pr with an empty commit by dependabot. I'm not sure why it happened (the commit message etc seems to be fine). There are two other PRs open in which only the lock file was updated, not the package.json - but I was told this has to do with carets (^) before our versions and an opt-in feature of dependabot. I'm not aware of any changes on our end, so this might be a bug as well?

You have had previous conversations with @StephanBijzitter - you should be able to find our github organisation, the repository in question ends with -Frontend and the pull request number is 512.

Wrong version

This is written down in my composer.json

"sensio/framework-extra-bundle": "^3.0.2",

this means, that everything below 3.1 is allowed. Why do I get a PR like this?
screenshot 2017-12-08 11 50 45

Add dependabot badge

Other services use a badge to show that the service is enabled for a certain GitHub repository. It might be a good way to increase awareness of dependabot by adding badges, showing that dependabot is enabled for a repo.

It could just be something as simple as a static badge like

Dependabot badge

When first enabling dependabot on a repo, the first PR could add the badge to the README.

Dependabot couldn't find a package.json for this project

Dependabot couldn't find a package.json for this project.

Dependabot requires a package.json to evaluate your project's current Javascript dependencies. It had expected to find one at the path: /helpers/javascript/package.json.

If this isn't a Javascript project, or if it is a library, you may wish to disable updates for it from within Dependabot.

You can mention @dependabot in the comments below to contact the Dependabot team.

Handle upgrades that require upgrading multiple dependencies at once

From @greysteil on May 31, 2017 10:0

On a lot of old repos, we see Gemfiles with something like the below:

gem "rails", "~> 4.1"
gem "sass-rails", "~> 4.1"

To upgrade either of the dependencies in the above Gemfile, we need to update both, because sass-rails version 5 depends on the rails version being 5.

The right way to handle the above is to put in a PR upgrading both of the above, with clear details of both updates.

Copied from original issue: dependabot/feedback#5

Update Ruby versions

From @Floppy on May 31, 2017 9:52

Some repos will have ruby version specified in the Gemfile, travis.yml, or .ruby-version (and there are probably others). It would be dead handy to have dependabot update these at least with patch or minor versions, so we don't miss a new release :)

Copied from original issue: dependabot/feedback#3

Add badges

From @sobolevn on November 17, 2017 9:16

I want to inform my users, that dependencies are up-to-date.

The easiest way to do it, as for me, is a badge. Something similar to:

dependencies
dev

Do you have any plans to support this feature?

Copied from original issue: dependabot/feedback#49

Changelog within PR

We're running a trial of dependabot on some of the GOV.UK repos at the moment. Would you be open to us creating a PR for dependabot-core which pulls the dependancy changes into the PR creator, rather than linking out to the changesets?

It's something that we feel would be a better experience for PR reviewers and also addresses a risk around the changesets being edited in dependant repositories. Wanted to get your thoughts on this before we cut any code.

Allow weekly updates

From @pezholio on May 31, 2017 9:50

For some, a daily update might be a bit too noisy and distracting. It might be nice to offer a weekly update frequency, then users can schedule a time every week to check over and merge dependency updates.

Copied from original issue: dependabot/feedback#2

HELP WANTED! PHP updates misbehaving in containers

Dependabot has been having trouble updating large PHP repos, and I've been unable to debug it. I'm not an expert on PHP, or on containerisation, and would love your help.

All of the details should be present in this repo, which has instructions on how to replicate. If you can help fix the bug you will have my gratitude forever, as I'm pulling my hair out here!

My current best guess is that this is a disk space / memory issue, as it only occurs for large composer.json files, and only when running within a container. I could, however, be completely wrong, and the issue may be todo with a composer.json setting I'm missing.

Other points to note:

Use AngularJS commit message conventions

Using AngularJS commit message conventions for dependabot would allow for automatic changelog creation using coventional-changelog (and other associated tools).

For dependabot commits, this would look something like

chore(node): bump #{dependency.name} from #{previous_version(dependency)} to {new_version(dependency)}

CURRENT COMMIT DETAIL GOES HERE

I am able to make the changes required in message_builder.rb, but I would like to hear your opinion on my suggestion before I do any work.

Add support for C#

From @evenh on October 28, 2017 15:26

This seems like a great product for the company I work at, but almost all our projects are written in Java (Maven) or C#/.NET. Is there any plans to support this? :-)

Copied from original issue: dependabot/feedback#33

Feature request: only update yarn.lock or package-lock.json if the version is within range

We're going to open source some of our tooling we've been using internally and to provide smaller download sizes (and bundles in case it's meant for the browser), we want to keep the ranges as open as possible for our users, leveraging yarn's deduping.

For example, this means we'd like to keep our package.json at ^1.0.0 for a dependency while our yarn.lock could already lock to 1.2.3.

This will still allow development of the projects to be done with constant updates, without bothering our users. It's not too big of an issue since we can just tell Dependabot to ignore the dependency until the next major release, though.

For us, this would be a bonus; certainly not a requirement.
(we're very happy with Dependabot already)

yarn.lock as generated by Dependabot is not optimal

screen shot 2018-01-22 at 13 01 06

This is part of a pull request created by Dependabot, and while this installs perfectly fine, I would expect `doctrine@^2.0.0, doctrine@^2.0.2:` to change into `doctrine@^2.0.0, doctrine@^2.1.0:`, so that only 2.1.0 is installed, instead of the current 2.0.2 and 2.1.0

doctrine is a dependency of eslint, that updated from 4.15.0 to 4.16.0

[Feature request] Automatically upgrade dependencies, not only version number

1. Request

It would be nice, if would be possible upgrade dependencies, not only version numbers in requirements file.

For example, it would be nice add an option, that bot will run command after each version changing in requirements file.

2. Steps to reproduce

I develop plugins for Sublime Text, written on Python. By technical reasons I need add dependencies to my repository.

In my repository for testing I add outdated version of PyPI gsearch module to requirements.txt file. I use command:

pip install -r requirements.txt -t . --upgrade

3. Justification

Automatically dependencies upgrading may save developers time.

I test Dependabot on my test repository. Dependabot only change dependency version in requirements.txt file, but not upgrade my gsearch dependency, that I include to my repository.

I need upgrade my dependency manually; after merging I need run command again:

pip install -r requirements.txt -t . --upgrade

It would be nice, if Dependabot will run this command automatically after each version change in requirements.txt file.

Thanks.

Invalid JSON in package.json results in Dependabot closing pull requests

I was foolish enough to commit directly to master and i accidentally typed part of the commit message into package.json. Needless to say, this meant the JSON was invalid. The result: Dependabot closed the one pull request that was still open, stating it detected that the dependency is now up to date and the PR is no longer needed.

So this seems to be a small bug which occurs when it tries to parse invalid JSON. Or, of course, it's completely unrelated and the timing is just coincidental... you never really know.

If you type my github username in your email client you'll find previous conversations which will direct you to our github organisation, the repository in question ends with -Tests and the pull request number is 47. Hopefully you'll be able to pull some data and fix this if it really is caused by invalid JSON.

Include old version in PR titles

From @Floppy on June 2, 2017 13:1

It would be handy, when looking at a big list of PRs, to get a quick flavour of which updates are small and simple, and which are potentially complex. Including the old version number as well as the new one in the title would help with that. Pretty much exactly the text in the first line of the PR, in fact, would be great.

Copied from original issue: dependabot/feedback#8

Support multiple gemfiles

From @deivid-rodriguez on November 19, 2017 18:44

Some projects use multiple gemfiles. The main use case I know for this is to be able to test libraries against different major versions of dependencies.

Does dependabot support this kind of setups?

Copied from original issue: dependabot/feedback#51

Support vendoring for Ruby

From @biow0lf on August 11, 2017 8:47

Hello,

I am using vendored gems in vendor/cache/. So, dependabot update gem in Gemfile.lock, but leave old gem file in vendor/cache/. Plus, not put new gem to vendor/cache/.

So, I think, run bundle pack and add changed files will enough.

Copied from original issue: dependabot/feedback#15

Grouped PR for packages that are released simultaneously

Hi i have an interesting proposal, I have recently used dependabot for managing my dependencies and i have this some sort of problem in scoped packages like @angular/* packages having multiple PRs wherein they are all released at the same time.

Hopefully you'll take time considering this since updating Angular with multiple PRs results in many queued CI tasks and too many PRs that needs to merged Although there have been an auto-merge setting but i prefer not to use it. It would be better if it can be configured per repo basis.

Option for single pull request per update

From @zach-taylor on June 20, 2017 18:37

We use deppbot (https://www.deppbot.com) at the moment and we like the idea of a single pull request for each update rather than a pull request for each gem update. The main reason we like this is we have a lot of dependencies, and it can get noisy and slow to perform a build for each one and the way our branch protections are set up.

Thanks for the consideration!

Copied from original issue: dependabot/feedback#11

Update Peer dependencies

Hey guys,
we are using dependabot for some time, thx for nice service. But we are missing one feature. Dependabot doesn't updates peer dependencies and we need to do it manually each time.

Does it make sense to add support of it?

Thx

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.