-
Notifications
You must be signed in to change notification settings - Fork 1
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
Fix upstream merge conflicts [DO NOT MERGE, just review] #62
Fix upstream merge conflicts [DO NOT MERGE, just review] #62
Conversation
as said in slack: The problem is this will either:
I think we need to merge in from HEAD unsquashed I think, and do the fixes in the single merge commit |
This comment has been minimized.
This comment has been minimized.
Maybe it helps to know how we keep https://github.com/grafana/mimir-prometheus/ up to date with github.com/prometheus/prometheus/ When we want to update mimir-prometheus with upstream changes, a separate PR is open, for example grafana/mimir-prometheus#287 This PR is always merged with a Merge commit not a squash. Then any changes performed on top of the mimir-prometheus fork are merged from separate prs and they can either be squashed commits or merged commits but usually they prefer squashed commits to keep 1 commit 1 pr parity. The benefits of this workflow is that you can always compare the fork to upstream and cherry pick any of the changes done in the fork in case you want to donate them back to upstream or just eventually sync up with upstream. |
@jesusvazquez are always all the merge conflicts fixes contained in the |
Ok this is what I'm thinking:
|
Any conflicts that may surface are addressed in the same PR as separate commits and then the entire PR is merged not squashed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ran out of steam but here are my comments so far
ret.Tags["name"] = metric | ||
ret.PathExpression = ret.Name | ||
ret.Values = a.Values | ||
======= | ||
name := part[len(part)-1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we not copying the tags or values?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those deleted lines were in our HEAD. Upstream deleted those and added the ret := a.CopyName(name)
a few lines below: msaf1980@cf1f002
(this is the problem with this reviewing approach, the upstream changes are a little hidden. But I think overall it's better than a ~300 files PR)
Want: []*types.MetricData{types.MakeMetricData("foo==.baz", | ||
[]float64{1, 2, 3, 4, 5}, 1, now32)}, | ||
}, | ||
// FIXME: I don't think `metric1.foo==.bar.baz` is a valid metric name, that is making this test fail |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please attach an Issue number to this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
}, | ||
}, | ||
// FIXME: I don't think `..foo==.bar` is a valid metric name, that is making these testsapi/cmd/carbonapi/ht fail |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ibid, same issue as above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
r := a.CopyLink() | ||
r.Name = tempName | ||
r.Tags["name"] = r.Name | ||
======= | ||
r := a.CopyName(tempName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does CopyName do the same changes that CopyLink did?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r := *a | ||
r.Name = "nPercentile(" + a.Name + "," + percentStr + ")" | ||
>>>>>>> upstream/main | ||
r := a.CopyLink() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In some places, CopyName is used, and in some, CopyLink is used. What is the difference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CopyName is a new helper function the upstream introduced, check the behavior here: https://github.com/grafana/carbonapi/blob/npazosmendez/sync-upstream-fix-conflicts/expr/types/types.go#L452
I think it could be avoided. (there's lots of helpers that do almost the same thing (and sometimes the same thing): Copy, CopyLink, CopyName, CopyTag, CopyLinkTags, etc etc etc).
But I think changing that is out of the scope of this PR, wanted to leave the upstream changes as clean as possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking forward to having CopyName
be available! There's a lot of places where I've seen something like this happening:
md := origMd.CopyLink()
md.Name = "new name"
...
The problem with that is that the "name" tag then doesn't get updated correctly, but it looks like CopyName
covers that.
@@ -2,6 +2,7 @@ package removeBelowSeries | |||
|
|||
import ( | |||
"context" | |||
"fmt" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this import being used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. The merge deleted it and I had to add it again to fix the build. The build would fail if it wasn't being used anyway.
@@ -2,6 +2,7 @@ package smartSummarize | |||
|
|||
import ( | |||
"context" | |||
"fmt" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the import being used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
Go coverage report: Click to expand.
Go lint report: No issues found. 😎 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
Original PR: #60
This PR has the same changes but with a different workflow to make review easier. This is what I did:
npazosmendez/sync-upstream2
and merged the upstream changes there. Commited everything blindly, with conflicts included.npazosmendez/sync-upstream2
I branched tonpazosmendez/sync-upstream-fix-conflicts
, where I compressed all the fixes to the conflicts in a single commit.npazosmendez/sync-upstream2
<--npazosmendez/sync-upstream-fix-conflicts
. This makes the diff of this PR just have the fixes to the conflicts and nothing elseOnce this PR is approved we can then merge
npazosmendez/sync-upstream2
intomain
.Note that I'm still missing some fixes. Those will come in separate commits, but the diff should still be clean.