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

Versionless Repo Resolver additions and Error handling #29058

Merged
merged 8 commits into from
Jul 17, 2024

Conversation

cbridgha
Copy link
Member

@cbridgha cbridgha commented Jul 13, 2024

This PR uses the resolution Result object to start gathering additional results that could occur in versionless scenarios.
Primarily two main scenarios where messages have been added to the install commands (#29060). Platform can't be found, or platform can't be determined from the set of versionless/versioned features passed.

A few additions to the Repository to handle querying the platform header info now stored in the ESA's.

Started adding install tests, but will be exploring how to test for features not yet part of the public repo.

@cbridgha cbridgha force-pushed the VersionlessRepoPesolver branch 2 times, most recently from 31282d3 to 0b4724f Compare July 13, 2024 01:47
@cbridgha
Copy link
Member Author

#build

@LibbyBot
Copy link

Code analysis and actions

DO NOT DELETE THIS COMMENT.
  • 5 product code files were changed.
  • Please describe in a separate comment how you tested your changes.

@LibbyBot
Copy link

Your personal build request is at https://wasrtc.hursley.ibm.com:9443/jazz/resource/itemOid/com.ibm.team.build.BuildResult/_D76ycEDsEe-Hn95lLM_tGQ

Target locations of links might be accessible only to IBM employees.

@LibbyBot
Copy link

Your personal pipeline request is at https://libh-proxy1.fyre.ibm.com/cognitive/pipelineAnalysis.html?uuid=cfc87762-a5c7-488a-b3ad-c363329f95b1

Target locations of links might be accessible only to IBM employees.

@LibbyBot
Copy link

@cbridgha
Copy link
Member Author

#build

@LibbyBot
Copy link

Your personal build request is at https://wasrtc.hursley.ibm.com:9443/jazz/resource/itemOid/com.ibm.team.build.BuildResult/_uvx5gEFnEe-F88sHKWQ5jw

Target locations of links might be accessible only to IBM employees.

@LibbyBot
Copy link

Your personal pipeline request is at https://libh-proxy1.fyre.ibm.com/cognitive/pipelineAnalysis.html?uuid=16e920e3-68e5-4d09-bd64-db62938010fa

Target locations of links might be accessible only to IBM employees.

@LibbyBot
Copy link

The build cbridgha-29058-20240713-0155
https://wasrtc.hursley.ibm.com:9443/jazz/resource/itemOid/com.ibm.team.build.BuildResult/_D76ycEDsEe-Hn95lLM_tGQ
completed and has errors or failures.

For help analyzing your personal build, go to https://libh-proxy1.fyre.ibm.com/cognitive/buildAnalysis.html?uuid=_D76ycEDsEe-Hn95lLM_tGQ

@LibbyBot
Copy link

@LibbyBot
Copy link

The build cbridgha-29058-20240713-1640
https://wasrtc.hursley.ibm.com:9443/jazz/resource/itemOid/com.ibm.team.build.BuildResult/_uvx5gEFnEe-F88sHKWQ5jw
completed and has errors or failures.

For help analyzing your personal build, go to https://libh-proxy1.fyre.ibm.com/cognitive/buildAnalysis.html?uuid=_uvx5gEFnEe-F88sHKWQ5jw

for (FeatureResource versionedFeature : feature.getConstituents(SubsystemContentType.FEATURE_TYPE)) {
//Find the right public feature (should only be one) - set the result
ProvisioningFeatureDefinition versionedFeatureDef = getFeature(versionedFeature.getSymbolicName());
if (versionedFeatureDef.getVisibility() != Visibility.PUBLIC) {
Copy link
Member

Choose a reason for hiding this comment

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

If there is only one result expected we will still keep iterating over the list, worth considering reversing the check to

if (versionedFeatureDef.getVisibility() == Visibility.PUBLIC) {
return versionedFeatureDef;
// OR
result = versionedFeatureDef;
break;
}

Copy link
Member Author

Choose a reason for hiding this comment

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

thanks will do

@cbridgha
Copy link
Member Author

#build

if (versionedFeatureDef.getVisibility() == Visibility.PUBLIC) {
return versionedFeatureDef;
}
result = versionedFeatureDef;
Copy link
Member

Choose a reason for hiding this comment

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

not sure on the logic here, if a public feature is found return that feature, but if one isn't it still sets the result to the feature, I am assuming that this line (and the break) are not needed or it will just look at the first feature and return it regardless of whether it is public

Copy link
Member Author

Choose a reason for hiding this comment

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

no longer create a "result" variable - makes no sense... - added the possiblibilty of returning null in javadoc

break;
}
}
return result;
Copy link
Member

Choose a reason for hiding this comment

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

If we get to this point then we have not found a public feature, is this an error case?

Copy link
Member Author

Choose a reason for hiding this comment

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

not an error but return null

@LibbyBot
Copy link

Your personal build request is at https://wasrtc.hursley.ibm.com:9443/jazz/resource/itemOid/com.ibm.team.build.BuildResult/_ZBYEgEL1Ee-F88sHKWQ5jw

Target locations of links might be accessible only to IBM employees.

@LibbyBot
Copy link

Your personal pipeline request is at https://libh-proxy1.fyre.ibm.com/cognitive/pipelineAnalysis.html?uuid=dffbf0e8-1c24-4520-ba1d-58e2ff30dcda

Target locations of links might be accessible only to IBM employees.

@LibbyBot
Copy link

* @return ProvisioningFeatureDefinition
*/
private ProvisioningFeatureDefinition getVersionedFeature(String versionlessLinkingFeatureName) {
ProvisioningFeatureDefinition result = null;
Copy link
Member

Choose a reason for hiding this comment

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

result is never used is it (now the method returns null at the end)?

Copy link
Member Author

Choose a reason for hiding this comment

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

removed result

ProvisioningFeatureDefinition feature = resolverRepository.getFeature(name);
if (feature != null && feature.isVersionless()) {
ProvisioningFeatureDefinition firstChild = resolverRepository.findAllPossibleVersions(feature).get(0);
String plat = firstChild.getPlatformName();
Copy link
Member

Choose a reason for hiding this comment

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

do we need to null check firstChild?

Copy link
Member

Choose a reason for hiding this comment

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

If we do, we need to check whether the list is empty before calling get(0) because that will throw an exception.

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed made changes to check

Comment on lines 375 to 394
/**
* @return the resolvedPlatforms
*/
public Set<String> getResolvedPlatforms() {
return resolvedPlatforms;
}

/**
* @return the missingPlatforms
*/
public Set<String> getMissingPlatforms() {
return missingPlatforms;
}

/**
* @return the missingBasePlatforms
*/
public List<String> getMissingBasePlatforms() {
return missingBasePlatforms;
}
Copy link
Member

Choose a reason for hiding this comment

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

Please add more documentation about what each of these fields means and what data it contains.

These fields look like they are used in other places, but here seems like the most logical place to document them.

Copy link
Member

Choose a reason for hiding this comment

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

There's a little bit of doc on the constructor and it sounds like missingPlaforms and missingBasePlatforms are completely different? That could do with a better explanation and possibly missingBasePlatforms should be renamed.

Copy link
Member Author

Choose a reason for hiding this comment

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

yes tried to add javadoc - one is simply a missspelling of a platform name - one is related to a base name like MP or jakarta realted to a versionless feature - if they can't be derived up front - its an error, and the reason the feature isn't resolved.

Comment on lines +145 to +148
/**
* List of all the missing platforms after resolution
*/
Set<String> missingPlatforms;
Copy link
Member

Choose a reason for hiding this comment

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

What does it mean for a platform to be "missing"?

Copy link
Member

Choose a reason for hiding this comment

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

Will a platform name only be in this set if the user requested it explicitly?

@LibbyBot
Copy link

The build cbridgha-29058-20240715-1755
https://wasrtc.hursley.ibm.com:9443/jazz/resource/itemOid/com.ibm.team.build.BuildResult/_nP9sUEMEEe-F88sHKWQ5jw
completed successfully!

@LibbyBot
Copy link

The build cbridgha-29058-20240716-1034
https://wasrtc.hursley.ibm.com:9443/jazz/resource/itemOid/com.ibm.team.build.BuildResult/_Kal94EOQEe-F88sHKWQ5jw
completed and has errors or failures.

For help analyzing your personal build, go to https://libh-proxy1.fyre.ibm.com/cognitive/buildAnalysis.html?uuid=_Kal94EOQEe-F88sHKWQ5jw

@cbridgha cbridgha merged commit 014750b into OpenLiberty:integration Jul 17, 2024
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Completed Versionless Tasks
Development

Successfully merging this pull request may close these issues.

4 participants