Skip to content

A few feature ideas and whether upstream would be interested in accepting them? #173

@mikn

Description

@mikn

Hi!

Love the project! It is the only "local first" dependency management tool that I have found. Funny how "shift-left" stopped at CI otherwise in this particular use-case.

Anyway, I have some feature ideas that I would gladly contribute:

  • A BCR (Bazel Central Registry) Filter
  • Ability to create predefined patterns supported both in version matching and in pipeline, perhaps switching to Grok or even a proper lexical parser like PEG instead of just pure regex
  • Pass NAME as the name of the rule instead of the version (breaking change), this would allow for expanding the name of the rule into the pipeline
  • Support file-level patterns
  • The ability to run language specific tooling to generate the file diff
  • More advanced PR creation logic

To expand on each:

BCR Support

We use Bazel, I have already made the filter to support bcr: syntax, not much more to say. :)

Predefined patterns -> Switch Lexer

This would allow for creating a library of patterns, like for instance the regexp for semver is relatively complicated and it is a bit annoying to have to repeat it for every instance you need to use it. Currently I assume most people opt for a simpler than comprehensive pattern, but then it is also be annoying to have to change the pattern if you all of a sudden want to install the -pre1 version instead of the regular one.

Principally, I would prefer PEG, as it is more robust, has better multiline support and most languages and file formats have a PEG grammar defined. I can however see that Grok patterns would be a smaller step away from the current regex-based pipeline syntax that exists today and therefore I would love to hear your thoughts on this.

Passing down the rule name instead of the version as name

This would be more intuitive, that the key named name is actually the rule name, but also it would allow to create higher level patterns that would match multiple lines and do great. (i.e a powerful feature to enable "file-level patterns")

File-level patterns

What I mean with this is that in the Bumpfile you can prefix a whole file with a pattern or a series of patterns, and together with predefined patterns and passing down the rule name, you could easily make a very nice oneliner like this:

bazel_dep %{BCR}|@VERSION.MAJOR^
MODULE.bazel

here the syntax is group_name %{GROK_PATTERN} where grok_pattern could expand to the whole pipeline like this: %{BAZEL_DEP:NAME} /(%{SEMVER:VERSION}/ bcr:@NAME
This could also expand into the "link" and perhaps changelog parsing also.

Language-specific tooling

A lot of languages comes with pretty good, project level dependency update mechanisms, like rust comes with cargo update, python has things like pip-update etc. The good ones also allow you to "pin" versions directly in the dependency declaration file, similar to your pipeline implementation, but not all of them (I am looking at you golang).
Bump would in some cases just straight up run the update command without further ado to generate the diff and in other cases it would have to intervene (unsure how) to augment the current update behaviour to allow for semver pinning. In all cases it would have to understand the tool output however and interrogate the tool for changelogs and project links. This would be an extension of file-level patterns as I see it.

This would allow bump to own the entire version updating flow for a monorepo instead of me having to use bump for some things, then some nasty wrapper script for each language that we have that has good native support.
I would love to keep the Bumpfile and having to explicitly list each file that it manages still, this would just be another "group pattern" as I see it.

PR Creation logic

Here, for us, we would love to have the ability to do more advanced flows, like only having a single "update" branch active at a time and let it accumulate changes instead of one per bump run. This would really set bump apart from other very PR-creation-happy workflows, like dependabot and renovate.

We manage hundreds of software versions in our monorepo across 10s of file formats and, whilst using bump today would be a bit of a nightmare in terms of verbosity, I think these changes would together create an amazing version update tool that would also work for surprisingly large monorepos and allow for even nicer UX for smaller projects also.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions