Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API for common ancestor #1442

Open
ikonst opened this issue May 2, 2024 · 3 comments
Open

API for common ancestor #1442

ikonst opened this issue May 2, 2024 · 3 comments
Labels

Comments

@ikonst
Copy link

ikonst commented May 2, 2024

IIUC, danger.git.base is

  • master on local
  • base branch's current sha on CI

A common ancestor with base is useful to compare against the starting point of a PR.

For example, consider checking a change to an API being backwards compatible. In my PR, I'm adding a field foo which is a backward compatible change. It's possible that someone else has merged a change to the base branch adding field bar. My PR is not removing field bar but if I compare the two files naively, it would appear as if my PR removes field bar.

In terms of git, it's essentially the result of git merge-base ${danger.git.head} ${danger.git.base}.

@ikonst ikonst added the bug label May 2, 2024
@orta
Copy link
Member

orta commented May 2, 2024

This might be hard to do across all hosting platforms (as that usually lives in the API of github/gitlab etc) but you're welcome to try give it a shot on one or two if there's APIs you can find for it

@ikonst
Copy link
Author

ikonst commented May 3, 2024

Normally danger runs without assuming a local deep clone git repo?

@orta
Copy link
Member

orta commented May 3, 2024

It runs without assuming local access to git at all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants