question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pull Request behind the target branch causing issues

See original GitHub issue

By comparing a PR that may not have been rebased against the latest changes to master against master itself, graphql-inspector emits backwards compatibility warnings for any recently added fields, even though these fields won’t be removed by the PR. Although it’s possible to work around this by merging the latest master whenever this happens, this is a bit of a faff, especially given that GitHub doesn’t provide a button for doing this unless there’s a merge conflict.

Are there any tricks that would allow graphql-inspector to avoid showing these red herrings?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:16 (13 by maintainers)

github_iconTop GitHub Comments

2reactions
kamilkisielacommented, Sep 11, 2020

@wopian done, use master and try to run Inspector Action on pull_request event, when it’s on push it won’t get a PR number. I would recommend to use pull_request on PRs and push for master branch or something like that.

2reactions
dchamberscommented, Sep 30, 2019

I don’t understand why you want to do it. A Pull Request is defined to be merged into master, so you need to know if the PR won’t break anything. If you compare it to something different than what’s the point?

Could you explain a bit more? Maybe I don’t understand something?

Apologies @kamilkisiela, I managed to miss your reply here.

Suppose you have two developers, Bob & Sue, both working on the same codebase. They both pull the code at the same time to begin their work – let’s call the commit they start with #c0.

After a day, Sue commits a change where she adds a new field to the schema (Person.age for arguments sake), so that the latest commit on master is now #c1.

Bob then pushes a new feature that does not change the schema whatsoever, and so can’t possibly introduce a backwardly incompatible change. However, graphql-inspector compares his commit (which does not yet contain Person.age) against master, which does, and concludes that Bob is breaking backwards compatibility by removing the Person.age field.

Of course, he’s doing no such thing, and the problem is only that the latest version of master (containing commit #c1) was not merged into his branch before performing the comparison.

Hopefully that makes more sense now?

Read more comments on GitHub >

github_iconTop Results From Across the Web

GitHub pull request showing commits that are already in target ...
The target branch was behind master and the pull request showed commits from master, so I merged master and pushed it to GitHub,...
Read more >
Prevent Merge of Pull Requests Behind Target Branch
These types of PRs could cause the following problems: Conflicts make the branch not mergeable. Merge results are unknown since it has not...
Read more >
Commits missing from Pull Request merge on target branch
Problem. After merging a Pull Request the merge commit and commits from the source branch cannot be found on the destination branch.
Read more >
In GitHub, how do I resolve the issue 'This branch is n commits ...
Go to your GitHub profile and click on pull requests. Select the pull request you want to revert. Open it and at the...
Read more >
Problems with Pull Requests and How to Fix Them
The pull request is then used as a vehicle for code review, ... runs a git merge against the target branch behind the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found