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

Diagnostics and Quick fixes for lost config elements #220

Merged
merged 14 commits into from
Oct 10, 2023

Conversation

dshimo
Copy link
Contributor

@dshimo dshimo commented Oct 5, 2023

Addresses #67

CodeActionParticipant, AddFeature:

  • Add an initial draft for 'AddFeature' quickfix.
  • The idea for the quickfix is to provide a list of direct features because transitive relations offer too many.
  • As an enhancement, this quick fix could alternatively provide a list of some of the most commonly used features.

DiagnosticParticipant:

  • Adds additional check while parsing the server.xml to recognize config elements.
  • After the document is parsed, create relevant diagnostics for lost config elements.
  • Add a trigger line for grabbing the feature list even if a FeatureManager is empty or not found

New FeatureListGraph class:

  • Designed as a manager class for retrieving a desired FeatureListNode
  • On assumption that all features and config elements have a unique identifier, this class uses a hashmap to provide constant time lookup to a node.
  • To provide a list of transitive relations for features -> config element or vice versa, FeatureListGraph implements a breadth-first-search iterative strategy on a given node.

New FeatureListNode class:

  • A new class to represent a generic node in a Feature List XML. It's intended to store features or config elements.
  • isConfigElement operates on the heuristic that features provide major versions and that . isn't typical in a normal element name.
  • 'Enables' refers to when this node automatically pulls in another feature or config element.
  • 'Enablers' refers to features that would automatically pull in this node.

FeatureService:

  • The priority for using a generated local feature list is placed higher. This xml file not only provides the list of features but also the necessary metadata for recognizing config elements and their relations.
  • Build the FeatureListGraph while reading the feature list

Tests:

  • Add check that diagnostics appear on expected locations
  • Add check that the feature list xml gets digested within expectations

Copy link
Member

@cherylking cherylking left a comment

Choose a reason for hiding this comment

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

My comment about the FeatureListGraph in FeatureService is significant and requires some code changes. Hopefully it's doable.

@dshimo dshimo marked this pull request as ready for review October 9, 2023 22:23
Copy link
Member

@cherylking cherylking left a comment

Choose a reason for hiding this comment

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

See one comment about LOGGER variable.

@dshimo dshimo merged commit 9cd3b88 into OpenLiberty:4q2023 Oct 10, 2023
4 checks passed
dshimo added a commit that referenced this pull request Oct 10, 2023
dshimo added a commit that referenced this pull request Oct 10, 2023
* Add FeatureListGraph, FeatureListNode, AddFeature

* Use new surefire with junit 5 support, skip tests in build step GHA

* reduce feature request delay 120 -> 10
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