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

Rerendering cluster names #769

Merged
merged 11 commits into from
Jul 14, 2022
Merged

Rerendering cluster names #769

merged 11 commits into from
Jul 14, 2022

Conversation

Kristian-A
Copy link
Contributor

@Kristian-A Kristian-A commented Jul 11, 2022

Description

Added cluster names to the object used for generating the ETag so renaming clusters would trigger a new work request. The ETag cached in the browser would no longer match the ETag that would be generated when a cluster name changes so a new work request would be sent and the cache would be updated. This fixes the problem with the dot plot not showing the new cluster names due to the one in cache being used. Staging deployment: https://ui-kristian-ui769.scp-staging.biomage.net/ (bypassing the integration tests).

Details

URL to issue

https://biomage.atlassian.net/browse/BIOMAGE-2013

Link to staging deployment URL (or set N/A)

N/A

Integration test branch

master

Merge checklist

Your changes will be ready for merging after all of the steps below have been completed.

Code updates

Have best practices and ongoing refactors being observed in this PR

  • Migrated any selector / reducer used to the new format.

Manual/unit testing

  • Tested changes using InfraMock locally or no tests required for change, e.g. Kubernetes chart updates.
  • Validated that current unit tests for code work as expected and are sufficient for code coverage or no unit tests required for change, e.g. documentation update.
  • Unit tests written or no unit tests required for change, e.g. documentation update.

Integration testing

You must check the box below to run integration tests on the latest commit on your PR branch.
Integration tests have to pass before the PR can be merged. Without checking the box, your PR
will not pass the required status checks for merging.

  • Started end-to-end tests on the latest commit.

Documentation updates

  • Relevant Github READMEs updated or no GitHub README updates required.
  • Relevant Wiki pages created/updated or no Wiki updates required.

Optional

  • Staging environment is unstaged before merging.
  • Photo of a cute animal attached to this PR.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 11, 2022

📦 Next.js Bundle Analysis

This analysis was generated by the next.js bundle analysis action 🤖

⚠️ Global Bundle Size Increased

Page Size (compressed)
global 516.83 KB (🟡 +187 B)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

@codecov
Copy link

codecov bot commented Jul 11, 2022

Codecov Report

Merging #769 (7e3d585) into master (0bbf8bb) will increase coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #769      +/-   ##
==========================================
+ Coverage   83.40%   83.42%   +0.02%     
==========================================
  Files         462      462              
  Lines        7850     7861      +11     
  Branches     1535     1537       +2     
==========================================
+ Hits         6547     6558      +11     
  Misses       1249     1249              
  Partials       54       54              
Impacted Files Coverage Δ
...[experimentId]/plots-and-tables/dot-plot/index.jsx 93.61% <ø> (ø)
src/utils/work/generatePlotWorkBody.js 100.00% <ø> (ø)
...redux/actions/componentConfig/fetchPlotDataWork.js 100.00% <100.00%> (ø)
src/utils/work/fetchWork.js 91.30% <100.00%> (+0.39%) ⬆️

Continue to review full report at Codecov.

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

@Kristian-A Kristian-A marked this pull request as ready for review July 11, 2022 15:16
Copy link
Contributor

@aerlaut aerlaut left a comment

Choose a reason for hiding this comment

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

I think it's better to insert clusterNames into the work request body of this plot. The work request body is hashed to get the ETag, changes to the clusterNames would change the work request body and the Etag. I suggest you make the changes inside generatePlotWorkBody

const {
loading: cellSetsLoading,
error: cellSetsError,
hierarchy: cellSetHierarcy,
properties: cellSetProperties,
} = cellSets;


const clusterNames = Object.values(cellSetProperties).map((el) => el.name);
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 think you should get the values here clusterNames here. Implementing it here would add another parameter to be passed to fetchPlotDataWork. I think it would be better to attach clusterNames inside the body request body that's generated for this plot.

extras = undefined,
timeout = 180,
broadcast = false,
clusterNames = undefined,
Copy link
Member

@ivababukova ivababukova Jul 12, 2022

Choose a reason for hiding this comment

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

why not using these optionals and extras and adding the cluster names in them?

Copy link
Member

Choose a reason for hiding this comment

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

FetchWork function is used for fetching every work, clusterNames are something specific to just some of the fetchWork calls, then why would we want to introduce a new parameter for fetchWork that is relevant only to some work types?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is exactly Agi's point which I agree with. I put the cluster names in the dot plot's work body where they are relevant. I also didn't like how I did it initially but was not sure how to pass them otherwise. I think now it should be good

src/redux/actions/componentConfig/fetchPlotDataWork.js Outdated Show resolved Hide resolved
@@ -9,17 +9,18 @@ const composeDotPlotWorkBody = (config) => {
numberOfMarkers: config.nMarkerGenes,
customGenesList: config.selectedGenes,
groupBy: config.selectedCellSet,
clusterNames,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it would be good to put clusterNames as the last entry in the body and put a comment, saying that this property is added to make the worker reload if there are changes to the cluster name. The comment would be useful because the property is not used for the calculation,

@Kristian-A Kristian-A merged commit 6a6f371 into master Jul 14, 2022
@Kristian-A Kristian-A deleted the rerendering-cluster-names branch July 14, 2022 14: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
Development

Successfully merging this pull request may close these issues.

3 participants