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

Inherit tags from nodes for modular pipelines #1542

Merged
merged 5 commits into from
Sep 29, 2023

Conversation

rashidakanchwala
Copy link
Contributor

@rashidakanchwala rashidakanchwala commented Sep 27, 2023

Description

Resolves #795

Development notes

We tried solving this issue in the backend but the way modular pipelines is computed in the backend is very complex. I thought maybe we can try solving it in the FE using selectors.

In this PR, we have a new selector called getTagsforNodesAndModularPipelines.This selector identifies nodes associated with specific tags and then propagates these tags to the corresponding modular pipeline(s) (nested as well) for each node.

QA notes

I have also added some tags to the demo project so we can test this.

Checklist

  • Read the contributing guidelines
  • Opened this PR as a 'Draft Pull Request' if it is work-in-progress
  • Updated the documentation to reflect the code changes
  • Added new entries to the RELEASE.md file
  • Added tests to cover my changes

Copy link
Contributor

@ravi-kumar-pilla ravi-kumar-pilla 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. I do not see any lag in fetching tags but if we decide to update tags on FE, this should be good. I left a [Nit] comment for a method name but its non blocking.

/**
* Retrieves tags associated with both nodes and their corresponding modular pipelines.
*/
export const getTaggedNodesAndModularPipelines = createSelector(
Copy link
Contributor

Choose a reason for hiding this comment

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

can we rename this to getTagsForNodesAndModularPipelines ?

Copy link
Contributor

@SajidAlamQB SajidAlamQB left a comment

Choose a reason for hiding this comment

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

This makes more sense in the FE than in BE I am happy to go with this solution. 👍

Copy link
Member

@tynandebold tynandebold 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 and works well!

Two small nit comments from me. Also, make sure to sign your commits and make sure the Cypress tests are passing. For some reason, they're failing on your branch.

/**
* Retrieves tags associated with both nodes and their corresponding modular pipelines.
*/
export const getTagsforNodesAndModularPipelines = createSelector(
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
export const getTagsforNodesAndModularPipelines = createSelector(
export const getTagsForNodesAndModularPipelines = createSelector(

Comment on lines +56 to +57
const modularPipelineIDs = nodeModularPipelines[nodeID] || [];
modularPipelineIDs.forEach((modularPipelineID) => {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
const modularPipelineIDs = nodeModularPipelines[nodeID] || [];
modularPipelineIDs.forEach((modularPipelineID) => {
const modularPipelineIDs = nodeModularPipelines[nodeID] || [];
modularPipelineIDs.forEach((modularPipelineID) => {

Signed-off-by: ravi-kumar-pilla <ravi_kumar_pilla@mckinsey.com>
@rashidakanchwala rashidakanchwala merged commit 2b7e539 into main Sep 29, 2023
5 checks passed
@rashidakanchwala rashidakanchwala deleted the add-tags-for-modular-pipelines branch September 29, 2023 12:07
@tynandebold tynandebold mentioned this pull request Oct 10, 2023
5 tasks
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.

How to best display tags with modular pipelines
4 participants