Skip to content

feat: Add community modules#3947

Merged
dbadura merged 35 commits intokyma-project:mainfrom
akucharska:add-community-modules
Jul 17, 2025
Merged

feat: Add community modules#3947
dbadura merged 35 commits intokyma-project:mainfrom
akucharska:add-community-modules

Conversation

@akucharska
Copy link
Contributor

@akucharska akucharska commented Jun 4, 2025

Description

Changes proposed in this pull request:

  • Add view for installing community modules

Related issue(s)

Definition of done

  • The PR's title starts with one of the following prefixes:
    • feat: A new feature
    • fix: A bug fix
    • docs: Documentation only changes
    • refactor: A code change that neither fixes a bug nor adds a feature
    • test: Adding tests
    • revert: Revert commit
    • chore: Maintainance changes to the build process or auxiliary tools, libraries, workflows, etc.
  • Related issues are linked. To link internal trackers, use the issue IDs like backlog#4567
  • Explain clearly why you created the PR and what changes it introduces
  • All necessary steps are delivered, for example, tests, documentation, merging

@akucharska akucharska linked an issue Jun 4, 2025 that may be closed by this pull request
7 tasks
@akucharska akucharska marked this pull request as ready for review June 27, 2025 11:06
@mrCherry97 mrCherry97 self-assigned this Jun 30, 2025
return resources;
};

async function getResourcesYamls(link: string, post: Function) {
Copy link
Contributor

Choose a reason for hiding this comment

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

It look the same as postForCommunityResources from deleteModuleHelpers.tsx

Copy link
Contributor

@mrCherry97 mrCherry97 left a comment

Choose a reason for hiding this comment

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

Please double check if there is more functions with are the same or very similar which can be moved to like support or shared for adding functionalities and called in ModulesAdd and CommunityModulesAdd

}}
/>
)}
{layoutState?.showCreate?.createType !== 'community' && (
Copy link
Contributor

Choose a reason for hiding this comment

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

image

Comment on lines +82 to +86
resourceType: 'kymas',
rawResourceTypeName: 'Kyma',
namespaceId: 'kyma-system',
apiGroup: 'operator.kyma-project.io',
apiVersion: 'v1beta2',
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need such specificity? In case of a Kyma update, we need to remember to change it.

Comment on lines 60 to 92
if (!existingModule && !isAlreadyInstalled) {
moduleMetaRelase?.spec.channels.forEach(channel => {
if (!acc.find(item => item.name === name)) {
acc.push({
name: name,
channels: [
{
channel: channel.channel,
version: channel.version,
isBeta: moduleMetaRelase.spec.beta ?? false,
isMetaRelease: true,
resources: module.spec.resources,
},
],
docsUrl: module.spec.info.documentation,
icon: {
link: module.spec?.info?.icons[0]?.link,
name: module.spec?.info?.icons[0]?.name,
},
});
} else {
acc
.find(item => item.name === name)
.channels.push({
channel: channel.channel,
version: channel.version,
isBeta: moduleMetaRelase.spec.beta ?? false,
isMetaRelease: true,
resources: module.spec.resources,
});
}
});
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This could be moved to a separate function and called dynamically in ModulesAdd and CommunityModulesAdd

const modulesAddData = moduleTemplates?.items.reduce((acc, module) => {
const name = module.metadata.labels['operator.kyma-project.io/module-name'];
const existingModule = acc.find(item => {
return item.metadata.name === name;
Copy link
Contributor

@dbadura dbadura Jul 1, 2025

Choose a reason for hiding this comment

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

Busola crashes when there is the same module in acc.
It tries to access metadata.name which is not available because it's custom data structure.

I created 2 busola moduleTempaltes with different version.

apiVersion: operator.kyma-project.io/v1beta2
kind: ModuleTemplate
metadata:
  annotations:
    operator.kyma-project.io/is-cluster-scoped: "false"
  labels:
    operator.kyma-project.io/module-name: busola
  name: busola-fast
  namespace: kyma-system
spec:
  channel: fast
  associatedResources:
  - group: operator.kyma-project.io
    kind: ClusterIP
    version: v1alpha2
  data:
    apiVersion: operator.kyma-project.io/v1alpha1
    kind: ClusterIP
    metadata:
      name: cluster-ip-zones
    spec:
      nodeSpreadLabel: topology.kubernetes.io/zone
  descriptor:
    component:
      componentReferences: []
      name: kyma-project.io/module/cluster-ip
      provider: '{"name":"kyma-project.io","labels":[{"name":"kyma-project.io/built-by","value":"modulectl","version":"v1"}]}'
      repositoryContexts:
      - baseUrl: http://k3d-oci.localhost:5001
        componentNameMapping: urlPath
        type: OCIRegistry
      resources:
      - access:
          localReference: sha256:b88d172173d41c7b0799512718e598efa5643e9eb3aeebbf88fd8e5e6e18098f
          mediaType: application/x-tar
          referenceName: raw-manifest
          type: localBlob
        digest:
          hashAlgorithm: SHA-256
          normalisationAlgorithm: genericBlobDigest/v1
          value: b88d172173d41c7b0799512718e598efa5643e9eb3aeebbf88fd8e5e6e18098f
        name: raw-manifest
        relation: local
        type: directory
        version: 0.0.29
      - access:
          localReference: sha256:633d91a28e03e1bcb495095e92430a2d996e13faaa15ead90cc180514cf5a2c3
          mediaType: application/x-tar
          referenceName: default-cr
          type: localBlob
        digest:
          hashAlgorithm: SHA-256
          normalisationAlgorithm: genericBlobDigest/v1
          value: 633d91a28e03e1bcb495095e92430a2d996e13faaa15ead90cc180514cf5a2c3
        name: default-cr
        relation: local
        type: directory
        version: 0.0.29
      sources:
      - access:
          commit: 106643ead24aff8da197fc89a46ce546193ea8f1
          repoUrl: https://github.com/pbochynski/cluster-ip.git
          type: gitHub
        labels:
        - name: git.kyma-project.io/ref
          value: HEAD
          version: v1
        name: module-sources
        type: Github
        version: 0.0.29
      version: 0.0.29
    meta:
      schemaVersion: v2
  info:
    documentation: https://github.com/pbochynski
    icons:
    - link: https://raw.githubusercontent.com/pbochynski/cluster-ip/refs/heads/main/logo.png
      name: module-icon
    repository: https://github.com/pbochynski/cluster-ip.git
  manager:
    group: apps
    kind: Deployment
    name: busola
    namespace: default
    version: v1
  mandatory: false
  moduleName: busola
  requiresDowntime: false
  resources:
  - link: https://github.com/kyma-project/busola/releases/download/v0.0.13/busola.yaml
    name: rawManifest
  version: 0.0.13
apiVersion: operator.kyma-project.io/v1beta2
kind: ModuleTemplate
metadata:
  annotations:
    operator.kyma-project.io/is-cluster-scoped: "false"
  labels:
    operator.kyma-project.io/module-name: busola
  name: busola-regular
  namespace: kyma-system
spec:
  channel: regular
  associatedResources:
  - group: operator.kyma-project.io
    kind: ClusterIP
    version: v1alpha2
  data:
    apiVersion: operator.kyma-project.io/v1alpha1
    kind: ClusterIP
    metadata:
      name: cluster-ip-zones
    spec:
      nodeSpreadLabel: topology.kubernetes.io/zone
  descriptor:
    component:
      componentReferences: []
      name: kyma-project.io/module/cluster-ip
      provider: '{"name":"kyma-project.io","labels":[{"name":"kyma-project.io/built-by","value":"modulectl","version":"v1"}]}'
      repositoryContexts:
      - baseUrl: http://k3d-oci.localhost:5001
        componentNameMapping: urlPath
        type: OCIRegistry
      resources:
      - access:
          localReference: sha256:b88d172173d41c7b0799512718e598efa5643e9eb3aeebbf88fd8e5e6e18098f
          mediaType: application/x-tar
          referenceName: raw-manifest
          type: localBlob
        digest:
          hashAlgorithm: SHA-256
          normalisationAlgorithm: genericBlobDigest/v1
          value: b88d172173d41c7b0799512718e598efa5643e9eb3aeebbf88fd8e5e6e18098f
        name: raw-manifest
        relation: local
        type: directory
        version: 0.0.29
      - access:
          localReference: sha256:633d91a28e03e1bcb495095e92430a2d996e13faaa15ead90cc180514cf5a2c3
          mediaType: application/x-tar
          referenceName: default-cr
          type: localBlob
        digest:
          hashAlgorithm: SHA-256
          normalisationAlgorithm: genericBlobDigest/v1
          value: 633d91a28e03e1bcb495095e92430a2d996e13faaa15ead90cc180514cf5a2c3
        name: default-cr
        relation: local
        type: directory
        version: 0.0.29
      sources:
      - access:
          commit: 106643ead24aff8da197fc89a46ce546193ea8f1
          repoUrl: https://github.com/pbochynski/cluster-ip.git
          type: gitHub
        labels:
        - name: git.kyma-project.io/ref
          value: HEAD
          version: v1
        name: module-sources
        type: Github
        version: 0.0.29
      version: 0.0.29
    meta:
      schemaVersion: v2
  info:
    documentation: https://github.com/pbochynski
    icons:
    - link: https://raw.githubusercontent.com/pbochynski/cluster-ip/refs/heads/main/logo.png
      name: module-icon
    repository: https://github.com/pbochynski/cluster-ip.git
  manager:
    group: apps
    kind: Deployment
    name: busola
    namespace: default
    version: v1
  mandatory: false
  moduleName: busola
  requiresDowntime: false
  resources:
  - link: https://github.com/kyma-project/busola/releases/download/v0.0.10/busola.yaml
    name: rawManifest
  version: 0.0.10

@dbadura dbadura self-assigned this Jul 1, 2025
@Sawthis Sawthis closed this Jul 4, 2025
@dbadura dbadura assigned OliwiaGowor and unassigned mrCherry97 Jul 11, 2025
Comment on lines 351 to 360
{/* {checkIfSelectedModuleIsBeta() ? (
<MessageStrip
key={'beta'}
design="Critical"
hideCloseButton
className="sap-margin-top-small"
>
{t('kyma-modules.beta-alert')}
</MessageStrip>
) : null} */}
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need this?

@OliwiaGowor
Copy link
Contributor

After refreshing the page with either the Add Community Modules or the Add Modules form open, the forms are not being loaded, and I see an empty column

Screen.Recording.2025-07-14.at.14.02.39.mov

@mrCherry97 mrCherry97 dismissed their stale review July 14, 2025 12:17

Handover to Damian

Copy link
Contributor

@dbadura dbadura left a comment

Choose a reason for hiding this comment

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

Something is wrong I can't install busola.

Copy link
Contributor

@dbadura dbadura left a comment

Choose a reason for hiding this comment

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

I found out that installing doesn't work when using Firefox.

@dbadura dbadura enabled auto-merge (squash) July 17, 2025 09:28
@dbadura dbadura merged commit 5d24346 into kyma-project:main Jul 17, 2025
22 of 28 checks passed
@akucharska akucharska deleted the add-community-modules branch July 17, 2025 09:41
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.

Install community modules (not managed)

6 participants