-
Notifications
You must be signed in to change notification settings - Fork 17
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
feat: Grab flags in IndirectChangesTable and pass along with request #2335
feat: Grab flags in IndirectChangesTable and pass along with request #2335
Conversation
✅ Deploy Preview for gazebo-staging ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@@ -162,6 +181,18 @@ function IndirectChangesTable() { | |||
} | |||
|
|||
if (isEmpty(indirectChangedFiles)) { | |||
if ( | |||
isArray(flags) || | |||
(commit?.compareWithParent?.__typename === 'Comparison' && |
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.
Consider moving these 2 lines into a helper method that takes in commit info and the impactedFiles?.__typename
to compare against along with lines 177-178. This way you can avoid the nested conditionals and also reduce some repeated code.
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'm happy to pull out the conditional. Regarding the repeated code, I personally disagree with the DRY principles quite a bit most of the time, if you're doing something quite a lot then I feel it's alright to pull stuff out into a helper function. However in this case here where I am only checking this condition twice I think it's quite overkill to pull it out into a little helper function. I also find it a lot easier to read the current implementation because it is quite explicit whereas if it's pulled out into a helper function, you as the developer now have to switch back and forth to understand the implementation of the helper function, causing a slightly increased dev cost.
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 agree with what you're saying 👍 . I did see a similar function here as well so I was curious. Happy to let you make the call. I would recommend getting an approval from someone else as I'm still getting up to speed with all the logic
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.
Thanks for the input @rohitvinnakota-codecov!
Yeah probably a bit early to pull out into it's own function although hard to tell in retrospect. If we feel we, conceptually, want to handle flag errors the same way regardless, might be good to make into it's own thing as changing it in the future would only imply changing it once (and potentially forgetting to change it everywhere). I'm all-in for what we think scales best over time
@@ -144,6 +162,7 @@ function IndirectChangesTable() { | |||
commitid: commitSha, | |||
filters: { | |||
hasUnintendedChanges: true, | |||
flags: flags, |
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.
Nitpick: flags
instead of flags:flags
…t-changes-commit-page
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #2335 +/- ##
=======================================
Coverage 97.25% 97.25%
=======================================
Files 721 721
Lines 8592 8604 +12
Branches 2058 2117 +59
=======================================
+ Hits 8356 8368 +12
+ Misses 234 233 -1
- Partials 2 3 +1
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
Codecov Report
@@ Coverage Diff @@
## main #2335 +/- ##
=======================================
Coverage 97.25% 97.25%
=======================================
Files 721 721
Lines 8592 8604 +12
Branches 2103 2066 -37
=======================================
+ Hits 8356 8368 +12
- Misses 233 234 +1
+ Partials 3 2 -1
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
Codecov Report
@@ Coverage Diff @@
## main #2335 +/- ##
=======================================
+ Coverage 97.25 97.26 +0.01
=======================================
Files 721 721
Lines 8592 8604 +12
Branches 2103 2068 -35
=======================================
+ Hits 8356 8368 +12
Misses 234 234
Partials 2 2
Continue to review full report in Codecov by Sentry.
|
…2335) Update indirect changes tab on the commit detail page to grab flags from the url params and pass along as query args. GH codecov/engineering-team#348
* first pass, wheeeeeo * Sorting functionality * Update with tests * wrap up repos list: * Spelling correction (#2336) * 616 add patch setction pr page team tier (#2337) * feat: add header component for team tier customers * feat: converted Header.jsx to Header.tsx + tests * fix: add comparison schema types * fix: Filter out certain browser from sending events to Sentry (#2338) Filter out events for a given browser because they don't have all JS functions fully implemented causing issues that we cannot address. * feat: Hide Flag MultiSelect when on Team Plan on Commit Detail Page (#2327) We will need to hide the flag multi select on the commit detail page when the user is on the team plan as they are not an available feature to those users. GH codecov/engineering-team#687 * feat, ref: Disable Flag MultiSelect on Coverage Tab when on a Team Plan (#2329) Disable the flag multi-select on the coverage tab when users/orgs are on a team plan. GH codecov/engineering-team#685 * feat: Grab flags in IndirectChangesTable and pass along with request (#2335) Update indirect changes tab on the commit detail page to grab flags from the url params and pass along as query args. GH codecov/engineering-team#348 * feat: Update CommitDetailPage FilesChangedTable to pass along flags (#2334) Update the files changed tab on the commit detail page to grab flags url param and pass along as query args. GH codecov/engineering-team#347 * ref: Update TOS to work for service less users. (#2321) * Update with service less requests * Make sure hook supports service less * feat: Add Flag MultiSelect to CommitPageTabs (#2303) Add a feature flagged multi select to the CommitPageTabs component. GH codecov/engineering-team#344 * Add patch column to pulls table (#2308) * feat: add patch column to the pulls list page * uncomment development settings * feat: Create Team Plan Table for the Files Changed Table on the Commit Detail Page (#2309) Create new commit fetching hooks for the team plan, as well as creating a new table for files changed tab on the commit detail page for the new team plan. GH codecov/engineering-team#633 * Setup pull request page to pass around selected flags (#2282) * feat: setup pull request page to pass around selected flags in links * Feedback, fix passing links to files+folders, additional testing * fix file explorer test failing on href match due to new query param pass through * airplane commit, cant check local dev server: Resolve merge issues / tests + unify codebases missed of commitSHA and commitSha to just commitSha * Prevent multislect from collapsing + wire up PR details page to pass through flags links * Fix accidental removal of ref on usePrefetchPullFileEntry * Add patch column to pulls table (#2308) * feat: add patch column to the pulls list page * uncomment development settings * feat: Create Team Plan Table for the Files Changed Table on the Commit Detail Page (#2309) Create new commit fetching hooks for the team plan, as well as creating a new table for files changed tab on the commit detail page for the new team plan. GH codecov/engineering-team#633 --------- Co-authored-by: Adrian <adrian@codecov.io> Co-authored-by: nicholas-codecov <nicholas.deschenes@sentry.io> * chore: Remove segment from frontend (#2314) * Update with tests * test with support service less * adjust logic to handle original route * it's fine it works with no providers --------- Co-authored-by: nicholas-codecov <nicholas.deschenes@sentry.io> Co-authored-by: Adrian <adrian@codecov.io> Co-authored-by: Terry <87824812+terry-codecov@users.noreply.github.com> * restructure folders anticipating second header component for team tier (#2340) * feat: add hook for commit detail page team tier (#2341) * build: Update PostCSS (#2346) Update PostCSS dependency. * Migrate TextInput to TypeScript (#2342) * Migrate textinput to TS * Add story * formatting * organize imports * Connect flag selector to flags filter on PR details page (#2343) * feat: Update impacted files resolver for use pull, connect the flag selector to the api. * update missing logic as requested + unknown flags message to be aligned with repo overview design * Noticed the changing the pull query broke impacted files while smoke testing, dupicated the same compatibility work for the new resolver. * Refactor to use a impacted files enum as requested. * fix: Attempting to fix CommitDetailPage and RepoPage Tests (#2350) Addressing flaky tests in CommitDetailPage and RepoPage. * Add patch section commit detail page team tier (#2344) * restructure folders anticipating second header component for team tier * feat: add patch coverage section to commit detail page for team tier customer * fix: rename HeaderDefault to HeaderTeam for team file * Convert Sparkline to typescript (#2347) * Convert sparkline to typescript * Consistent type defs * better variable names * use enum * quick fixes * Update use memo * Update tests with getSortingOption * pull out the function of the test block --------- Co-authored-by: Joe Becher <joe@codecov.io> Co-authored-by: Adrian <adrian@codecov.io> Co-authored-by: nicholas-codecov <nicholas.deschenes@sentry.io> Co-authored-by: Terry <87824812+terry-codecov@users.noreply.github.com> Co-authored-by: Rohit Vinnakota <148245014+rohitvinnakota-codecov@users.noreply.github.com>
Description
This PR updates the indirect changes table on the commit detail page to pull the flags from the URL and pass them along with the request to filter out files that are not covered with the selected flags.
Closes codecov/engineering-team#348
Notable Changes
IndirectChangesTable
to pull flags from URL and pass along to request