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

[INTERNAL] Export build processor manifestCreator #648

Merged
merged 4 commits into from
Oct 14, 2021

Conversation

larskissel
Copy link
Member

@larskissel larskissel commented Oct 4, 2021

Make the build processor 'manifestCreator' accessible
for external usage.
Add an additional option to the 'manifestCreator' to
omit processing of dependency's minVersion and
minUI5Version.

JIRA: CPOUI5FOUNDATION-299

Make the build processor 'manifestCreator' accessible
for external usage.

JIRA: CPOUI5FOUNDATION-299
@coveralls
Copy link

coveralls commented Oct 4, 2021

Coverage Status

Coverage increased (+0.006%) to 94.716% when pulling bc97b3c on exportManifestCreator into 2ad0960 on master.

@larskissel
Copy link
Member Author

larskissel commented Oct 4, 2021

Closing as duplicate of #556

@larskissel larskissel closed this Oct 4, 2021
@larskissel larskissel reopened this Oct 11, 2021
@@ -634,6 +634,10 @@ async function createManifest(libraryResource, libBundle, descriptorVersion, _in
}
}

if ( !minUI5VersionRequired ) {
Copy link
Member

Choose a reason for hiding this comment

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

I think the getVersion function is used for more than the minUI5Version. Why not move this if into the getUI5Version function instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

See discussion below #648 (comment)

@@ -667,7 +672,8 @@ module.exports = function({libraryResource, resources, options}) {
return Promise.resolve(null); // a fulfillment of null indicates that no manifest has been created
}

return createManifest(libraryResource, libBundle, options.descriptorVersion, options.include3rdParty)
return createManifest(libraryResource, libBundle, options.descriptorVersion, options.include3rdParty,
options.minUI5VersionRequired)
Copy link
Member

Choose a reason for hiding this comment

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

I would prefer a switch to simply omit the minUI5Version instead of trying to resolve it. Maybe omitMinUI5Version?

In the ui5-server use case, there is no benefit from having the minUI5Version available in some cases. So I think it should never be available in order to keep things simpler.

Copy link
Member Author

Choose a reason for hiding this comment

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

As discussed, let's call it omitMinVersions because not only the minUI5Version but also the minVersion of dependencies could lead to issues. The added versionInfoGenerator test proves that missing (empty string) minVersion/minUI5Version info doesn't affect the result of a sap-ui-version.json

Copy link
Member

@RandomByte RandomByte left a comment

Choose a reason for hiding this comment

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

Looks good, just one remark/question in the test

});
}
};
const myDep = {name: "my.dep", version: "1.2.3", libraryManifest: myDepManifest};
Copy link
Member

Choose a reason for hiding this comment

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

Can we actually remove myDep in this test? I guess that would be the ui5-server use case then were some dependencies might not be available.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

Copy link
Member

@matz3 matz3 left a comment

Choose a reason for hiding this comment

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

LGTM

@RandomByte
Copy link
Member

Let's wait with merging this until tomorrow afternoon when we were able to discuss the info-log that might appear for ui5 serve now.

Comment on lines +278 to +281
"Cannot find dependency 'my.dep' " +
"defined in the manifest.json or .library file of project 'lib.a'. " +
"This might prevent some UI5 runtime performance optimizations from taking effect. " +
"Please double check your project's dependency configuration.");
Copy link
Member

Choose a reason for hiding this comment

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

I just tested this PR in conjunction with SAP/ui5-server#420 and found that this info log does not appear if no dependencies are maintained at all, since in that case no libraryInfos are supplied and therefore no manifestHints are evaluated in the versionInfoGenerator.

Overall I found that this PR does not change whether or not users will see this info logging. So we should be good to merge it.

@larskissel larskissel merged commit be7d24a into master Oct 14, 2021
@larskissel larskissel deleted the exportManifestCreator branch October 14, 2021 13:37
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.

4 participants