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

Add Mesh page to OSSMC #309

Merged
merged 7 commits into from
May 21, 2024
Merged

Add Mesh page to OSSMC #309

merged 7 commits into from
May 21, 2024

Conversation

ferhoyos
Copy link
Collaborator

@ferhoyos ferhoyos commented May 20, 2024

Describe the change

Add Mesh page to OSSMC

Bonus: Extract console plugin metadata into separate file, as indicated here: https://github.com/openshift/console/blob/master/frontend/packages/console-dynamic-plugin-sdk/README.md#plugin-metadata

Steps to test the PR

  1. Click to Service Mesh / Mesh navigation menu
  2. Verify that Kiali mesh page is loaded correctly

Automation testing

Cypress test to check that mesh page has been loaded correctly (detailed tests are included in Kiali repo)

Issue reference

Closes #308

Kiali frontend source originated from:
* git ref:    master
* git commit: d458c06342458637ec3cdac943b01be663b0de35
* GitHub URL: https://github.com/kiali/kiali/tree/d458c06342458637ec3cdac943b01be663b0de35/frontend/src

Signed-off-by: Fernando Hoyos <fhoyosle@redhat.com>
@ferhoyos ferhoyos added the test: front-end/cypress PR adds/updates front-end tests (unit and/or cypress automation ) label May 20, 2024
@ferhoyos ferhoyos self-assigned this May 20, 2024

const metadata: ConsolePluginBuildMetadata = {
name: 'ossmconsole',
version: '1.85.0',
Copy link
Contributor

Choose a reason for hiding this comment

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

During our build process, we have update this version string. Because it is now in a new file, we should make sure our build process doesn't break. I'm not sure exactly where we do this - it is either in the github workflow or in some Makefile. I will look to try to find it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Note that we still need to change "version:" here in package.json (there is one at the top of the file)... but now we need to do this version update in this plugihn-metadata.ts file, too.

Copy link
Contributor

@jmazzitelli jmazzitelli May 20, 2024

Choose a reason for hiding this comment

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

I think we want something similar to this:

        jq -r ".version |= \"${RELEASE_VERSION:1}\" plugin/package.json > plugin/package.json.tmp
        mv plugin/package.json.tmp plugin/package.json

        jq -r ".version |= \"${RELEASE_VERSION:1}\" plugin/plugin-metadata.json > plugin/plugin-metadata.json.tmp
        mv plugin/plugin-metadata.json.tmp plugin/plugin-metadata.json

But that probably isn't 100% correct because now the plugin version is inside a javascript file, not a json file so the "jq" tool likely will not work. So for that second set of commands we will need to use something like "sed" rather than "jq".

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

@jmazzitelli jmazzitelli left a comment

Choose a reason for hiding this comment

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

I created a PR to this PR so it updates the version strings properly in all the files where version string is now found (there is now a third file - plugin-metadata.ts - where version has to be updated by the release action).

See ferhoyos#6

You can test that the new script works by running it and checking the three files are correctly changed.

Try it with a snapshot version and non-snapshot version (the package.json and plugin-metadata.ts should not have -SNAPSHOT in the version string - the script will strip it out. The Makefile will still show -SNAPSHOT in the version string).

  1. hack/update-version-string.sh v1.2.3 should result in:
diff --git a/Makefile b/Makefile
-VERSION ?= v1.85.0-SNAPSHOT
+VERSION ?= v1.2.3

diff --git a/plugin/package.json b/plugin/package.json
-  "version": "1.85.0",
+  "version": "1.2.3",

diff --git a/plugin/plugin-metadata.ts b/plugin/plugin-metadata.ts
-  version: '1.85.0',
+  version: '1.2.3',
  1. hack/update-version-string.sh v1.2.3-SNAPSHOT should result in:
diff --git a/Makefile b/Makefile
-VERSION ?= v1.85.0-SNAPSHOT
+VERSION ?= v1.2.3-SNAPSHOT

diff --git a/plugin/package.json b/plugin/package.json
-  "version": "1.85.0",
+  "version": "1.2.3",

diff --git a/plugin/plugin-metadata.ts b/plugin/plugin-metadata.ts
-  version: '1.85.0',
+  version: '1.2.3',

* change the version in the new metadata ts file

* release workflow action: change version strings properly
@jmazzitelli jmazzitelli dismissed their stale review May 21, 2024 08:11

my changes were added. now I'll now run this all and test it.

Copy link
Contributor

@jmazzitelli jmazzitelli left a comment

Choose a reason for hiding this comment

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

I can see the new Mesh option:
image

image

Copy link
Contributor

@jmazzitelli jmazzitelli left a comment

Choose a reason for hiding this comment

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

more changes needed for the release action so the new plugin-metadata.ts file gets updated in the release PRs that get generated.

.github/workflows/release.yaml Outdated Show resolved Hide resolved
ferhoyos and others added 2 commits May 21, 2024 13:36
Co-authored-by: John Mazzitelli <mazz@redhat.com>
@ferhoyos ferhoyos merged commit f1e8a5a into kiali:main May 21, 2024
2 checks passed
@ferhoyos ferhoyos deleted the mesh-page branch May 21, 2024 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test: front-end/cypress PR adds/updates front-end tests (unit and/or cypress automation )
Projects
Development

Successfully merging this pull request may close these issues.

Include Mesh page in OSSMC
2 participants