Skip to content

Conversation

@lynnagara
Copy link
Member

@lynnagara lynnagara commented Jan 11, 2018

Also makes "All environments" the default if one is not set, and none of the names matches the list of likely production names

@lynnagara lynnagara requested a review from a team January 12, 2018 02:03
Copy link
Contributor

@MaxBittker MaxBittker left a comment

Choose a reason for hiding this comment

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

this looks good to me, but I didn't run it locally yet and it's pretty important. could you add some tests to ensure that the change gets propagated and re-runs the search? (might be a hard jest test to write so I can help)

let access = new Set(org.access);
let allEnvironmentsLabel = t('All environments');

// TODO: remove when feature is released
Copy link
Contributor

Choose a reason for hiding this comment

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

add your name to the TODO?

@lynnagara lynnagara force-pushed the env-stream-view branch 2 times, most recently from 5a3ac13 to ea18e50 Compare January 19, 2018 00:00
@ghost
Copy link

ghost commented Jan 19, 2018

1 Warning
⚠️ You should update CHANGES due to the size of this PR

Generated by 🚫 danger

@MaxBittker
Copy link
Contributor

is this rdy to merge?

@lynnagara lynnagara added the WIP label Jan 24, 2018
@lynnagara
Copy link
Member Author

lynnagara commented Jan 24, 2018

@MaxBittker No, I'm gonna come back to this when we decide what to do with saved searches and environments. Labelled as WIP

@lynnagara lynnagara removed the WIP label Jan 30, 2018
@lynnagara lynnagara force-pushed the env-stream-view branch 2 times, most recently from 2906ef9 to 439bcc8 Compare January 31, 2018 19:26
Copy link
Contributor

Choose a reason for hiding this comment

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

good to tag these with your name so you can find them more easily

@lynnagara lynnagara force-pushed the env-stream-view branch 2 times, most recently from 425a16d to 6df0954 Compare February 1, 2018 00:44
Copy link
Contributor

@MaxBittker MaxBittker left a comment

Choose a reason for hiding this comment

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

the code itself looks good, and it's really important for dense, important logic like this to be rigorously tested. that being said, i know we had a lot of problems with the tests here I think it's pragmatic to safely merge this behind a feature flag, leave a commit message explaining the change in behavior, do manual testing, and follow up with fixed tests


// you cannot apply both a query and a saved search (our routes do not
// support it), so the searchId takes priority
let nextSearchId = nextProps.params.searchId || null;
Copy link
Contributor

Choose a reason for hiding this comment

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

would you make this comment a tiny bit more verbose as well? this logic is complicated and i think we'll be glad in the future :o


let url = this.getGroupListEndpoint();

let query = this.state.query.replace(/^\s+|\s+$/g, '');
Copy link
Contributor

Choose a reason for hiding this comment

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

example transform in a comment to explain the regex for people skimming?

let query = this.state.query.replace(/^\s+|\s+$/g, '');

let activeEnvironment = this.state.activeEnvironment;
let activeEnvName = activeEnvironment ? activeEnvironment.name : null;
Copy link
Contributor

Choose a reason for hiding this comment

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

i'd prefer this to be activeEnvironment && activeEnviroment.name unless the null is needed to make it work?

Copy link
Contributor

Choose a reason for hiding this comment

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

(nit)

Copy link
Member Author

Choose a reason for hiding this comment

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

It doesn't make a difference but I thought null is a more correct value than false

Copy link
Contributor

Choose a reason for hiding this comment

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

ok, you're right then

};

// Always keep the global active environment in sync with the queried environment
// The global environment wins unless there one is specified by the saved search
Copy link
Contributor

Choose a reason for hiding this comment

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

helpful comment, thank you 🗣

Copy link
Contributor

Choose a reason for hiding this comment

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

although you you mind labeling the branches of the if? like moving your comment
The global environment wins unless there one is specified by the saved search
inside one of them to show explicity which branch it is. (nit )

...queryToObj(this.state.query),
environment: environment.name,
});
} else {
Copy link
Contributor

Choose a reason for hiding this comment

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

again, maybe label these branches explicitly? i know the comment above is doing it, but labeled if branches help a lot when reading dense logic like this IMO

@lynnagara lynnagara merged commit 0c98030 into master Feb 2, 2018
@lynnagara lynnagara deleted the env-stream-view branch February 2, 2018 18:57
@github-actions github-actions bot locked and limited conversation to collaborators Dec 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants