Skip to content

Snapshot feature improvement #324

Description

@Lore0599

bender snapshot: preserve original source URL

Pitfall

When using bender clone, the local copy of a dependency is created under working_dir. In the Bender.lock, the dependency source is typically stored using the original HTTPS URL, for example:

source = "https://github.com/owner/repo.git"

However, during local development, it is common to manually change the Git remote of the cloned dependency from HTTPS to SSH:

git remote set-url origin git@github.com:owner/repo.git

After finishing the implementation, I usually go back to the parent project and run:

bender snapshot

This correctly updates the locked revision in Bender.lock to the latest commit of the local dependency. However, it also updates the dependency source URL from HTTPS to SSH, for example:

source = "git@github.com:owner/repo.git"

This can later break bender checkout.

Expected behavior

It would be useful if bender snapshot updated only the locked revision, while preserving the original source URL from the existing Bender.lock or Bender.yml.

Motivation

This would make the local development workflow smoother:

  1. bender clone dependencies.
  2. Change the local dependency remote to SSH to push development changes.
  3. Implement and push changes.
  4. Run bender snapshot in the parent project.
  5. Commit the updated Bender.lock.

At the moment, step 4 also changes the source URL, which can accidentally make the lock file less portable and break checkout for other users or CI.

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions