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

Move topology from dev-console to its own monorepo #7254

Merged

Conversation

jeff-phillips-18
Copy link
Member

Fixes:
https://issues.redhat.com/browse/ODC-5037

Solution Description:
Created a new topology package, moved code from dev-console package there.

Non-functional change.

Browser conformance:

  • Chrome
  • Firefox
  • Safari
  • Edge

/kind cleanup

@openshift-ci-robot openshift-ci-robot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. component/core Related to console core functionality labels Nov 18, 2020
@openshift-ci-robot openshift-ci-robot added component/dev-console Related to dev-console component/knative Related to knative-plugin component/kubevirt Related to kubevirt-plugin component/shared Related to console-shared labels Nov 18, 2020
@jeff-phillips-18
Copy link
Member Author

/test analyze

@jeff-phillips-18
Copy link
Member Author

/retest

@jeff-phillips-18 jeff-phillips-18 force-pushed the topology-package branch 2 times, most recently from 45d6d82 to 478ec68 Compare November 19, 2020 19:05
@@ -1,7 +1,7 @@
import * as React from 'react';
import * as cx from 'classnames';
import { NamespaceBar } from '@console/internal/components/namespace';
import ApplicationSelector from './dropdown/ApplicationSelector';
import { NamespaceBarApplicationSelector } from '@console/topology/src';
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit:

Suggested change
import { NamespaceBarApplicationSelector } from '@console/topology/src';
import { NamespaceBarApplicationSelector } from '@console/topology';

{!hideApplications && <ApplicationSelector disabled={disabled} />}
{!hideApplications && <NamespaceBarApplicationSelector disabled={disabled} />}
Copy link
Contributor

Choose a reason for hiding this comment

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

🤔 Is this PR not just a refactor... why the change in component usage?

Copy link
Member Author

Choose a reason for hiding this comment

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

There were two different ApplicationSelector components, one in shared one in dev-console. Both are now in topology (since the use the topology data retrieval) and this one was renamed.

Copy link
Contributor

Choose a reason for hiding this comment

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

Gotcha. Thanks for the clarification!

@@ -1,6 +1,6 @@
import { K8sResourceKind } from '@console/internal/module/k8s';
import { ServiceModel } from '@console/knative-plugin';
import { UNASSIGNED_KEY } from '../../../const';
import { UNASSIGNED_KEY } from '@console/topology/src/const';
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit:

Suggested change
import { UNASSIGNED_KEY } from '@console/topology/src/const';
import { UNASSIGNED_KEY } from '@console/topology';

@@ -10,7 +10,7 @@ import { DeploymentConfigModel, DeploymentModel } from '@console/internal/models
import { hasIcon } from '@console/internal/components/catalog/catalog-item-icon';
import { ServiceModel } from '@console/knative-plugin';
import { Pipeline } from '@console/pipelines-plugin/src/utils/pipeline-augment';
import { UNASSIGNED_KEY } from '../../const';
import { UNASSIGNED_KEY } from '@console/topology/src/const';
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit:

Suggested change
import { UNASSIGNED_KEY } from '@console/topology/src/const';
import { UNASSIGNED_KEY } from '@console/topology';

@@ -16,5 +16,3 @@ const CheIcon: React.FC<React.HTMLProps<SVGElement>> = ({ style }): React.ReactE
</svg>
);
};

export default CheIcon;
Copy link
Contributor

Choose a reason for hiding this comment

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

Sole component file should have a default export... why the change?

Recommend you undo.

@@ -111,5 +111,3 @@ const SvgBoxedText: React.FC<SvgBoxedTextProps> = ({
</g>
);
};

export default SvgBoxedText;
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here

@@ -1,4 +1,6 @@
import { STORAGE_PREFIX } from '@console/shared';
import { STORAGE_PREFIX } from '@console/shared/src/constants/common';
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
import { STORAGE_PREFIX } from '@console/shared/src/constants/common';
import { STORAGE_PREFIX } from '@console/shared';

@@ -29,5 +29,3 @@ const DataModelProvider: React.FC<DataModelProviderProps> = ({ namespace, childr
</ModelContext.Provider>
);
};

export default DataModelProvider;
Copy link
Contributor

Choose a reason for hiding this comment

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

Default export

const ModelContext = createContext<ExtensibleModel>(null);

export default ModelContext;
export const ModelContext = createContext<ExtensibleModel>(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 would think this should still be a default export but it's odd it was put into a variable first.

default export createContext<ExtensibleModel>(null);

Copy link
Member Author

Choose a reason for hiding this comment

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

There are multiple exports.

Copy link
Contributor

Choose a reason for hiding this comment

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

😕 Sure, but in these 3 lines, it didn't need to create a variable to do a default export -- but I think you handled this in your last change, so it's moot now.

import { TopologyViewType } from '@console/dev-console/src/components/topology/topology-types';
import { STORAGE_PREFIX } from '@console/shared';
import { TopologyPage } from '@console/topology';
import { TopologyViewType } from '@console/topology/src/topology-types';
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
import { TopologyViewType } from '@console/topology/src/topology-types';
import { TopologyViewType } from '@console/topology';

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 21, 2020
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 23, 2020
Copy link
Contributor

@andrewballantyne andrewballantyne left a comment

Choose a reason for hiding this comment

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

frontend/packages/topology/src/index.ts is an empty file. Perhaps delete?

import { InputField } from '@console/shared';
import { useTranslation } from 'react-i18next';
import ApplicationSelector from '@console/topology/src/components/dropdowns/ApplicationSelector';
import FormSection from '@console/dev-console/src/components/import/section/FormSection';
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: move these back up to where the other calls were.


describe('TopologySideBar:', () => {
const props: TopologySideBarProps = {
Copy link
Contributor

Choose a reason for hiding this comment

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

hmmm... this could be to our loss if the type changes shape.

Copy link
Member Author

Choose a reason for hiding this comment

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

we'd get compile errors or test failures. A lot of tests don't use prop types.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah okay, no worries.

Comment on lines 4 to 7
import { useExtensions } from '@console/plugin-sdk/src';
import { isTopologyDataModelFactory, TopologyDataModelFactory } from '../../extensions';
import { WatchK8sResources } from '@console/internal/components/utils/k8s-watch-hook';
import { getBaseWatchedResources } from '../../data-transforms/transform-utils';
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: sort.

@andrewballantyne
Copy link
Contributor

/lgtm

Tested various things on Topology (adding items and seeing if sidebars loaded and pods spooled up and all the normal touch points I could think of) looks like the refactor didn't cause any issues as far as I can tell.

Nits are nice to haves, but I don't think they change the merge-ability of this PR.

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 23, 2020
@christianvogt
Copy link
Contributor

/approve

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 23, 2020
@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Nov 23, 2020
Copy link
Contributor

@andrewballantyne andrewballantyne left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 23, 2020
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andrewballantyne, christianvogt, jeff-phillips-18

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit 81c9159 into openshift:master Nov 24, 2020
@spadgett spadgett added this to the v4.7 milestone Nov 30, 2020
@jeff-phillips-18 jeff-phillips-18 deleted the topology-package branch December 2, 2020 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. component/core Related to console core functionality component/dev-console Related to dev-console component/knative Related to knative-plugin component/kubevirt Related to kubevirt-plugin component/shared Related to console-shared kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants