Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,13 @@ private TestUtils() {
public static Process executeCommand(String command, String distributionName, Path sourceDirectory,
List<String> args, Map<String, String> envProperties) throws IOException, InterruptedException {
args.add(0, command);
args.add(0, TEST_DISTRIBUTION_PATH.resolve(distributionName).resolve("bin").resolve("bal").toString());
// Use platform-specific bal executable: on Windows use bal.bat, otherwise use bal
String osName = System.getProperty("os.name");
String balExecutable = "bal";
if (osName != null && osName.toLowerCase().contains("win")) {
balExecutable = "bal.bat";
}
args.add(0, TEST_DISTRIBUTION_PATH.resolve(distributionName).resolve("bin").resolve(balExecutable).toString());

OUT.println("Executing: " + StringUtils.join(args, ' '));

Expand Down Expand Up @@ -118,6 +124,11 @@ public static Process executeHelpCommand(String distributionName, Path sourceDir
return executeCommand("help", distributionName, sourceDirectory, args, envProperties);
}

public static Process executeCleanCommand(String distributionName, Path sourceDirectory,
List<String> args, Map<String, String> envProperties) throws IOException, InterruptedException {
return executeCommand("clean", distributionName, sourceDirectory, args, envProperties);
}

public static Process executeNewCommand(String distributionName, Path sourceDirectory,
List<String> args, Map<String, String> envProperties)
throws IOException, InterruptedException {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"image": "ballerina/ballerina-devcontainer:2201.12.10",
"customizations": {
"vscode": {
"extensions": ["WSO2.ballerina"]
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Ballerina generates this directory during the compilation of a package.
# It contains compiler-generated artifacts and the final executable if this is an application package.
target/

# Ballerina maintains the compiler-generated source code here.
# Remove this if you want to commit generated sources.
generated/

# Contains configuration values used during development time.
# See https://ballerina.io/learn/provide-values-to-configurable-variables/ for more details.
Config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[package]
org = "bctestorg"
name = "myproject1"
version = "0.1.0"
distribution = "2201.12.10"
readme = "Package.md"

[build-options]
observabilityIncluded = true


[[dependency]]
org="bctestorg"
name="pkg1"
version="0.1.0"
repository="github1"

[[dependency]]
org="bctestorg"
name="pkg2"
version="1.0.0"
repository="github1"

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Package documentation for myproject1.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import bctestorg/pkg1;
import bctestorg/pkg2;

public function main() {
pkg1:main();
pkg2:main();
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[package]
org = "bctestorg"
name = "pact"
version = "0.2.0"
version = "0.1.0"
readme = "Package.md"

[build-options]
observabilityIncluded = true

Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
jsjj
jsjj

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"image": "ballerina/ballerina-devcontainer:2201.6.0",
"extensions": ["WSO2.ballerina"],
}
Comment on lines +1 to +4
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Fix invalid JSON trailing comma.

Line 3 ends with a trailing comma, which makes this JSON invalid and can break devcontainer parsing.

🛠️ Proposed fix
-    "extensions": ["WSO2.ballerina"],
+    "extensions": ["WSO2.ballerina"]
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{
"image": "ballerina/ballerina-devcontainer:2201.6.0",
"extensions": ["WSO2.ballerina"],
}
{
"image": "ballerina/ballerina-devcontainer:2201.6.0",
"extensions": ["WSO2.ballerina"]
}
🤖 Prompt for AI Agents
In `@project-api-tests/src/test/resources/maven-repos/pkg1/.devcontainer.json`
around lines 1 - 4, The JSON in .devcontainer.json is invalid due to a trailing
comma after the "extensions" array; remove the trailing comma so the object
contains only "image" and "extensions" keys with proper comma separation (ensure
the "extensions" line does not end with a comma) to produce valid JSON for
devcontainer parsing.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
target
generated
Config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[package]
org = "bctestorg"
name = "pkg1"
version = "0.1.0"
readme = "Package.md"


Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change

[build-options]
observabilityIncluded = true

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Package documentation for pkg1.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
public function main() {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"image": "ballerina/ballerina-devcontainer:2201.6.0",
"extensions": ["WSO2.ballerina"],
}
Comment on lines +1 to +4
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Invalid JSON: trailing comma not allowed.

The trailing comma after the extensions array on line 3 is invalid JSON syntax. This will cause parsing errors if the devcontainer configuration is actually used.

🔧 Proposed fix
 {
     "image": "ballerina/ballerina-devcontainer:2201.6.0",
-    "extensions": ["WSO2.ballerina"],
+    "extensions": ["WSO2.ballerina"]
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{
"image": "ballerina/ballerina-devcontainer:2201.6.0",
"extensions": ["WSO2.ballerina"],
}
{
"image": "ballerina/ballerina-devcontainer:2201.6.0",
"extensions": ["WSO2.ballerina"]
}
🤖 Prompt for AI Agents
In `@project-api-tests/src/test/resources/maven-repos/pkg2/.devcontainer.json`
around lines 1 - 4, Remove the trailing comma after the "extensions" array in
the JSON object so the devcontainer config becomes valid JSON; locate the object
containing the "image" and "extensions" keys in .devcontainer.json and either
delete the comma after the extensions entry or add another valid property
following it.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
target
generated
Config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[package]
org = "bctestorg"
name = "pkg2"
version = "1.0.0"
readme = "Package.md"


[build-options]
observabilityIncluded = true

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Package documentation for pkg2.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
public function main() {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"image": "ballerina/ballerina-devcontainer:2201.6.0",
"extensions": ["WSO2.ballerina"],
}
Comment on lines +1 to +4
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Invalid JSON: trailing comma not allowed.

Same issue as in pkg2/.devcontainer.json — the trailing comma after the extensions array is invalid JSON syntax.

🔧 Proposed fix
 {
     "image": "ballerina/ballerina-devcontainer:2201.6.0",
-    "extensions": ["WSO2.ballerina"],
+    "extensions": ["WSO2.ballerina"]
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{
"image": "ballerina/ballerina-devcontainer:2201.6.0",
"extensions": ["WSO2.ballerina"],
}
{
"image": "ballerina/ballerina-devcontainer:2201.6.0",
"extensions": ["WSO2.ballerina"]
}
🤖 Prompt for AI Agents
In `@project-api-tests/src/test/resources/maven-repos/pkg3/.devcontainer.json`
around lines 1 - 4, The JSON in the object with keys "image" and "extensions"
contains a trailing comma after the "extensions" array which makes it invalid;
remove the trailing comma after the "extensions" entry so the object ends with
the closing brace only and validate the file (e.g., via a JSON linter) to ensure
the "image" and "extensions" properties form valid JSON.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
target
generated
Config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[package]
org = "bctestorg"
name = "pkg3"
version = "1.0.0"
readme = "Package.md"


[[dependency]]
org = "bctestorg"
name = "pkg2"
version = "1.0.0"


[build-options]
observabilityIncluded = true

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Package documentation for pkg3.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
public function main() {
}