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]: Found inconsistency behaviour with the diagnostic messages in bal build tool #42543

Closed
lnash94 opened this issue Apr 15, 2024 · 1 comment · Fixed by #42547 or #42548
Closed
Labels
needTriage The issue has to be inspected and labeled manually Type/Bug userCategory/Compilation

Comments

@lnash94
Copy link
Member

lnash94 commented Apr 15, 2024

Description

There are two issues encountered while executing the below tool config in bal build command.

  1. When the Ballerina toml has two tool configs with the same tool id, bal build provides the incomplete error message.

toml sample:

# with license file
[[tool.openapi]]
id = "client04"
filePath = "openapi.yaml"
targetModule = "delivery04"
options.mode = "client"
options.license = "license.txt"

# defualt behaviour
[[tool.openapi]]
id = "client04"
filePath = "openapi.yaml"
targetModule = "delivery05"

received warning

WARNING: Validation of tool options of 'Field[value=openapi, location=io.ballerina.toml.semantic.diagnostics.TomlNodeLocation@2d4fdf]' for 'client04' is skipped due to no tool options found
WARNING: Execution of 'openapi:client04' is skipped due to errors
error: build tool execution contains errors

Here Field[value=openapi, location=io.ballerina.toml.semantic.diagnostics.TomlNodeLocation@2d4fdf] should be some tool name instead of object details

  1. When the Ballerina toml has two tool configs with the same tool id, it is expected to execute one tool config and generate code for it and stop and provide an error message for the other repeated id and stop code generation for that.
    Although the expected behaviour is there but the generated code and the error message is inconsistent.

toml sample:

# with license file
[[tool.openapi]]
id = "client04"
filePath = "openapi.yaml"
targetModule = "delivery04"
options.mode = "client"
options.license = "license.txt"

# defualt behaviour
[[tool.openapi]]
id = "client04"
filePath = "openapi.yaml"
targetModule = "delivery05"

Given error message:

ERROR [Ballerina.toml:(64:1,67:28)] recurring tool id 'client04' found in Ballerina.toml. Tool id must be unique for each tool

Output

  • this generates a client for the target module delivery05, and gives the error message for the same tool config

Expected output :

  • If it is generated client for target module delivery05, then the error message should be regarding the target module delivery04 by displaying it has a recurring tool id.

Steps to Reproduce

No response

Affected Version(s)

Ballerina 2201.9.0, Swan Lake Update 9, Test Pack

OS, DB, other environment details and versions

No response

Related area

-> Compilation

Related issue(s) (optional)

No response

Suggested label(s) (optional)

No response

Suggested assignee(s) (optional)

No response

Copy link

This issue is NOT closed with a proper Reason/ label. Make sure to add proper reason label before closing. Please add or leave a comment with the proper reason label now.

      - Reason/EngineeringMistake - The issue occurred due to a mistake made in the past.
      - Reason/Regression - The issue has introduced a regression.
      - Reason/MultipleComponentInteraction - Issue occured due to interactions in multiple components.
      - Reason/Complex - Issue occurred due to complex scenario.
      - Reason/Invalid - Issue is invalid.
      - Reason/Other - None of the above cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needTriage The issue has to be inspected and labeled manually Type/Bug userCategory/Compilation
Projects
None yet
2 participants