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 bal pack crashes when [[dependency]] section is missing in the CompilerPlugin.toml file #43426

Merged
merged 6 commits into from
Oct 8, 2024

Conversation

Shadow-Devil
Copy link
Contributor

@Shadow-Devil Shadow-Devil commented Sep 26, 2024

Purpose

Fixes a IndexOutOfBoundsException if no dependencies are added in the dependency section of a CompilerPlugin.

Fixes #41418 and #42120

Approach

Describe how you are implementing the solutions along with the design details.

Samples

Provide high-level details about the samples related to this feature.

Remarks

List any other known issues, related PRs, TODO items, or any other notes related to the PR.

Check List

  • Read the Contributing Guide
  • Updated Change Log
  • Checked Tooling Support (#)
  • Added necessary tests
    • Unit Tests
    • Spec Conformance Tests
    • Integration Tests
    • Ballerina By Example Tests
  • Increased Test Coverage
  • Added necessary documentation
    • API documentation
    • Module documentation in Module.md files
    • Ballerina By Examples

Copy link

codecov bot commented Sep 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (master@f392e37). Learn more about missing BASE report.
Report is 14 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master   #43426   +/-   ##
=========================================
  Coverage          ?   77.53%           
  Complexity        ?    58717           
=========================================
  Files             ?     3447           
  Lines             ?   219689           
  Branches          ?    28937           
=========================================
  Hits              ?   170335           
  Misses            ?    39934           
  Partials          ?     9420           

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

@@ -138,32 +138,28 @@ protected void addCompilerPlugin(ZipOutputStream balaOutputStream) throws IOExce
List<String> compilerPluginLibPaths = new ArrayList<>();
List<String> compilerPluginDependencies = this.compilerPluginToml.get().getCompilerPluginDependencies();

if (compilerPluginDependencies.get(0) == null) {
if (compilerPluginDependencies.isEmpty()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

@Shadow-Devil The fix is working fine now we get the below error message.
image

Shall we add a negative test case for this?
We have a few negative test cases in io.ballerina.projects.test.plugins.CompilerPluginNegativeTests. Can you please add one for this fix?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@gimantha sure, I just pushed a negative testcase in 1d42266. Please let me know if this is fine or needs some refinement,

@Shadow-Devil
Copy link
Contributor Author

@gimantha i think this is blocked until #43466 is fixed

@gimantha
Copy link
Contributor

gimantha commented Oct 7, 2024

@gimantha i think this is blocked until #43466 is fixed

Yep.. initially it was failing due to the exact reason your mentioned. But now it is failing due to an error in debugger tests. We will have a look

@gimantha gimantha merged commit c2c47b3 into ballerina-platform:master Oct 8, 2024
18 checks passed
@Shadow-Devil Shadow-Devil deleted the fix-41418 branch October 8, 2024 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: bal pack crashes when [[dependency]] section is missing in the CompilerPlugin.toml file
2 participants