-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
ui: Add Stores page to React UI #2754
Conversation
Signed-off-by: Prem Kumar <[email protected]>
Signed-off-by: Prem Kumar <[email protected]>
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.
LGTM 🔥
It crashes for me because in my API response I have
There are some interesting
So, I'm certain that it has some weird |
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.
Code LGTM, just one suggestion/reminder. Awesome work! I like how simple the implementation is.
Returning string explicitly is a good idea. And yeah sure, I'll keep a note of it and fix this in a future PR. |
Signed-off-by: Prem Kumar <[email protected]>
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.
Shouldn't we add a minimum time constant and use it? Because now we check for that huge value in the min time column. And we should add both checks to both columns because sometimes those values might appear in different columns when we don't want StoreAPIs to match anything e.g. when Thanos Store doesn't find any blocks or cannot do its synchronization
I am not sure what do we need to use as Also, please correct me if I am wrong. What I understand from this is that we should check if a particular field is greater than |
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.
I guess this should be good to go, just need the tests like talked on Slack :P Since this PR is small enough, we can put them together. I can't comment personally on the React code's nuances because I don't know much about it so I think @squat should look more into that part. Awesome work!
Signed-off-by: Prem Kumar <[email protected]>
Signed-off-by: Prem Kumar <[email protected]>
Signed-off-by: Prem Kumar <[email protected]>
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.
Sorry for the late response! Played a bit with it, looks awesome. 🎉 ❤️ The tests are thorough and seem to cover all cases. It should be good to go, IMHO.
const td = row.find({ 'data-testid': 'lastCheck' }); | ||
expect(td).toHaveLength(1); | ||
|
||
if (parseTime(lastCheck) >= MAX_TIME) { |
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.
AFAICT the only condition that we don't check in the tests is this but we can add another case in a follow-up PR
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.
super good! only small comments but not blockers
@@ -10,7 +10,10 @@ interface NavConfig { | |||
} | |||
|
|||
const navConfig: { [component: string]: NavConfig[] } = { | |||
query: [{ name: 'Graph', uri: '/new/graph' }], | |||
query: [ | |||
{ name: 'Graph', uri: '/new/graph' }, |
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.
Can't wait till we can get rid of the"new" prefix :)
return ( | ||
<ListGroup> | ||
{labelSet.map(({ labels }, idx) => ( | ||
<ListGroupItem key={idx}> |
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.
One thing, for consistency let's try to use the same variable named for common things like indexes in loops. Not sure about the rest of the tsx codebase in the repo but let's just pick either i or idx
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.
We haven't found any other loops that use some other name and other code uses idx
as well
<StoreLabels labelSets={labelSets} /> | ||
</td> | ||
<td data-testid="minTime"> | ||
{minTime >= MAX_TIME ? <FontAwesomeIcon icon={faInfinity} /> : formatTime(minTime)} |
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.
strictly speaking should this rather be >
instead of >=
?
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.
Talked about this in our sync - this is OK for now. It would be worth investigating whether momentjs has some kind of constant or function that we could compare against i.e. highest possible date that it supports.
{minTime >= MAX_TIME ? <FontAwesomeIcon icon={faInfinity} /> : formatTime(minTime)} | ||
</td> | ||
<td data-testid="maxTime"> | ||
{maxTime >= MAX_TIME ? <FontAwesomeIcon icon={faInfinity} /> : formatTime(maxTime)} |
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.
same
* upstream/release-0.14: (46 commits) Cut release v0.14.0-rc.1 (thanos-io#2853) Query: correctly marshal errors to JSON and ignore if nil (thanos-io#2848) ci: Manually download promu in crossbuild stage (thanos-io#2828) Cut release v0.14.0-rc.0 (thanos-io#2826) Soft cut changelog on master to indicate v0.14.0 being in progress (thanos-io#2824) Update ThanosReceiveNoUpload to select sum == 0 (thanos-io#2819) receive: Added more observability, fixed leaktest, to actually check leaks ): (thanos-io#2817) Query: always return a string in the `lastError` field (thanos-io#2809) Added missing CHANGELOG entry for PR 2613 (thanos-io#2820) receive: Fixed small options race; Removed unused StartTime feature. (thanos-io#2816) go.mod: Bump Prometheus to current latest (thanos-io#2814) Implement CLI Flags page in React UI (thanos-io#2796) Improve ThanosReceiveNoUpload to only alert on current instances store: Preallocate output buffer when encoding postings. (thanos-io#2812) compact: introduce flag --block-viewer.global.sync-block-interval (thanos-io#2752) docs: compact: add blurb about how retention policy works (thanos-io#2808) Reduced memory allocations in readIndexRange() (thanos-io#2807) ui: Add Stores page to React UI (thanos-io#2754) Added Kemal to Maintainer Role; Kemal is volounteering to be next release shephard (thanos-io#2804) proposal: Add scalable rule storage proposal (thanos-io#2661) ...
Changes
Verification
Tested locally using both development build of react and the
thanos
binary with production build of react.