-
-
Notifications
You must be signed in to change notification settings - Fork 229
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
🐛 (explorer) merge configs correctly #4091
Open
sophiamersmann
wants to merge
1
commit into
master
Choose a base branch
from
fix-explorer-config-merge
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+147
−75
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @sophiamersmann and the rest of your teammates on Graphite |
sophiamersmann
force-pushed
the
fix-explorer-config-merge
branch
from
October 30, 2024 11:48
024ee62
to
556664d
Compare
Quick links (staging server):
Login:
SVG tester:Number of differences (default views): 0 ✅ Edited: 2024-10-30 12:03:55 UTC |
sophiamersmann
force-pushed
the
fix-explorer-config-merge
branch
5 times, most recently
from
October 30, 2024 15:54
c6b0715
to
3597b31
Compare
2 tasks
sophiamersmann
force-pushed
the
fix-explorer-config-merge
branch
5 times, most recently
from
October 31, 2024 16:12
7d455e6
to
adf0264
Compare
This was referenced Oct 31, 2024
sophiamersmann
force-pushed
the
log-explorer-views
branch
from
October 31, 2024 16:13
dd55a5e
to
92bd6c7
Compare
sophiamersmann
force-pushed
the
fix-explorer-config-merge
branch
from
October 31, 2024 16:13
adf0264
to
a3b1e38
Compare
sophiamersmann
force-pushed
the
log-explorer-views
branch
from
November 1, 2024 10:11
92bd6c7
to
7fcadf9
Compare
sophiamersmann
force-pushed
the
fix-explorer-config-merge
branch
from
November 1, 2024 10:11
a3b1e38
to
fce4f27
Compare
sophiamersmann
changed the base branch from
log-explorer-views
to
graphite-base/4091
November 1, 2024 15:19
sophiamersmann
force-pushed
the
fix-explorer-config-merge
branch
from
November 4, 2024 14:38
fce4f27
to
26ae780
Compare
sophiamersmann
force-pushed
the
graphite-base/4091
branch
from
November 4, 2024 14:38
7fcadf9
to
17e34b8
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Explorers incorrectly merge (partial) Grapher configs with explorer-level Grapher settings.
We naively merge configs like this
where
partialGrapherConfig
is the indicator config (of typeGrapherInterface
), butexplorerProgram.grapherConfigOnlyGrapherProps
is of typeExplorerGrapherInterface
that includes explorer-flavoured flat config fields, likeyAxisMin
. Overwriting the y-axis min of the partial Grapher config, which is given asyAxis.min
, thus won't work.Bug
I don't know of an example in the wild where this currently leads to a problem, but you can fabricate a bug locally by following these steps:
Set
yAxis.min
of an indicator that is used in the conflict explorer by runningagainst your local database.
Navigate to this view of the conflict explorer. Note that
I ran the same query against the database on staging. You'll see that on staging Grapher's y-axis min is correctly set to 0 (staging).
Solution
Before the explorer's Grapher config gets merged with the partial config, we translate explorer-specific fields to valid GrapherInterface fields, e.g.
yAxisMin
is translated to{ yAxis: { min: ... } }
. This is defined by thetoGrapherObject
function of an explorer cell definition.The
toGrapherObject
function is conceptually similar to theparse
function. Alternatively, I could have reworked theparse
function so that the given key/value pair is always parsed as a valid GrapherInterface object. Maybe that would have been the cleaner solution? I'm not sure. In the end, I went with thetoGrapherObject
function because I thought it would be useful to keep both Grapher row representations around:explorerGrapherConfig
: explorer-flavoured settings that directly map to a Grapher rowgrapherConfig
: corresponding chart config that is guaranteed to be a valid GrapherInterfaceTesting
Since I don't know of any bugs in the wild (doesn't mean they don't exist though), these changes should not result in any visual changes.