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

Setup pull request page to pass around selected flags #2282

Merged

Conversation

terry-codecov
Copy link
Contributor

Description

Updates the pull request page to pass around the flags multi select url params through out regular navigation. This maintains the flag selection when traversing the tabbed navigation and files/folders.

Notable Changes

  • Use nav links was missing some tests so I also added them in
  • Some of dir/file links dont match the other navigation links, I left them as is to avoid a larger refactor but will likely need to address in the TS refactor cause that's not going to fly with the typings.

Screenshots

Link to Sample Entry

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. In 2022 this entity acquired Codecov and as result Sentry is going to need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

@codecov-staging
Copy link

codecov-staging bot commented Sep 23, 2023

Codecov Report

❗ No coverage uploaded for pull request base (main@882f9da). Click here to learn what that means.
The diff coverage is 100.00%.

❗ Current head 36b5415 differs from pull request most recent head bf91575. Consider uploading reports for the commit bf91575 to get more accurate results

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2282   +/-   ##
=======================================
  Coverage        ?   98.03%           
=======================================
  Files           ?      705           
  Lines           ?     8264           
  Branches        ?     1950           
=======================================
  Hits            ?     8102           
  Misses          ?      160           
  Partials        ?        2           
Files Coverage Δ
...stPage/PullRequestPageTabs/PullRequestPageTabs.jsx 100.00% <100.00%> (ø)
.../subroute/CommitsTab/CommitsTable/CommitsTable.jsx 100.00% <100.00%> (ø)
...e/subroute/CommitsTab/CommitsTable/Title/Title.jsx 100.00% <100.00%> (ø)
src/services/navigation/useNavLinks/useNavLinks.js 100.00% <100.00%> (ø)
...ntsTable/TableEntries/PullEntries/PullDirEntry.jsx 100.00% <100.00%> (ø)
...tsTable/TableEntries/PullEntries/PullFileEntry.jsx 100.00% <100.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 882f9da...bf91575. Read the comment docs.

@codecov-public-qa
Copy link

codecov-public-qa bot commented Sep 23, 2023

Codecov Report

Merging #2282 (bf91575) into main (882f9da) will increase coverage by 0.39%.
The diff coverage is 67.85%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2282      +/-   ##
==========================================
+ Coverage   34.09%   34.48%   +0.39%     
==========================================
  Files         659      659              
  Lines        8233     8284      +51     
  Branches     2020     2055      +35     
==========================================
+ Hits         2807     2857      +50     
- Misses       5397     5398       +1     
  Partials       29       29              
Files Coverage Δ
...Page/CommitDetailPageTabs/CommitDetailPageTabs.jsx 0.00% <ø> (ø)
...e/CommitDetailSummary/hooks/useCommitForSummary.js 100.00% <100.00%> (ø)
...ute/FileExplorer/hooks/useRepoPullContentsTable.js 86.36% <ø> (ø)
src/pages/RepoPage/utils/paths.js 100.00% <100.00%> (ø)
src/ui/MultiSelect/MultiSelect.jsx 0.00% <ø> (ø)
...ommitDetailPageContent/CommitDetailPageContent.jsx 0.00% <0.00%> (ø)
...ChangedTab/FilesChangedTable/FilesChangedTable.jsx 0.00% <0.00%> (ø)
...sTab/IndirectChangesTable/IndirectChangesTable.jsx 0.00% <0.00%> (ø)
...e/subroute/CommitsTab/CommitsTable/Title/Title.jsx 0.00% <0.00%> (ø)
src/services/navigation/useNavLinks/useNavLinks.js 98.50% <98.11%> (+8.26%) ⬆️
... and 7 more

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 882f9da...bf91575. Read the comment docs.

@netlify
Copy link

netlify bot commented Sep 23, 2023

Deploy Preview for gazebo-staging ready!

Name Link
🔨 Latest commit bf91575
🔍 Latest deploy log https://app.netlify.com/sites/gazebo-staging/deploys/652eca28faebe300087d0d2c
😎 Deploy Preview https://deploy-preview-2282--gazebo-staging.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@codecov
Copy link

codecov bot commented Sep 23, 2023

Codecov Report

Merging #2282 (bf91575) into main (882f9da) will increase coverage by 0.40%.
The diff coverage is 67.85%.

Impacted file tree graph

@@           Coverage Diff           @@
##            main   #2282     +/-   ##
=======================================
+ Coverage   34.09   34.49   +0.40     
=======================================
  Files        659     659             
  Lines       8233    8284     +51     
  Branches    2027    2048     +21     
=======================================
+ Hits        2807    2857     +50     
- Misses      5397    5405      +8     
+ Partials      29      22      -7     
Files Coverage Δ
...Page/CommitDetailPageTabs/CommitDetailPageTabs.jsx 0.00% <ø> (ø)
...e/CommitDetailSummary/hooks/useCommitForSummary.js 100.00% <100.00%> (ø)
...ute/FileExplorer/hooks/useRepoPullContentsTable.js 86.36% <ø> (ø)
src/pages/RepoPage/utils/paths.js 100.00% <100.00%> (ø)
src/ui/MultiSelect/MultiSelect.jsx 0.00% <ø> (ø)
...ommitDetailPageContent/CommitDetailPageContent.jsx 0.00% <0.00%> (ø)
...ChangedTab/FilesChangedTable/FilesChangedTable.jsx 0.00% <0.00%> (ø)
...sTab/IndirectChangesTable/IndirectChangesTable.jsx 0.00% <0.00%> (ø)
...e/subroute/CommitsTab/CommitsTable/Title/Title.jsx 0.00% <0.00%> (ø)
src/services/navigation/useNavLinks/useNavLinks.js 98.50% <98.11%> (+8.26%) ⬆️
... and 7 more

