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

Should assertions with flag/role "CAUTION" be considered as INFO findings? #168

Closed
costas80 opened this issue Apr 9, 2024 · 3 comments
Closed
Assignees
Labels

Comments

@costas80
Copy link

costas80 commented Apr 9, 2024

A failed assertion with a flag or role of CAUTION is currently considered as a warning. This comes from the implementation in class DefaultSVRLErrorLevelDeterminator, and in particular method getDefaultErrorLevelFromString:

  public static IErrorLevel getDefaultErrorLevelFromString (@Nullable final String sFlag)
  {
    if (sFlag != null)
    {
      ...
      if (sFlag.equalsIgnoreCase ("warning") || sFlag.equalsIgnoreCase ("warn") || sFlag.equalsIgnoreCase ("caution"))
        return EErrorLevel.WARN;
      ...
    }

    return null;
  }

However, when referring to https://schematron.com/document/141.html there is a suggestion to treat "CAUTION" as "LSP information":

@role="CAUTION"  – It may not be wrong, but care is required. Or a system might be expected to process the document in a special way because of this.
LSP Information
ISQB S4 TRIVIAL

Is the current implementation of DefaultSVRLErrorLevelDeterminator incorrect in its handling of CAUTION assertions (i.e. should they be mapped instead to EErrorLevel.INFO?

I would debate that the current implementation is correct, but we have had certain of our users point out that it is not (we use the resulting error level to present findings as warnings or errors accordingly).

What is your opinion about this?

@phax phax added the bug label Apr 9, 2024
@phax phax self-assigned this Apr 9, 2024
@phax
Copy link
Owner

phax commented Apr 9, 2024

Thanks for ponting that out. Also the reference to the intended error levels is very interesting. As the Schematron documentation may not be there forever, I am taking the liberty of copying the table over:

@role="FATAL"  – something so bad that processing or validation should or did stop.
    LSP Error
    ISQB S1 CRITICAL
@role="ERROR"  – something  wrong has occurred but processing may continue
    LSP Error
    ISQB S2 MAJOR
@role="WARN"  – something wrong has happened, but it does not necessarily require action
    LSP Warning
    ISQB S3 MINOR
@role="CAUTION"  – It may not be wrong, but care is required. Or a system might be expected to process the document in a special way because of this.
    LSP Information
    ISQB S4 TRIVIAL
@role="INFO"  – some information is being reported
    LSP Information
@role="HINT"  – some hint is being given to the user
    LSP Hint
@role="TRACE"  – some information on execution is being reported.
    LSP Information
@role="DEBUG"  – some information that is not intended for exposure in production.
    LSP Hint

phax added a commit that referenced this issue Apr 9, 2024
@phax
Copy link
Owner

phax commented Apr 9, 2024

Will be part of the next 8.0.1 release. If it is okay for you, I won't build an immediate release...

@phax phax closed this as completed Apr 9, 2024
@costas80
Copy link
Author

costas80 commented Apr 9, 2024

Thanks for the fast reaction @phax ! No problem to wait for 8.0.1. As you already expose the role value on the resulting messages we can already check it and "force" an information level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants