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] manifestCreator: 'embeds' should list all components #575

Merged
merged 5 commits into from
Feb 26, 2021

Conversation

tobiasso85
Copy link
Contributor

@tobiasso85 tobiasso85 commented Jan 27, 2021

Field embeds in created manifest.json file now contains all nested
manifests, independent from the reverse field embeddedBy (embeddedBy
points from an embedded manifest to the library's manifest).

Remove unreachable code (in createSapUI5() -> getUI5Version() function) .

Use path.dirname method to get directory name in findEmbeddedComponents() function.

Use string for version value in manifest (in sectionVersion() function).
e.g. "1.2.3" instead of the semver object's string representation.

It reverts changes which were introduced with #555
Successor of #554

embeds field in created manifest.json now contains all nested
manifests independent from the reverse field embeddedBy, which
points from an embedded manifest to the library's manifest.
@coveralls
Copy link

coveralls commented Jan 27, 2021

Coverage Status

Coverage increased (+0.1%) to 93.962% when pulling 9cd1313 on manifest-creator-embeds into 4674fef on master.

Removed invalid code in sapui5 version section (#getUI5Version)

Fixed version in sections: use a version string instead of Semver
version object
@tobiasso85 tobiasso85 marked this pull request as ready for review February 16, 2021 10:39
Comment on lines -432 to -435
let ui5Version;
if ( ui5Version != null ) {
return ui5Version;
}
Copy link
Member

Choose a reason for hiding this comment

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

I wonder where this code came from. It doesn't make sense, but maybe it needs to be fixed rather than being removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The code taken from the Java implementation had a member variable ui5version which could be set from the oustide via parameter. This is not the case here anymore so it can be removed.

};
t.is(errorLogStub.callCount, 0);

const options = {descriptorVersion: new Version("1.1.0")};
Copy link
Member

Choose a reason for hiding this comment

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

I wonder why the API requires a semver version instance instead of a plain string.
AFAICS the whole processor is not marked as public API so we should be able to do a cleanup.

As this is not related to the actual PR of fixing the embeds behavior, I'd be in favor of creating a separate PR.
Or is there a relation from the version handling change (toString) to the embeds change? At least I could not find any hint. Maybe to increase code coverage?

Copy link
Contributor Author

@tobiasso85 tobiasso85 Feb 25, 2021

Choose a reason for hiding this comment

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

inside the manifestCreator the SemVer object is used for version comparison, as api parameter (descriptorVersion) a string definitely makes sense and can be done in a separate PR.
This test/fix was made to increase the test coverage. During a normal run such a small version is not used.

Copy link
Member

Choose a reason for hiding this comment

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

Also see #556 where we already discussed making the manifestCreator public and that we would re-check the API before doing so.

const result = [];
const prefix = libraryResource.getPath().slice(0, - ".library".length);
const prefix = posixPath.dirname(libraryResource.getPath()) + "/";
Copy link
Member

Choose a reason for hiding this comment

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

Much better 👍🏻

The descriptorVersion parameter is not public API, but it makes sense
to make the parameter of type string and create a SemVer object inside.
@matz3 matz3 changed the title [FEATURE] manifestCreator: embeds field [FIX] manifestCreator: 'embeds' should list all components Feb 25, 2021
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. I've changed the PR title, as this is rather a fix than a feature

@tobiasso85 tobiasso85 merged commit 11f823a into master Feb 26, 2021
@tobiasso85 tobiasso85 deleted the manifest-creator-embeds branch February 26, 2021 08:00
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.

3 participants