New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 687449 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Aug 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

Skipping dependency checks doesn't seem to work

Project Member Reported by mgiuca@chromium.org, Feb 1 2017

Issue description

We tried to land a CL with an upstream dependency (https://codereview.chromium.org/2639463002/#ps280001), and got the error:

This CL has an open dependency (Issue 2667803002 Patch 200001). Please resolve
the dependency and try again.
If you are sure that there is no real dependency, please use one of the options
listed in https://goo.gl/9Es4OR to land the CL.

It's a soft dependency (the two CLs don't actually depend on one another, but we needed to stack them locally in git so that a third CL could depend on them). So we should be able to land the dependent CL before its dependency, except that the CQ's dependency checking is blocking us.

1. NO_DEPENDENCY_CHECKS=true doesn't do what you want.

From the suggested documentation (https://goo.gl/9Es4OR), we tried NO_DEPENDENCY_CHECKS=true in the CL description first.

Expected behaviour: It applies this CL's diff against master, completely ignoring the dependency (like it used to do before the dependency system was put in place).
Actual behaviour: It attempts to land BOTH the upstream CL and this one at the same time. It failed due to not having LGTMs on the upstream CL. This is dangerous because if we did have LGTMs, we'd have landed two CLs in a single git commit with an invalid commit description.

2. git config branch.$BRANCHNAME.skip-deps-uploads True seems to have no effect.

We ran the above command locally on the downstream branch, and ran git cl upload. The result is https://codereview.chromium.org/2639463002/#ps300001. This patch set still has an upstream dependency. So that doesn't work.

The only way I can think of for landing this branch is to either a) mess around with git to actually physically remove all the deltas from the other CL and re-upload with no upstream, or b) wait until the upstream CL lands. Either way it's a time sink.
 

Comment 1 by rmis...@google.com, Feb 1 2017

Cc: rmis...@chromium.org tandrii@chromium.org
Owner: ----
1. NO_DEPENDENCY_CHECKS=true doesn't do what you want.
Yes, as the name suggests that keyword is only for CQ to skip the check of if there are any open dependencies. But apply_issue IIRC will still apply all dependencies when running tryjobs. CQ would have only landed the change in the CL and not the dependencies so it is not as dangerous as you described.

2. git config branch.$BRANCHNAME.skip-deps-uploads True seems to have no effect.
That should have worked. It is possible that recent changes broke it in depot_tools.

Since we are moving to Gerrit soon it makes sense to not fix this on Rietveld and just wait for Gerrit. IMO Gerrit has a much better structure for handling dependencies.
Components: -Infra>CQ Infra>SDK Infra>Codereview>Rietveld
Status: Available (was: Assigned)
What Rmistry@ said. 
Thanks for replies.

#1 number 1: I'm not clear on what NO_DEPENDENCY_CHECKS is for then. It seems (from your statement above) that this will correctly land the downstream CL if the upstream CL passes all checks (including having LGTMs), but it will refuse to land downstream if upstream isn't ready to land. Which sort of defeats the purpose (if upstream is ready to land, why not just land it first? The entire point of this, I thought, is if your downstream CL gets approved first, you can land it first if it doesn't actually require the upstream).

Number 2: Oh oh .... I just remembered something from the back of my memory about this which is extremely unintuitive: you have to put skip-deps-uploads on the PARENT branch, not the CHILD branch. I just tried it: it works on the parent but not the child.

That's really confusing and not documented. It also leads to some impossible-to-get-right situations: if you have parent branch A, with child branches B and C, let's say B doesn't really depend on A (you just had to set it up that way for some other reason), but C hard-depends on A. Under this regime, you need to set A.skip-deps-uploads = True, which removes both the A-B and the A-C dependency. You can't just remove the A-B dependency but not the A-C.

Anyway I agree it isn't worth fixing in Reitveld but hopefully both of these problems are resolved in Gerrit (or otherwise there is a convenient way to manage whether your git branches imply actual dependencies or not). Essentially I just want a way to opt-in to landing a git branch that is a child branch, before its parent, if I know what I'm doing. Cheers! (In the mean time, I will make some suggestions on that documentation for clarity.)
Also on NO_DEPENDENCY_CHECKS... if it works as you describe then it's dangerous for another reason, which is it isn't testing the code that actually lands.

Say we have branch A which has a child branch B, and B has NO_DEPENDENCY_CHECKS=true. Let's say the two CLs have no textual conflicts, but B soft-depends on A (i.e., it is broken in a subtle way without A, or maybe it fails tests without A). And both CLs have LGTMs.

If I check the commit box on CL B, it will apply patch A, then patch B, then run the try jobs on the combined patch, and the tests will pass. Then it does a presubmit check on both A and B and sees approvals. Then it will land *just* patch B, which will apply cleanly (textually) but introduce a bug because A has not landed. If it fails tests, those failures will only first appear on the waterfall.

Am I understanding it right? I can't think of a situation where NO_DEPENDENCY_CHECKS is both useful and safe.

Comment 5 by rmis...@google.com, Feb 1 2017

"Am I understanding it right? I can't think of a situation where NO_DEPENDENCY_CHECKS is both useful and safe."

It was added because of feedback from people who said they had dependent branches created but wanted an easy way to land their change regardless of the open dependency. Sometimes it was because the dependency was accidentally created and sometimes because they did not care about the dependency anymore. What you described could in theory happen but I have not heard of a single instance of that happening in the roughly 1.5 years that this has been live.

I will go through your doc changes soon (thanks for those!). Also reiterating that this will all be obsolete soon.

> people who said they had dependent branches created but wanted an easy way to
> land their change regardless of the open dependency. Sometimes it was because
> the dependency was accidentally created and sometimes because they did not care
> about the dependency anymore.

That's exactly what we want it for, but it seems it doesn't work because you need LGTMs on the parent branch (which if you "don't care about anymore", you are unlikely to have), so I'm not sure how this is useful. Maybe it used to work.

Anyway, I'll stop taking up your time with this because of the fact that it will be obsolete soon, no point discussing :)

Comment 7 by rmis...@google.com, Feb 2 2017

Yes you are right about the problem with OWNERS checks. I did hear complains about that occasionally but there was unfortunately no easy way to handle that. I think devs did not run into it that often because IIRC OWNERS checks are skipped during dry runs (so it has to be a real commit attempt), and the parent has to be touching files that require approval from different owners (which is probably not that common as well).
Status: WontFix (was: Available)
Closing in bulk due to Rietveld’s deprecation in favor of Gerrit. If you feel this bug should not have been closed, please feel free to re-open.

Sign in to add a comment