... and 6 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 882f9da...bf91575. Read the comment docs.

@terry-codecov terry-codecov force-pushed the 336-update-commitstab-to-grab-and-pass-selected-flags branch from 856f537 to 537d88b Compare September 24, 2023 03:09
@terry-codecov
Copy link
Contributor Author

terry-codecov commented Sep 24, 2023

Addresses #336

provider: p,
owner: o,
repo: r,
commit: c,
flags: [],
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be queryParams: {}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Missed from my previous version 😿 Will do

@codecov-qa
Copy link

codecov-qa bot commented Oct 4, 2023

Codecov Report

Merging #2282 (bf91575) into main (882f9da) will increase coverage by 0.39%.
The diff coverage is 67.85%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2282      +/-   ##
==========================================
+ Coverage   34.09%   34.48%   +0.39%     
==========================================
  Files         659      659              
  Lines        8233     8284      +51     
  Branches     1978     2006      +28     
==========================================
+ Hits         2807     2857      +50     
- Misses       5403     5405       +2     
+ Partials       23       22       -1     
Files Coverage Δ
...Page/CommitDetailPageTabs/CommitDetailPageTabs.jsx 0.00% <ø> (ø)
...e/CommitDetailSummary/hooks/useCommitForSummary.js 100.00% <100.00%> (ø)
...ute/FileExplorer/hooks/useRepoPullContentsTable.js 86.36% <ø> (ø)
src/pages/RepoPage/utils/paths.js 100.00% <100.00%> (ø)
src/ui/MultiSelect/MultiSelect.jsx 0.00% <ø> (ø)
...ommitDetailPageContent/CommitDetailPageContent.jsx 0.00% <0.00%> (ø)
...ChangedTab/FilesChangedTable/FilesChangedTable.jsx 0.00% <0.00%> (ø)
...sTab/IndirectChangesTable/IndirectChangesTable.jsx 0.00% <0.00%> (ø)
...e/subroute/CommitsTab/CommitsTable/Title/Title.jsx 0.00% <0.00%> (ø)
src/services/navigation/useNavLinks/useNavLinks.js 98.50% <98.11%> (+8.26%) ⬆️
... and 7 more

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 882f9da...bf91575. Read the comment docs.

Copy link
Contributor

@nicholas-codecov nicholas-codecov left a comment

Choose a reason for hiding this comment

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

Few more comments to take a peak at

@terry-codecov terry-codecov force-pushed the 336-update-commitstab-to-grab-and-pass-selected-flags branch from a38dfc0 to c627880 Compare October 17, 2023 14:04
Copy link
Contributor

@nicholas-codecov nicholas-codecov left a comment

Choose a reason for hiding this comment

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

One quick thing to peak at.

const { runPrefetch } = usePrefetchPullFileEntry({
path,
ref: commitSHA,
commitSha,
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see the usePrefetchPullFileEntry being updated in the PR so you'll still need to alias ref to the commitSha

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah shoot good catch, not sure how that happened. Ty

Copy link
Contributor

@nicholas-codecov nicholas-codecov left a comment

Choose a reason for hiding this comment

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

LGTM 👍

adrian-codecov and others added 3 commits October 17, 2023 14:46
* feat: add patch column to the pulls list page

* uncomment development settings
…t 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
@terry-codecov terry-codecov merged commit 584e86d into main Oct 17, 2023
@terry-codecov terry-codecov deleted the 336-update-commitstab-to-grab-and-pass-selected-flags branch October 17, 2023 18:06
@terry-codecov
Copy link
Contributor Author

Note: git history got a bit screwy here, I smoke tested everything is fine before deploying. Something was wrong with my IDE.

RulaKhaled pushed a commit that referenced this pull request Oct 18, 2023
* 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 <[email protected]>
Co-authored-by: nicholas-codecov <[email protected]>
RulaKhaled added a commit that referenced this pull request Oct 24, 2023
* 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 <[email protected]>
Co-authored-by: nicholas-codecov <[email protected]>

* 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 <[email protected]>
Co-authored-by: Adrian <[email protected]>
Co-authored-by: Terry <[email protected]>
RulaKhaled added a commit that referenced this pull request Oct 31, 2023
* 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 <[email protected]>
Co-authored-by: nicholas-codecov <[email protected]>

* 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 <[email protected]>
Co-authored-by: Adrian <[email protected]>
Co-authored-by: Terry <[email protected]>
RulaKhaled added a commit that referenced this pull request Nov 3, 2023
* 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 <[email protected]>
Co-authored-by: nicholas-codecov <[email protected]>

* 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 <[email protected]>
Co-authored-by: Adrian <[email protected]>
Co-authored-by: Terry <[email protected]>

* 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 <[email protected]>
Co-authored-by: Adrian <[email protected]>
Co-authored-by: nicholas-codecov <[email protected]>
Co-authored-by: Terry <[email protected]>
Co-authored-by: Rohit Vinnakota <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants