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

[BUG] When running on MacOS, the incident uri is prepended with 'file:///opt/input/source/' #124

Open
1 task done
jwmatthews opened this issue Nov 17, 2023 · 2 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.

Comments

@jwmatthews
Copy link
Member

Is there an existing issue for this?

  • I have searched the existing issues

Konveyor version

:latest as of Nov 15 2023

Priority

Undefined (Default)

Current Behavior

Below is a sample output. I'm not 100% sure that we should change this behavior. At the moment I'd like to just open this so folks are aware and we can decide what desired behavior we want.

javaee-to-jakarta-namespaces-00002:
      description: |-
        Replace the Java EE persistence namespace, schemaLocation and version with the Jakarta equivalent
        Replace `http://xmlns.jcp.org/xml/ns/persistence` with `https://jakarta.ee/xml/ns/persistence` and change the schema version number
      category: mandatory
      labels:
      - konveyor.io/target=jakarta-ee9+
      - konveyor.io/target=jakarta-ee
      - konveyor.io/target=eap8
      - konveyor.io/target=eap
      - konveyor.io/source
      incidents:
      - uri: file:///opt/input/source/target/classes/META-INF/persistence.xml
        message: Replace `http://xmlns.jcp.org/xml/ns/persistence` with `https://jakarta.ee/xml/ns/persistence` and change the schema version number
        codeSnip: |2
            1  <?xml version="1.0" encoding="UTF-8"?>
            2  <persistence version="2.1"
            3               xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            4               xsi:schemaLocation="
            5          http://xmlns.jcp.org/xml/ns/persistence
            6          http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
            7      <persistence-unit name="primary">
            8          <jta-data-source>java:jboss/datasources/CoolstoreDS</jta-data-source>
            9          <properties>
           10              <property name="javax.persistence.schema-generation.database.action" value="none"/>
           11              <property name="hibernate.show_sql" value="false" />
           12          </properties>
           13      </persistence-unit>
           14  </persistence>
        lineNumber: 3
        variables:
          matchingText: http://xmlns.jcp.org/xml/ns/persistence

Expected Behavior

I'm unsure what the expected behavior should be.
My first thought is for the file path to be relative to the project directory, so something like 'target/classes/META-INF/persistence.xml' for my example...but then when I think of "uri: file://" that 'feels' like it needs to be an absolute path and I'm unsure if we want absolute paths in the report.

How Reproducible

Always (Default)

Steps To Reproduce

From MacOS:

  1. git clone https://github.com/deewhyweb/eap-coolstore-monolith.git coolstuff-javaee
  2. https://github.com/konveyor/kantra/blob/main/hack/darwin_get_latest_kantra_cli.sh
  3. https://github.com/konveyor/kantra/blob/main/hack/darwin_restart_podman_machine.sh
  4. ./kantra analyze -i coolstuff-javaee -t "quarkus" -t "jakarta-ee" -t "jakarta-ee8+" -t "jakarta-ee9+" -t "cloud-readiness" -o out

Environment

- OS: Mac OS (M1 Max)

Anything else?

No response

@jwmatthews jwmatthews added needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. kind/bug Categorizes issue or PR as related to a bug. labels Nov 17, 2023
@eemcmullan eemcmullan self-assigned this Nov 20, 2023
@eemcmullan
Copy link
Collaborator

Even if we do not want to use the absolute path, we should probably still remove this prefix as it is the container path.

@shawn-hurley
Copy link
Contributor

This might be a Shawn thing, but I need help to comprehensively determine what we want to report. It seems very dependent on the environment in which it is run; I am starting to worry that changes here will break something else.

I think we need to get some doc for us (me) to keep track of this and, more importantly, how we want to fix it.

@eemcmullan eemcmullan added the good first issue Good for newcomers label Dec 7, 2023
@eemcmullan eemcmullan removed their assignment Dec 7, 2023
@eemcmullan eemcmullan removed the good first issue Good for newcomers label Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.
Projects
Status: 📋 Backlog
Development

No branches or pull requests

3 participants