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

fix: When the m2kignore file is removed from language_platforms.zip then in the UI only the Ruby service is detected #1160

Merged
merged 1 commit into from
Mar 21, 2024

Conversation

Akash-Nayak
Copy link
Contributor

Fixes - #1159

Move2Kube-UI detects all the services in the language-platforms, whereas earlier it was only detecting the Ruby service.

Screenshot 2024-03-21 at 1 26 45 AM
apiVersion: move2kube.konveyor.io/v1alpha1
kind: Plan
metadata:
  name: test
spec:
  sourceDir: sources
  services:
    django:
      - transformerName: Python-Dockerfile
        paths:
          MainPythonFilesPathType:
            - language-platforms/language-platforms/django/manage.py
          PythonFilesPathType:
            - language-platforms/language-platforms/django/manage.py
          RequirementsTxtPathType:
            - language-platforms/language-platforms/django/requirements.txt
          ServiceDirectories:
            - language-platforms/language-platforms/django
        configs:
          OriginalName:
            originalName: django
          PythonConfig:
            IsDjango: true
    golang:
      - transformerName: Golang-Dockerfile
        paths:
          GoModFilePath:
            - language-platforms/language-platforms/golang/go.mod
          ServiceDirectories:
            - language-platforms/language-platforms/golang
        configs:
          OriginalName:
            originalName: golang
    java-gradle:
      - transformerName: Gradle
        paths:
          GradleBuildFile:
            - language-platforms/language-platforms/java-gradle/build.gradle
          GradleSettingsFile:
            - language-platforms/language-platforms/java-gradle/settings.gradle
          ServiceDirectories:
            - language-platforms/language-platforms/java-gradle
          ServiceRootDirectory:
            - language-platforms/language-platforms/java-gradle
        configs:
          Gradle:
            rootProjectName: java-gradle
            packagingType: war
            isGradlewPresent: true
            childModules:
              - name: java-gradle
                buildScriptPath: build.gradle
    java-maven:
      - transformerName: Maven
        paths:
          ServiceDirectories:
            - language-platforms/language-platforms/java-maven
          ServiceRootDirectory:
            - language-platforms/language-platforms/java-maven
          pomFiles:
            - language-platforms/language-platforms/java-maven/pom.xml
        configs:
          Maven:
            mavenAppName: java-maven
            packagingType: war
            isMvnwPresent: false
            childModules:
              - name: java-maven
                pomPath: pom.xml
    java-war:
      - transformerName: WarAnalyser
        paths:
          ServiceDirectories:
            - language-platforms/language-platforms/java-war
          War:
            - language-platforms/language-platforms/java-war/java-war.war
        configs:
          ImageName:
            imageName: java-war
          War:
            port: 0
            javaVersion: "17"
            buildContainerName: ""
            deploymentFilePath: java-war.war
            envVariables: {}
    nodejs:
      - transformerName: Nodejs-Dockerfile
        paths:
          ServiceDirectories:
            - language-platforms/language-platforms/nodejs
        configs:
          OriginalName:
            originalName: nodejs
    php:
      - transformerName: PHP-Dockerfile
        paths:
          ServiceDirectories:
            - language-platforms/language-platforms/php
        configs:
          OriginalName:
            originalName: php
    python:
      - transformerName: Python-Dockerfile
        paths:
          MainPythonFilesPathType:
            - language-platforms/language-platforms/python/main.py
          PythonFilesPathType:
            - language-platforms/language-platforms/python/main.py
          RequirementsTxtPathType:
            - language-platforms/language-platforms/python/requirements.txt
          ServiceDirectories:
            - language-platforms/language-platforms/python
        configs:
          OriginalName:
            originalName: python
          PythonConfig:
            IsDjango: false
    ruby:
      - transformerName: Ruby-Dockerfile
        paths:
          ServiceDirectories:
            - language-platforms/language-platforms/ruby
        configs:
          OriginalName:
            originalName: ruby
    rust:
      - transformerName: Rust-Dockerfile
        paths:
          ServiceDirectories:
            - language-platforms/language-platforms/rust
        configs:
          OriginalName:
            originalName: rust

Copy link

Thanks for making a pull request! 😃
One of the maintainers will review and advise on the next steps.

@github-actions github-actions bot added the fix label Mar 20, 2024
Copy link

codecov bot commented Mar 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 14.89%. Comparing base (03e702f) to head (b4fe65b).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1160   +/-   ##
=======================================
  Coverage   14.89%   14.89%           
=======================================
  Files          90       90           
  Lines        8380     8380           
=======================================
  Hits         1248     1248           
  Misses       6809     6809           
  Partials      323      323           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@HarikrishnanBalagopal
Copy link
Contributor

@HarikrishnanBalagopal
Copy link
Contributor

HarikrishnanBalagopal commented Mar 21, 2024

The bug was fixed in konveyor/move2kube-api#163

We can merge this PR regardless but some minor change is required.

Copy link
Contributor

@HarikrishnanBalagopal HarikrishnanBalagopal left a comment

Choose a reason for hiding this comment

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

Some minor changes required.

@HarikrishnanBalagopal HarikrishnanBalagopal changed the title fix: Only Ruby service was getting detected and other services were ignored fix: When the m2kignore file is removed from language_platforms.zip then in the UI only the Ruby service is detected Mar 21, 2024
@Akash-Nayak
Copy link
Contributor Author

@Akash-Nayak the bug was caused by this PR https://github.com/konveyor/move2kube-api/pull/148/files

When there is no .m2kignore file and if there is Ruby service in the source artifacts, then Move2Kube CLI/UI would only detect the Ruby service and ignore all other services.

ls -a src
.           golang      java-maven  python      rust
..          java-gradle nodejs      ruby
$ move2kube plan -s src
$ cat m2k.plan                                             
apiVersion: move2kube.konveyor.io/v1alpha1
kind: Plan
metadata:
  name: myproject
spec:
  sourceDir: src
  services:
    src:
      - transformerName: Ruby-Dockerfile
        paths:
          ServiceDirectories:
            - .
        configs:
          OriginalName:
            originalName: src
  transformers:

This PR fixes this issue #1160 (comment).

…gnored without .m2kignore

Signed-off-by: Akash Nayak <akash19nayak@gmail.com>
Copy link
Contributor

@HarikrishnanBalagopal HarikrishnanBalagopal left a comment

Choose a reason for hiding this comment

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

LGTM

@HarikrishnanBalagopal HarikrishnanBalagopal merged commit e53812c into konveyor:main Mar 21, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants