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

Add DependencyManifest module to the PackageManifest dependency #43524

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gayaldassanayake
Copy link
Contributor

Purpose

When a package is found both in PackageManifest(Ballerina.toml) and the DependencyManifest(Dependencies.toml) we pick the dependency in the PackageManifest. This will go in the BlendedManifest. However, with that, we loose the information regarding the modules that are within the package since the user only specifies the org, name, version and repository (optional).

When this happens to a package that has a hierarchical name (eg - resource.kind), we cannot find a module that matches the the aforementioned dependency in the BlendedManifest because when trying to compare the module names, the entry in the BlendedManifest has an empty module list.

With this fix, when the same dependency is repeated in both Dependencies.toml and the Ballerina.toml, the module details are copied from the Dependencies.toml while other details are taken from the Ballerina.toml

Fixes https://github.com/wso2-enterprise/internal-support-ballerina/issues/811

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

Comment on lines -138 to -139
moduleNames(new DependencyManifest.Package(depInPkgManifest.name(), depInPkgManifest.org(),
depInPkgManifest.version())), DependencyOrigin.USER_SPECIFIED));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This moduleNames(new DependencyManifest.Package(depInPkgManifest.name(), depInPkgManifest.org(), depInPkgManifest.version())) always returns an empty list of module names.

@sameerajayasoma
Copy link
Contributor

Can we write a test using our resource test framework? Not sure whether this is supported in the resolution framework.

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.

2 participants