Skip to content
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

Zs sortbyseconds #14923 #15728

Merged
merged 7 commits into from
Nov 5, 2019
Merged

Zs sortbyseconds #14923 #15728

merged 7 commits into from
Nov 5, 2019

Conversation

zoesteinkamp
Copy link
Contributor

Closes #14923

Describe your proposed changes here.

  • CHANGELOG.md updated with a link to the PR (not the Issue)
  • Well-formatted commit messages
  • Rebased/mergeable
  • Tests pass
  • http/swagger.yml updated (if modified Go structs or API)
  • Documentation updated or issue created (provide link to issue/pr)
  • Signed CLA (if not already signed)

@zoesteinkamp zoesteinkamp requested a review from a team November 4, 2019 16:40
@ghost ghost requested review from desa and hoorayimhelping and removed request for a team November 4, 2019 16:40
Copy link
Contributor

@hoorayimhelping hoorayimhelping left a 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, nice work with the tests!

added a comment about a potential minefield with the sorting code.

@@ -89,7 +126,7 @@ describe('Buckets', () => {
.click()
})

it('closes the overlay upon a successful delete with predicate submission', () => {
it.skip('closes the overlay upon a successful delete with predicate submission', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add a quick comment here explaining why we're skipping this please?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding in comment! im going to make a new issue to address this failing test and another

ui/src/buckets/components/BucketsTab.tsx Outdated Show resolved Hide resolved
@@ -26,7 +26,7 @@ import {SortTypes} from 'src/shared/utils/sort'
// Utils
import {prettyBuckets} from 'src/shared/utils/prettyBucket'

type SortKey = keyof PrettyBucket
type SortKey = keyof PrettyBucket | 'retentionRules[0].everySeconds'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is kind of setting off a spidey sense - seems like we're coupling the state and shape of our redux store to a value type - the end result is that the sorting code relies on the precise shape and existence of the store having a first item in retentionRules with an everySeconds value. if any of that isn't there or the shape changes (maybe the api gets updated), this could very likely break.

here's the thing though, i know you didn't make this pattern, and i don't know of a better way to do this without changing a lot of code, so i can't really do more than say keep en eye out on this sorting code cause it might break unexpectedly. (said without judgement of the quality of the code or the circumstances it was written under :))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hopefully is things go south the tests will catch it, but yeah it is slightly concerning, but i dont think right now is the time to refactor all the logic. Well keep an eye to see if any related issues rear their head

@zoesteinkamp zoesteinkamp merged commit 23bf899 into master Nov 5, 2019
@zoesteinkamp zoesteinkamp deleted the zs-sortbyseconds-#14923 branch November 5, 2019 00:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants